@junwan666/remotion-animation-utils 4.0.448-zh.0
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/LICENSE.md +7 -0
- package/README.md +18 -0
- package/dist/esm/index.mjs +680 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +18 -0
- package/dist/transformation-helpers/interpolate-styles/constants.d.ts +3 -0
- package/dist/transformation-helpers/interpolate-styles/constants.js +7 -0
- package/dist/transformation-helpers/interpolate-styles/index.d.ts +6 -0
- package/dist/transformation-helpers/interpolate-styles/index.js +195 -0
- package/dist/transformation-helpers/interpolate-styles/utils.d.ts +41 -0
- package/dist/transformation-helpers/interpolate-styles/utils.js +178 -0
- package/dist/transformation-helpers/make-transform/index.d.ts +3 -0
- package/dist/transformation-helpers/make-transform/index.js +29 -0
- package/dist/transformation-helpers/make-transform/is-unit-with-string.d.ts +1 -0
- package/dist/transformation-helpers/make-transform/is-unit-with-string.js +18 -0
- package/dist/transformation-helpers/make-transform/transform-functions.d.ts +46 -0
- package/dist/transformation-helpers/make-transform/transform-functions.js +301 -0
- package/dist/type.d.ts +35 -0
- package/dist/type.js +34 -0
- package/package.json +55 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable no-redeclare */
|
|
3
|
+
/* eslint-disable max-params */
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.matrix = matrix;
|
|
6
|
+
exports.matrix3d = matrix3d;
|
|
7
|
+
exports.perspective = perspective;
|
|
8
|
+
exports.rotate = rotate;
|
|
9
|
+
exports.rotate3d = rotate3d;
|
|
10
|
+
exports.rotateX = rotateX;
|
|
11
|
+
exports.rotateY = rotateY;
|
|
12
|
+
exports.rotateZ = rotateZ;
|
|
13
|
+
exports.scale = scale;
|
|
14
|
+
exports.scale3d = scale3d;
|
|
15
|
+
exports.scaleX = scaleX;
|
|
16
|
+
exports.scaleY = scaleY;
|
|
17
|
+
exports.scaleZ = scaleZ;
|
|
18
|
+
exports.skew = skew;
|
|
19
|
+
exports.skewX = skewX;
|
|
20
|
+
exports.skewY = skewY;
|
|
21
|
+
exports.translate = translate;
|
|
22
|
+
exports.translate3d = translate3d;
|
|
23
|
+
exports.translateX = translateX;
|
|
24
|
+
exports.translateY = translateY;
|
|
25
|
+
exports.translateZ = translateZ;
|
|
26
|
+
const type_1 = require("../../type");
|
|
27
|
+
const is_unit_with_string_1 = require("./is-unit-with-string");
|
|
28
|
+
/* Matrix transformation */
|
|
29
|
+
const checkNumber = ({ num, param, api, }) => {
|
|
30
|
+
if (typeof num === 'undefined') {
|
|
31
|
+
throw new TypeError(`Argument passed to "${api}" for param "${param}" is undefined`);
|
|
32
|
+
}
|
|
33
|
+
if (typeof num !== 'number') {
|
|
34
|
+
throw new TypeError(`Argument passed to "${api}" for param "${param}" is ${JSON.stringify(num)}`);
|
|
35
|
+
}
|
|
36
|
+
if (!Number.isFinite(num)) {
|
|
37
|
+
throw new TypeError(`Argument passed to "${api}" for param "${param}" is ${JSON.stringify(num)} (must be finite)`);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function matrix(a, b, c, d, tx, ty) {
|
|
41
|
+
checkNumber({ num: a, param: 'a', api: 'matrix' });
|
|
42
|
+
checkNumber({ num: b, param: 'b', api: 'matrix' });
|
|
43
|
+
checkNumber({ num: c, param: 'c', api: 'matrix' });
|
|
44
|
+
checkNumber({ num: d, param: 'd', api: 'matrix' });
|
|
45
|
+
checkNumber({ num: tx, param: 'tx', api: 'matrix' });
|
|
46
|
+
checkNumber({ num: ty, param: 'ty', api: 'matrix' });
|
|
47
|
+
return `matrix(${a}, ${b}, ${c}, ${d}, ${tx}, ${ty})`;
|
|
48
|
+
}
|
|
49
|
+
function matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4) {
|
|
50
|
+
checkNumber({ num: a1, param: 'a1', api: 'matrix3d' });
|
|
51
|
+
checkNumber({ num: b1, param: 'b1', api: 'matrix3d' });
|
|
52
|
+
checkNumber({ num: c1, param: 'c1', api: 'matrix3d' });
|
|
53
|
+
checkNumber({ num: d1, param: 'd1', api: 'matrix3d' });
|
|
54
|
+
checkNumber({ num: a2, param: 'a2', api: 'matrix3d' });
|
|
55
|
+
checkNumber({ num: b2, param: 'b2', api: 'matrix3d' });
|
|
56
|
+
checkNumber({ num: c2, param: 'c2', api: 'matrix3d' });
|
|
57
|
+
checkNumber({ num: d2, param: 'd2', api: 'matrix3d' });
|
|
58
|
+
checkNumber({ num: a3, param: 'a3', api: 'matrix3d' });
|
|
59
|
+
checkNumber({ num: b3, param: 'b3', api: 'matrix3d' });
|
|
60
|
+
checkNumber({ num: c3, param: 'c3', api: 'matrix3d' });
|
|
61
|
+
checkNumber({ num: d3, param: 'd3', api: 'matrix3d' });
|
|
62
|
+
checkNumber({ num: a4, param: 'a4', api: 'matrix3d' });
|
|
63
|
+
checkNumber({ num: b4, param: 'b4', api: 'matrix3d' });
|
|
64
|
+
checkNumber({ num: c4, param: 'c4', api: 'matrix3d' });
|
|
65
|
+
checkNumber({ num: d4, param: 'd4', api: 'matrix3d' });
|
|
66
|
+
return `matrix3d(${a1}, ${b1}, ${c1}, ${d1}, ${a2}, ${b2}, ${c2}, ${d2}, ${a3}, ${b3}, ${c3}, ${d3}, ${a4}, ${b4}, ${c4}, ${d4})`;
|
|
67
|
+
}
|
|
68
|
+
function perspective(length, unit = 'px') {
|
|
69
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(length, type_1.lengthUnits)) {
|
|
70
|
+
return `perspective(${length})`;
|
|
71
|
+
}
|
|
72
|
+
checkNumber({ num: length, param: 'length', api: 'perspective' });
|
|
73
|
+
return `perspective(${length}${unit})`;
|
|
74
|
+
}
|
|
75
|
+
function rotate(angle, unit = 'deg') {
|
|
76
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
|
|
77
|
+
return `rotate(${angle})`;
|
|
78
|
+
}
|
|
79
|
+
checkNumber({ num: angle, param: 'angle', api: 'rotate' });
|
|
80
|
+
return `rotate(${angle}${unit})`;
|
|
81
|
+
}
|
|
82
|
+
function rotate3d(x, y, z, angle, unit = 'deg') {
|
|
83
|
+
checkNumber({ num: x, param: 'x', api: 'rotate3d' });
|
|
84
|
+
checkNumber({ num: y, param: 'y', api: 'rotate3d' });
|
|
85
|
+
checkNumber({ num: z, param: 'z', api: 'rotate3d' });
|
|
86
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
|
|
87
|
+
return `rotate3d(${x}, ${y}, ${z}, ${angle})`;
|
|
88
|
+
}
|
|
89
|
+
checkNumber({ num: angle, param: 'angle', api: 'rotate3d' });
|
|
90
|
+
return `rotate3d(${x}, ${y}, ${z}, ${angle}${unit})`;
|
|
91
|
+
}
|
|
92
|
+
function rotateX(angle, unit = 'deg') {
|
|
93
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
|
|
94
|
+
return `rotateX(${angle})`;
|
|
95
|
+
}
|
|
96
|
+
checkNumber({ num: angle, param: 'angle', api: 'rotateX' });
|
|
97
|
+
return `rotateX(${angle}${unit})`;
|
|
98
|
+
}
|
|
99
|
+
function rotateY(angle, unit = 'deg') {
|
|
100
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
|
|
101
|
+
return `rotateY(${angle})`;
|
|
102
|
+
}
|
|
103
|
+
checkNumber({ num: angle, param: 'angle', api: 'rotateY' });
|
|
104
|
+
return `rotateY(${angle}${unit})`;
|
|
105
|
+
}
|
|
106
|
+
function rotateZ(angle, unit = 'deg') {
|
|
107
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
|
|
108
|
+
return `rotateZ(${angle})`;
|
|
109
|
+
}
|
|
110
|
+
checkNumber({ num: angle, param: 'angle', api: 'rotateZ' });
|
|
111
|
+
return `rotateZ(${angle}${unit})`;
|
|
112
|
+
}
|
|
113
|
+
/* Scale */
|
|
114
|
+
function scale(x, y = x) {
|
|
115
|
+
checkNumber({ num: x, param: 'x', api: 'scale' });
|
|
116
|
+
return `scale(${x}, ${y})`;
|
|
117
|
+
}
|
|
118
|
+
function scale3d(x, y, z) {
|
|
119
|
+
checkNumber({ num: x, param: 'x', api: 'scale3d' });
|
|
120
|
+
checkNumber({ num: y, param: 'y', api: 'scale3d' });
|
|
121
|
+
checkNumber({ num: z, param: 'z', api: 'scale3d' });
|
|
122
|
+
return `scale3d(${x}, ${y}, ${z})`;
|
|
123
|
+
}
|
|
124
|
+
function scaleX(x) {
|
|
125
|
+
checkNumber({ num: x, param: 'x', api: 'scaleX' });
|
|
126
|
+
return `scaleX(${x})`;
|
|
127
|
+
}
|
|
128
|
+
function scaleY(y) {
|
|
129
|
+
checkNumber({ num: y, param: 'y', api: 'scaleY' });
|
|
130
|
+
return `scaleY(${y})`;
|
|
131
|
+
}
|
|
132
|
+
function scaleZ(z) {
|
|
133
|
+
checkNumber({ num: z, param: 'z', api: 'scaleZ' });
|
|
134
|
+
return `scaleZ(${z})`;
|
|
135
|
+
}
|
|
136
|
+
function skew(...args) {
|
|
137
|
+
const [arg1, arg2, arg3, arg4] = args;
|
|
138
|
+
if (arguments.length === 1) {
|
|
139
|
+
// Case A
|
|
140
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(arg1, type_1.angleUnits)) {
|
|
141
|
+
return `skew(${arg1}, ${arg1})`;
|
|
142
|
+
}
|
|
143
|
+
// Case Z
|
|
144
|
+
checkNumber({ num: arg1, param: 'angle', api: 'skew' });
|
|
145
|
+
return `skew(${arg1}deg, ${arg1}deg)`;
|
|
146
|
+
}
|
|
147
|
+
if (arguments.length === 2) {
|
|
148
|
+
// Case B
|
|
149
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(arg1, type_1.angleUnits) &&
|
|
150
|
+
(0, is_unit_with_string_1.isUnitWithString)(arg2, type_1.angleUnits)) {
|
|
151
|
+
return `skew(${arg1}, ${arg2})`;
|
|
152
|
+
}
|
|
153
|
+
// Case C
|
|
154
|
+
if (typeof arg1 === 'number' && typeof arg2 !== 'number') {
|
|
155
|
+
checkNumber({ num: arg1, param: 'angle', api: 'skew' });
|
|
156
|
+
return `skew(${arg1}${arg2}, ${arg1}${arg2})`;
|
|
157
|
+
}
|
|
158
|
+
// Case D
|
|
159
|
+
if (typeof arg1 === 'number' && typeof arg2 === 'number') {
|
|
160
|
+
checkNumber({ num: arg1, param: 'angle', api: 'skew' });
|
|
161
|
+
checkNumber({ num: arg2, param: 'angle', api: 'skew' });
|
|
162
|
+
return `skew(${arg1}deg, ${arg2}deg)`;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (arguments.length === 4) {
|
|
166
|
+
// Case E
|
|
167
|
+
if (typeof arg1 === 'number' &&
|
|
168
|
+
(0, is_unit_with_string_1.isUnitWithString)(arg2, type_1.angleUnits) &&
|
|
169
|
+
typeof arg3 === 'number' &&
|
|
170
|
+
(0, is_unit_with_string_1.isUnitWithString)(arg4, type_1.angleUnits)) {
|
|
171
|
+
checkNumber({ num: arg1, param: 'angle', api: 'skew' });
|
|
172
|
+
checkNumber({ num: arg3, param: 'angle', api: 'skew' });
|
|
173
|
+
return `skew(${arg1}${arg2}, ${arg3}${arg4})`;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
throw new TypeError([
|
|
177
|
+
'skew() supports only the following signatures:',
|
|
178
|
+
'skew(angle: AngleUnitString): string;',
|
|
179
|
+
'skew(angle: AngleUnitString, angle2: AngleUnitString): string;',
|
|
180
|
+
'skew(angle: number, unit: AngleUnit): string;',
|
|
181
|
+
'skew(angleX: number, angleY: number): string;',
|
|
182
|
+
'skew(angleX: number, unitX: AngleUnit, angleY: number, unitY: AngleUnit): string;',
|
|
183
|
+
].join('\n'));
|
|
184
|
+
}
|
|
185
|
+
function skewX(angle, unit = 'deg') {
|
|
186
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
|
|
187
|
+
return `skewX(${angle})`;
|
|
188
|
+
}
|
|
189
|
+
checkNumber({ num: angle, param: 'angle', api: 'skewX' });
|
|
190
|
+
return `skewX(${angle}${unit})`;
|
|
191
|
+
}
|
|
192
|
+
function skewY(angle, unit = 'deg') {
|
|
193
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
|
|
194
|
+
return `skewY(${angle})`;
|
|
195
|
+
}
|
|
196
|
+
checkNumber({ num: angle, param: 'angle', api: 'skewY' });
|
|
197
|
+
return `skewY(${angle}${unit})`;
|
|
198
|
+
}
|
|
199
|
+
function translate(...args) {
|
|
200
|
+
const [arg1, arg2, arg3, arg4] = args;
|
|
201
|
+
if (arguments.length === 1) {
|
|
202
|
+
// Case A
|
|
203
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(arg1, type_1.lengthPercentageUnits)) {
|
|
204
|
+
return `translate(${arg1})`;
|
|
205
|
+
}
|
|
206
|
+
// Case B
|
|
207
|
+
checkNumber({ num: arg1, param: 'x', api: 'translate' });
|
|
208
|
+
return `translate(${arg1}px)`;
|
|
209
|
+
}
|
|
210
|
+
if (arguments.length === 2) {
|
|
211
|
+
// Case C
|
|
212
|
+
if (typeof arg1 === 'number' && typeof arg2 === 'number') {
|
|
213
|
+
checkNumber({ num: arg1, param: 'x', api: 'translate' });
|
|
214
|
+
checkNumber({ num: arg2, param: 'y', api: 'translate' });
|
|
215
|
+
return `translate(${arg1}px, ${arg2}px)`;
|
|
216
|
+
}
|
|
217
|
+
// Case C.1
|
|
218
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(arg1, type_1.lengthPercentageUnits) &&
|
|
219
|
+
(0, is_unit_with_string_1.isUnitWithString)(arg2, type_1.lengthPercentageUnits)) {
|
|
220
|
+
return `translate(${arg1}, ${arg2})`;
|
|
221
|
+
}
|
|
222
|
+
// Case D
|
|
223
|
+
if (typeof arg1 === 'number' && typeof arg2 !== 'number') {
|
|
224
|
+
checkNumber({ num: arg1, param: 'x', api: 'translate' });
|
|
225
|
+
return `translate(${arg1}${arg2})`;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (arguments.length === 4) {
|
|
229
|
+
// Case E
|
|
230
|
+
if (typeof arg1 === 'number' && typeof arg3 === 'number') {
|
|
231
|
+
checkNumber({ num: arg1, param: 'x', api: 'translate' });
|
|
232
|
+
checkNumber({ num: arg3, param: 'y', api: 'translate' });
|
|
233
|
+
return `translate(${arg1}${arg2}, ${arg3}${arg4})`;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
throw new TypeError([
|
|
237
|
+
`translate() supports only the following signatures:`,
|
|
238
|
+
`translate(x: LengthPercentageUnitString)`,
|
|
239
|
+
`translate(x: number)`,
|
|
240
|
+
`translate(x: number, y: number)`,
|
|
241
|
+
`translate(translation: number, unit: LengthPercentageUnit)`,
|
|
242
|
+
`translate(x: number, unitX: LengthPercentageUnit, y: number, unitY: LengthPercentageUnit): string;`,
|
|
243
|
+
].join('\n'));
|
|
244
|
+
}
|
|
245
|
+
function translate3d(...args) {
|
|
246
|
+
if (arguments.length === 3) {
|
|
247
|
+
const [x, y, z] = args;
|
|
248
|
+
const vars = [x, y, z].map((arg, i) => {
|
|
249
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(arg, type_1.lengthPercentageUnits)) {
|
|
250
|
+
return arg;
|
|
251
|
+
}
|
|
252
|
+
checkNumber({
|
|
253
|
+
num: arg,
|
|
254
|
+
param: i === 0 ? 'x' : i === 1 ? 'y' : 'z',
|
|
255
|
+
api: 'translate3d',
|
|
256
|
+
});
|
|
257
|
+
if (typeof arg === 'number') {
|
|
258
|
+
return `${arg}px`;
|
|
259
|
+
}
|
|
260
|
+
return arg;
|
|
261
|
+
});
|
|
262
|
+
return `translate3d(${vars.join(', ')})`;
|
|
263
|
+
}
|
|
264
|
+
if (arguments.length === 6) {
|
|
265
|
+
const [x, unitX, y, unitY, z, unitZ] = args;
|
|
266
|
+
if (typeof x === 'number' &&
|
|
267
|
+
typeof y === 'number' &&
|
|
268
|
+
typeof z === 'number') {
|
|
269
|
+
checkNumber({ num: x, param: 'x', api: 'translate3d' });
|
|
270
|
+
checkNumber({ num: y, param: 'y', api: 'translate3d' });
|
|
271
|
+
checkNumber({ num: z, param: 'z', api: 'translate3d' });
|
|
272
|
+
return `translate3d(${x}${unitX}, ${y}${unitY}, ${z}${unitZ})`;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
throw new TypeError([
|
|
276
|
+
`translate3d() supports only the following signatures:`,
|
|
277
|
+
`translate3d(x: LengthPercentageUnitString, y: LengthPercentageUnitString, z: LengthPercentageUnitString)`,
|
|
278
|
+
`translate3d(x: number, unitX: LengthPercentageUnit, y: number, unitY: LengthPercentageUnit, z: number, unitZ: LengthUnit)`,
|
|
279
|
+
].join('\n'));
|
|
280
|
+
}
|
|
281
|
+
function translateX(x, unit = 'px') {
|
|
282
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(x, type_1.lengthPercentageUnits)) {
|
|
283
|
+
return `translateX(${x})`;
|
|
284
|
+
}
|
|
285
|
+
checkNumber({ num: x, param: 'x', api: 'translateX' });
|
|
286
|
+
return `translateX(${x}${unit})`;
|
|
287
|
+
}
|
|
288
|
+
function translateY(y, unit = 'px') {
|
|
289
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(y, type_1.lengthPercentageUnits)) {
|
|
290
|
+
return `translateY(${y})`;
|
|
291
|
+
}
|
|
292
|
+
checkNumber({ num: y, param: 'y', api: 'translateY' });
|
|
293
|
+
return `translateY(${y}${unit})`;
|
|
294
|
+
}
|
|
295
|
+
function translateZ(z, unit = 'px') {
|
|
296
|
+
if ((0, is_unit_with_string_1.isUnitWithString)(z, type_1.lengthUnits)) {
|
|
297
|
+
return `translateZ(${z})`;
|
|
298
|
+
}
|
|
299
|
+
checkNumber({ num: z, param: 'z', api: 'translateZ' });
|
|
300
|
+
return `translateZ(${z}${unit})`;
|
|
301
|
+
}
|
package/dist/type.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { breakDownValueIntoUnitNumberAndFunctions } from './transformation-helpers/interpolate-styles/utils';
|
|
2
|
+
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';
|
|
3
|
+
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"];
|
|
4
|
+
export declare const angleUnits: readonly ["rad", "deg", "grad", "turn"];
|
|
5
|
+
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"];
|
|
6
|
+
type LengthUnit = (typeof lengthUnits)[number];
|
|
7
|
+
type AngleUnit = (typeof angleUnits)[number];
|
|
8
|
+
type LengthPercentageUnit = (typeof lengthPercentageUnits)[number];
|
|
9
|
+
export type LengthUnitString = `${number}${LengthUnit}`;
|
|
10
|
+
export type LengthPercentageUnitString = `${number}${LengthPercentageUnit}`;
|
|
11
|
+
export type AngleUnitString = `${number}${AngleUnit}`;
|
|
12
|
+
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>;
|
|
13
|
+
type MatcherType = RegExp | undefined;
|
|
14
|
+
type ColorMatchers = {
|
|
15
|
+
rgb: MatcherType;
|
|
16
|
+
rgba: MatcherType;
|
|
17
|
+
hsl: MatcherType;
|
|
18
|
+
hsla: MatcherType;
|
|
19
|
+
hex3: MatcherType;
|
|
20
|
+
hex4: MatcherType;
|
|
21
|
+
hex5: MatcherType;
|
|
22
|
+
hex6: MatcherType;
|
|
23
|
+
hex8: MatcherType;
|
|
24
|
+
oklch: MatcherType;
|
|
25
|
+
oklab: MatcherType;
|
|
26
|
+
lab: MatcherType;
|
|
27
|
+
lch: MatcherType;
|
|
28
|
+
hwb: MatcherType;
|
|
29
|
+
};
|
|
30
|
+
type Style = React.CSSProperties;
|
|
31
|
+
type CSSPropertiesKey = keyof Style;
|
|
32
|
+
type CSSPropertiesValue = Style[CSSPropertiesKey];
|
|
33
|
+
type UnitNumberAndFunctions = ReturnType<typeof breakDownValueIntoUnitNumberAndFunctions>;
|
|
34
|
+
type UnitNumberAndFunction = UnitNumberAndFunctions[0];
|
|
35
|
+
export type { AngleUnit, ColorMatchers, CSSPropertiesKey, CSSPropertiesValue, LengthPercentageUnit, LengthUnit, Style, TransformFunctionReturnType, UnitNumberAndFunction, };
|
package/dist/type.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lengthPercentageUnits = exports.angleUnits = exports.lengthUnits = void 0;
|
|
4
|
+
exports.lengthUnits = [
|
|
5
|
+
'px',
|
|
6
|
+
'em',
|
|
7
|
+
'rem',
|
|
8
|
+
'pt',
|
|
9
|
+
'cap',
|
|
10
|
+
'ch',
|
|
11
|
+
'ex',
|
|
12
|
+
'ic',
|
|
13
|
+
'lh',
|
|
14
|
+
'rlh',
|
|
15
|
+
'vmax',
|
|
16
|
+
'vmin',
|
|
17
|
+
'vb',
|
|
18
|
+
'vi',
|
|
19
|
+
'cqw',
|
|
20
|
+
'vh',
|
|
21
|
+
'vw',
|
|
22
|
+
'cqh',
|
|
23
|
+
'cqi',
|
|
24
|
+
'cqb',
|
|
25
|
+
'cqmin',
|
|
26
|
+
'cqmax',
|
|
27
|
+
'cm',
|
|
28
|
+
'mm',
|
|
29
|
+
'Q',
|
|
30
|
+
'in',
|
|
31
|
+
'pc',
|
|
32
|
+
];
|
|
33
|
+
exports.angleUnits = ['rad', 'deg', 'grad', 'turn'];
|
|
34
|
+
exports.lengthPercentageUnits = ['%', ...exports.lengthUnits];
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repository": {
|
|
3
|
+
"url": "https://github.com/JunWan666/remotion-zh/tree/main/packages/animation-utils"
|
|
4
|
+
},
|
|
5
|
+
"name": "@junwan666/remotion-animation-utils",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Chetan Karwa",
|
|
8
|
+
"email": "cbkarwa@gmail.com"
|
|
9
|
+
},
|
|
10
|
+
"version": "4.0.448-zh.0",
|
|
11
|
+
"description": "Helpers for animating CSS properties",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.mjs",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"formatting": "oxfmt src --check",
|
|
17
|
+
"format": "oxfmt src",
|
|
18
|
+
"lint": "eslint src",
|
|
19
|
+
"make": "tsgo -d && bun --env-file=../.env.bundle bundle.ts",
|
|
20
|
+
"test": "bun test src"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"remotion": "npm:@junwan666/remotion@4.0.448-zh.0"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"!dist/test"
|
|
28
|
+
],
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": ">=16.8.0",
|
|
31
|
+
"react-dom": ">=16.8.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@remotion/eslint-config-internal": "npm:@junwan666/remotion-eslint-config-internal@4.0.448-zh.0",
|
|
35
|
+
"eslint": "9.19.0",
|
|
36
|
+
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
37
|
+
},
|
|
38
|
+
"exports": {
|
|
39
|
+
"./package.json": "./package.json",
|
|
40
|
+
".": {
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"module": "./dist/esm/index.mjs",
|
|
43
|
+
"import": "./dist/esm/index.mjs",
|
|
44
|
+
"require": "./dist/index.js"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"keywords": [
|
|
51
|
+
"remotion",
|
|
52
|
+
"animation-utils"
|
|
53
|
+
],
|
|
54
|
+
"homepage": "https://www.remotion.dev/docs/animation-utils/"
|
|
55
|
+
}
|