@remotion/paths 4.0.244 → 4.0.245
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/evolve-path.d.ts +0 -6
- package/dist/evolve-path.js +3 -5
- package/dist/extend-viewbox.d.ts +0 -5
- package/dist/extend-viewbox.js +3 -4
- package/dist/get-bounding-box.d.ts +0 -5
- package/dist/get-bounding-box.js +1 -2
- package/dist/get-instruction-index-at-length.d.ts +0 -8
- package/dist/get-instruction-index-at-length.js +2 -6
- package/dist/get-length.d.ts +0 -5
- package/dist/get-length.js +2 -3
- package/dist/get-point-at-length.d.ts +0 -6
- package/dist/get-point-at-length.js +2 -4
- package/dist/get-subpaths.d.ts +0 -5
- package/dist/get-subpaths.js +3 -4
- package/dist/get-tangent-at-length.d.ts +0 -6
- package/dist/get-tangent-at-length.js +3 -5
- package/dist/interpolate-path/interpolate-path.d.ts +0 -7
- package/dist/interpolate-path/interpolate-path.js +3 -6
- package/dist/normalize-path.d.ts +0 -6
- package/dist/normalize-path.js +3 -5
- package/dist/parse-path.d.ts +0 -6
- package/dist/parse-path.js +1 -3
- package/dist/reduce-instructions.d.ts +0 -5
- package/dist/reduce-instructions.js +2 -3
- package/dist/reset-path.d.ts +0 -5
- package/dist/reset-path.js +1 -2
- package/dist/reverse-path.d.ts +0 -5
- package/dist/reverse-path.js +2 -3
- package/dist/scale-path.d.ts +0 -9
- package/dist/scale-path.js +1 -6
- package/dist/translate-path.d.ts +0 -8
- package/dist/translate-path.js +1 -5
- package/dist/warp-path/index.d.ts +0 -5
- package/dist/warp-path/index.js +2 -3
- package/package.json +2 -2
package/dist/evolve-path.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Animates an SVG from being invisible to it's full length.
|
|
3
|
-
* @param {string} path A valid SVG path
|
|
4
|
-
* @param {number} progress The first valid SVG path
|
|
5
|
-
* @see [Documentation](https://remotion.dev/docs/paths/evolve-path)
|
|
6
|
-
*/
|
|
7
1
|
export declare const evolvePath: (progress: number, path: string) => {
|
|
8
2
|
strokeDasharray: string;
|
|
9
3
|
strokeDashoffset: number;
|
package/dist/evolve-path.js
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.evolvePath = void 0;
|
|
4
4
|
const get_length_1 = require("./get-length");
|
|
5
|
-
|
|
6
|
-
* @description Animates an SVG from being invisible to
|
|
7
|
-
* @
|
|
8
|
-
* @param {number} progress The first valid SVG path
|
|
9
|
-
* @see [Documentation](https://remotion.dev/docs/paths/evolve-path)
|
|
5
|
+
/*
|
|
6
|
+
* @description Animates an SVG path from being invisible to its full length.
|
|
7
|
+
* @see [Documentation](https://www.remotion.dev/docs/paths/evolve-path)
|
|
10
8
|
*/
|
|
11
9
|
const evolvePath = (progress, path) => {
|
|
12
10
|
const length = (0, get_length_1.getLength)(path);
|
package/dist/extend-viewbox.d.ts
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Extends a viewbox in all directions by a scale factor.
|
|
3
|
-
* @param {string} currentViewBox A valid SVG viewBox
|
|
4
|
-
* @see [Documentation](https://remotion.dev/docs/paths/extend-viewbox)
|
|
5
|
-
*/
|
|
6
1
|
export declare const extendViewBox: (currentViewBox: string, scale: number) => string;
|
package/dist/extend-viewbox.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extendViewBox = void 0;
|
|
4
|
-
|
|
5
|
-
* @description
|
|
6
|
-
* @
|
|
7
|
-
* @see [Documentation](https://remotion.dev/docs/paths/extend-viewbox)
|
|
4
|
+
/*
|
|
5
|
+
* @description Widens an SVG viewBox in all directions by a certain scale factor.
|
|
6
|
+
* @see [Documentation](https://www.remotion.dev/docs/paths/extend-viewbox)
|
|
8
7
|
*/
|
|
9
8
|
const extendViewBox = (currentViewBox, scale) => {
|
|
10
9
|
const relativeScale = scale - 1;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import type { BoundingBox, ReducedInstruction } from './helpers/types';
|
|
2
2
|
export declare const getBoundingBoxFromInstructions: (instructions: ReducedInstruction[]) => BoundingBox;
|
|
3
|
-
/**
|
|
4
|
-
* @description Returns the bounding box of the given path, suitable for calculating the viewBox value that you need to pass to an SVG.
|
|
5
|
-
* @param {string} d
|
|
6
|
-
* @see [Documentation](https://www.remotion.dev/docs/paths/get-bounding-box)
|
|
7
|
-
*/
|
|
8
3
|
export declare const getBoundingBox: (d: string) => BoundingBox;
|
package/dist/get-bounding-box.js
CHANGED
|
@@ -153,9 +153,8 @@ const getBoundingBoxFromInstructions = (instructions) => {
|
|
|
153
153
|
};
|
|
154
154
|
};
|
|
155
155
|
exports.getBoundingBoxFromInstructions = getBoundingBoxFromInstructions;
|
|
156
|
-
|
|
156
|
+
/*
|
|
157
157
|
* @description Returns the bounding box of the given path, suitable for calculating the viewBox value that you need to pass to an SVG.
|
|
158
|
-
* @param {string} d
|
|
159
158
|
* @see [Documentation](https://www.remotion.dev/docs/paths/get-bounding-box)
|
|
160
159
|
*/
|
|
161
160
|
const getBoundingBox = (d) => {
|
|
@@ -4,13 +4,5 @@ type InstructionAtLength = {
|
|
|
4
4
|
lengthIntoInstruction: number;
|
|
5
5
|
};
|
|
6
6
|
export declare const getInstructionIndexAtLengthFromConstructed: (constructed: Constructed, fractionLength: number) => InstructionAtLength;
|
|
7
|
-
/**
|
|
8
|
-
* @description Gets the index of the instruction and the part length into the instruction at a specified length along an SVG path.
|
|
9
|
-
* @see [Documentation](https://remotion.dev/docs/paths/get-instruction-index-at-length)
|
|
10
|
-
* @param path The SVG path data as a string.
|
|
11
|
-
* @param length The length along the path at which to find the instruction index and the part length into the instruction.
|
|
12
|
-
* @returns {InstructionAtLength} Object containing the index of the instruction and the part length into the instruction at the given length.
|
|
13
|
-
* @throws {Error} If the given length is less than 0 or greater than the total length of the path, or if the path is invalid.
|
|
14
|
-
*/
|
|
15
7
|
export declare const getInstructionIndexAtLength: (path: string, length: number) => InstructionAtLength;
|
|
16
8
|
export {};
|
|
@@ -19,13 +19,9 @@ const getInstructionIndexAtLengthFromConstructed = (constructed, fractionLength)
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
exports.getInstructionIndexAtLengthFromConstructed = getInstructionIndexAtLengthFromConstructed;
|
|
22
|
-
|
|
22
|
+
/*
|
|
23
23
|
* @description Gets the index of the instruction and the part length into the instruction at a specified length along an SVG path.
|
|
24
|
-
* @see [Documentation](https://remotion.dev/docs/paths/get-instruction-index-at-length)
|
|
25
|
-
* @param path The SVG path data as a string.
|
|
26
|
-
* @param length The length along the path at which to find the instruction index and the part length into the instruction.
|
|
27
|
-
* @returns {InstructionAtLength} Object containing the index of the instruction and the part length into the instruction at the given length.
|
|
28
|
-
* @throws {Error} If the given length is less than 0 or greater than the total length of the path, or if the path is invalid.
|
|
24
|
+
* @see [Documentation](https://www.remotion.dev/docs/paths/get-instruction-index-at-length)
|
|
29
25
|
*/
|
|
30
26
|
const getInstructionIndexAtLength = (path, length) => {
|
|
31
27
|
const constructed = (0, construct_1.construct)(path);
|
package/dist/get-length.d.ts
CHANGED
package/dist/get-length.js
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.getLength = void 0;
|
|
5
5
|
const construct_1 = require("./helpers/construct");
|
|
6
|
-
|
|
6
|
+
/*
|
|
7
7
|
* @description Gets the length of an SVG path.
|
|
8
|
-
* @
|
|
9
|
-
* @see [Documentation](https://remotion.dev/docs/paths/get-length)
|
|
8
|
+
* @see [Documentation](https://www.remotion.dev/docs/paths/get-length)
|
|
10
9
|
*/
|
|
11
10
|
const getLength = (path) => {
|
|
12
11
|
const constructucted = (0, construct_1.construct)(path);
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Gets the coordinates of a point which is on an SVG path.
|
|
3
|
-
* @param {string} path A valid SVG path
|
|
4
|
-
* @param {number} length The length at which the point should be sampled
|
|
5
|
-
* @see [Documentation](https://remotion.dev/docs/paths/get-point-at-length)
|
|
6
|
-
*/
|
|
7
1
|
export declare const getPointAtLength: (path: string, length: number) => import("./helpers/types").Point;
|
|
@@ -3,11 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getPointAtLength = void 0;
|
|
4
4
|
const get_instruction_index_at_length_1 = require("./get-instruction-index-at-length");
|
|
5
5
|
const construct_1 = require("./helpers/construct");
|
|
6
|
-
|
|
6
|
+
/*
|
|
7
7
|
* @description Gets the coordinates of a point which is on an SVG path.
|
|
8
|
-
* @
|
|
9
|
-
* @param {number} length The length at which the point should be sampled
|
|
10
|
-
* @see [Documentation](https://remotion.dev/docs/paths/get-point-at-length)
|
|
8
|
+
* @see [Documentation](https://www.remotion.dev/docs/paths/get-point-at-length)
|
|
11
9
|
*/
|
|
12
10
|
const getPointAtLength = (path, length) => {
|
|
13
11
|
const constructed = (0, construct_1.construct)(path);
|
package/dist/get-subpaths.d.ts
CHANGED
package/dist/get-subpaths.js
CHANGED
|
@@ -4,10 +4,9 @@ exports.getSubpaths = void 0;
|
|
|
4
4
|
const construct_1 = require("./helpers/construct");
|
|
5
5
|
const parse_path_1 = require("./parse-path");
|
|
6
6
|
const serialize_instructions_1 = require("./serialize-instructions");
|
|
7
|
-
|
|
8
|
-
* @description
|
|
9
|
-
* @
|
|
10
|
-
* @see [Documentation](https://remotion.dev/docs/paths/get-subpaths)
|
|
7
|
+
/*
|
|
8
|
+
* @description Takes an SVG path and returns an array of subpaths, splitting the path by `M` and `m` statements.
|
|
9
|
+
* @see [Documentation](https://www.remotion.dev/docs/paths/get-subpaths)
|
|
11
10
|
*/
|
|
12
11
|
const getSubpaths = (path) => {
|
|
13
12
|
const parsed = (0, parse_path_1.parsePath)(path);
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Gets tangent values x and y of a point which is on an SVG path
|
|
3
|
-
* @param {string} path A valid SVG path
|
|
4
|
-
* @param {number} length The length at which the tangent should be sampled
|
|
5
|
-
* @see [Documentation](https://remotion.dev/docs/paths/get-tangent-at-length)
|
|
6
|
-
*/
|
|
7
1
|
export declare const getTangentAtLength: (path: string, length: number) => import("./helpers/types").Point;
|
|
@@ -3,11 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getTangentAtLength = void 0;
|
|
4
4
|
const get_instruction_index_at_length_1 = require("./get-instruction-index-at-length");
|
|
5
5
|
const construct_1 = require("./helpers/construct");
|
|
6
|
-
|
|
7
|
-
* @description Gets tangent values x and y of a point which is on an SVG path
|
|
8
|
-
* @
|
|
9
|
-
* @param {number} length The length at which the tangent should be sampled
|
|
10
|
-
* @see [Documentation](https://remotion.dev/docs/paths/get-tangent-at-length)
|
|
6
|
+
/*
|
|
7
|
+
* @description Gets tangent values x and y of a point which is on an SVG path.
|
|
8
|
+
* @see [Documentation](https://www.remotion.dev/docs/paths/get-tangent-at-length)
|
|
11
9
|
*/
|
|
12
10
|
const getTangentAtLength = (path, length) => {
|
|
13
11
|
const constructed = (0, construct_1.construct)(path);
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Interpolates between two SVG paths.
|
|
3
|
-
* @param {number} value A number - 0 means first path, 1 means second path, any other values will be interpolated
|
|
4
|
-
* @param {string} firstPath The first valid SVG path
|
|
5
|
-
* @param {string} secondPath The second valid SVG path
|
|
6
|
-
* @see [Documentation](https://remotion.dev/docs/paths/interpolate-path)
|
|
7
|
-
*/
|
|
8
1
|
export declare const interpolatePath: (value: number, firstPath: string, secondPath: string) => string;
|
|
@@ -37,12 +37,9 @@ const parse_path_1 = require("../parse-path");
|
|
|
37
37
|
const reduce_instructions_1 = require("../reduce-instructions");
|
|
38
38
|
const serialize_instructions_1 = require("../serialize-instructions");
|
|
39
39
|
const interpolate_instructions_1 = require("./interpolate-instructions");
|
|
40
|
-
|
|
41
|
-
* @description Interpolates between two SVG paths.
|
|
42
|
-
* @
|
|
43
|
-
* @param {string} firstPath The first valid SVG path
|
|
44
|
-
* @param {string} secondPath The second valid SVG path
|
|
45
|
-
* @see [Documentation](https://remotion.dev/docs/paths/interpolate-path)
|
|
40
|
+
/*
|
|
41
|
+
* @description Interpolates between two SVG paths based on the provided value, transitioning from the first path to the second.
|
|
42
|
+
* @see [Documentation](https://www.remotion.dev/docs/paths/interpolate-path)
|
|
46
43
|
*/
|
|
47
44
|
const interpolatePath = (value, firstPath, secondPath) => {
|
|
48
45
|
// at 1 return the final value without the extensions used during interpolation
|
package/dist/normalize-path.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import type { AbsoluteInstruction, Instruction } from './helpers/types';
|
|
2
2
|
export declare const normalizeInstructions: (instructions: Instruction[]) => AbsoluteInstruction[];
|
|
3
|
-
/**
|
|
4
|
-
* @description Removes all relative coordinates from an SVG path and converts them into absolute coordinates.
|
|
5
|
-
* @see [Documentation](https://remotion.dev/docs/paths/normalize-path)
|
|
6
|
-
* @param {string} path A valid SVG path
|
|
7
|
-
* @returns {string} A string representation of the SVG path with absolute coordinates.
|
|
8
|
-
*/
|
|
9
3
|
export declare const normalizePath: (path: string) => string;
|
package/dist/normalize-path.js
CHANGED
|
@@ -151,11 +151,9 @@ const normalizeInstructions = (instructions) => {
|
|
|
151
151
|
return normalized;
|
|
152
152
|
};
|
|
153
153
|
exports.normalizeInstructions = normalizeInstructions;
|
|
154
|
-
|
|
155
|
-
* @description Removes all relative coordinates from
|
|
156
|
-
* @see [Documentation](https://remotion.dev/docs/paths/normalize-path)
|
|
157
|
-
* @param {string} path A valid SVG path
|
|
158
|
-
* @returns {string} A string representation of the SVG path with absolute coordinates.
|
|
154
|
+
/*
|
|
155
|
+
* @description Removes all relative coordinates from a path and converts them into absolute coordinates.
|
|
156
|
+
* @see [Documentation](https://www.remotion.dev/docs/paths/normalize-path)
|
|
159
157
|
*/
|
|
160
158
|
const normalizePath = (path) => {
|
|
161
159
|
const instructions = (0, parse_path_1.parsePath)(path);
|
package/dist/parse-path.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import type { Instruction } from './helpers/types';
|
|
2
|
-
/**
|
|
3
|
-
* @description Parses an SVG string path into an array of Instruction's.
|
|
4
|
-
* @param {string} path
|
|
5
|
-
* @returns an array of objects containing the Instructions
|
|
6
|
-
* @see [Documentation](https://www.remotion.dev/docs/paths/parse-path)
|
|
7
|
-
*/
|
|
8
2
|
export declare const parsePath: (path: string) => Instruction[];
|
package/dist/parse-path.js
CHANGED
|
@@ -56,10 +56,8 @@ const parseValues = (args, instructionType) => {
|
|
|
56
56
|
}
|
|
57
57
|
return numbers.map(Number);
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
/*
|
|
60
60
|
* @description Parses an SVG string path into an array of Instruction's.
|
|
61
|
-
* @param {string} path
|
|
62
|
-
* @returns an array of objects containing the Instructions
|
|
63
61
|
* @see [Documentation](https://www.remotion.dev/docs/paths/parse-path)
|
|
64
62
|
*/
|
|
65
63
|
const parsePath = (path) => {
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
import type { Instruction, ReducedInstruction } from './helpers/types';
|
|
2
|
-
/**
|
|
3
|
-
* @description Takes an array of Instruction's and reduces the amount of instruction types them so the path only consists of M, L, C, Q and Z instructions.
|
|
4
|
-
* @param {Array} instruction
|
|
5
|
-
* @see [Documentation](https://www.remotion.dev/docs/paths/reduce-instructions)
|
|
6
|
-
*/
|
|
7
2
|
export declare const reduceInstructions: (instruction: Instruction[]) => ReducedInstruction[];
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.reduceInstructions = void 0;
|
|
4
4
|
const remove_a_s_t_curves_1 = require("./helpers/remove-a-s-t-curves");
|
|
5
5
|
const normalize_path_1 = require("./normalize-path");
|
|
6
|
-
|
|
7
|
-
* @description Takes an array of Instruction's and reduces the amount of instruction types
|
|
8
|
-
* @param {Array} instruction
|
|
6
|
+
/*
|
|
7
|
+
* @description Takes an array of Instruction's and reduces the amount of instruction types so that the path only consists of M, L, C, and Z instructions.
|
|
9
8
|
* @see [Documentation](https://www.remotion.dev/docs/paths/reduce-instructions)
|
|
10
9
|
*/
|
|
11
10
|
const reduceInstructions = (instruction) => {
|
package/dist/reset-path.d.ts
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Translates an SVG path so that the top-left corner of the bounding box is at 0, 0.
|
|
3
|
-
* @param {string} d a valid SVG path
|
|
4
|
-
* @see [Documentation](https://www.remotion.dev/docs/paths/reset-path)
|
|
5
|
-
*/
|
|
6
1
|
export declare const resetPath: (d: string) => string;
|
package/dist/reset-path.js
CHANGED
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.resetPath = void 0;
|
|
4
4
|
const get_bounding_box_1 = require("./get-bounding-box");
|
|
5
5
|
const translate_path_1 = require("./translate-path");
|
|
6
|
-
|
|
6
|
+
/*
|
|
7
7
|
* @description Translates an SVG path so that the top-left corner of the bounding box is at 0, 0.
|
|
8
|
-
* @param {string} d a valid SVG path
|
|
9
8
|
* @see [Documentation](https://www.remotion.dev/docs/paths/reset-path)
|
|
10
9
|
*/
|
|
11
10
|
const resetPath = (d) => {
|
package/dist/reverse-path.d.ts
CHANGED
|
@@ -4,9 +4,4 @@
|
|
|
4
4
|
* This code is in the public domain, except in jurisdictions that do
|
|
5
5
|
* not recognise the public domain, where this code is MIT licensed.
|
|
6
6
|
*/
|
|
7
|
-
/**
|
|
8
|
-
* @description Reverses a path so the end and start are switched.
|
|
9
|
-
* @param {string} path A valid SVG path
|
|
10
|
-
* @see [Documentation](https://remotion.dev/docs/paths/reverse-path)
|
|
11
|
-
*/
|
|
12
7
|
export declare const reversePath: (path: string) => string;
|
package/dist/reverse-path.js
CHANGED
|
@@ -82,10 +82,9 @@ function reverseNormalizedPath(instructions) {
|
|
|
82
82
|
revstring = revstring.replace(/M M/g, 'Z M');
|
|
83
83
|
return revstring;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
/*
|
|
86
86
|
* @description Reverses a path so the end and start are switched.
|
|
87
|
-
* @
|
|
88
|
-
* @see [Documentation](https://remotion.dev/docs/paths/reverse-path)
|
|
87
|
+
* @see [Documentation](https://www.remotion.dev/docs/paths/reverse-path)
|
|
89
88
|
*/
|
|
90
89
|
const reversePath = (path) => {
|
|
91
90
|
const parsed = (0, parse_path_1.parsePath)(path);
|
package/dist/scale-path.d.ts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Allows you to grow or shrink the size of a path.
|
|
3
|
-
* @param {string} path A valid SVG path
|
|
4
|
-
* @param {string} d
|
|
5
|
-
* @param {Number} scaleX
|
|
6
|
-
* @param {Number} scaleY
|
|
7
|
-
* @returns a new path with respect to the scale values provided
|
|
8
|
-
* @see [Documentation](https://www.remotion.dev/docs/paths/scale-path)
|
|
9
|
-
*/
|
|
10
1
|
export declare const scalePath: (d: string, scaleX: number, scaleY: number) => string;
|
package/dist/scale-path.js
CHANGED
|
@@ -6,13 +6,8 @@ const parse_path_1 = require("./parse-path");
|
|
|
6
6
|
const reduce_instructions_1 = require("./reduce-instructions");
|
|
7
7
|
const serialize_instructions_1 = require("./serialize-instructions");
|
|
8
8
|
const translate_path_1 = require("./translate-path");
|
|
9
|
-
|
|
9
|
+
/*
|
|
10
10
|
* @description Allows you to grow or shrink the size of a path.
|
|
11
|
-
* @param {string} path A valid SVG path
|
|
12
|
-
* @param {string} d
|
|
13
|
-
* @param {Number} scaleX
|
|
14
|
-
* @param {Number} scaleY
|
|
15
|
-
* @returns a new path with respect to the scale values provided
|
|
16
11
|
* @see [Documentation](https://www.remotion.dev/docs/paths/scale-path)
|
|
17
12
|
*/
|
|
18
13
|
const scalePath = (d, scaleX, scaleY) => {
|
package/dist/translate-path.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
1
|
import type { Instruction } from './helpers/types';
|
|
2
2
|
export declare const translateSegments: (segments: Instruction[], x: number, y: number) => Instruction[];
|
|
3
|
-
/**
|
|
4
|
-
* @description Translates the path by the given x and y coordinates.
|
|
5
|
-
* @param {string} path the originalSVG path
|
|
6
|
-
* @param {Number} x the amount of horizontal translation
|
|
7
|
-
* @param {Number} y the amount of vertical translation
|
|
8
|
-
* @returns a new string containing a path, if it is valid
|
|
9
|
-
* @see [Documentation](https://www.remotion.dev/docs/paths/translate-path)
|
|
10
|
-
*/
|
|
11
3
|
export declare const translatePath: (path: string, x: number, y: number) => string;
|
package/dist/translate-path.js
CHANGED
|
@@ -102,12 +102,8 @@ const translateSegments = (segments, x, y) => {
|
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
104
|
exports.translateSegments = translateSegments;
|
|
105
|
-
|
|
105
|
+
/*
|
|
106
106
|
* @description Translates the path by the given x and y coordinates.
|
|
107
|
-
* @param {string} path the originalSVG path
|
|
108
|
-
* @param {Number} x the amount of horizontal translation
|
|
109
|
-
* @param {Number} y the amount of vertical translation
|
|
110
|
-
* @returns a new string containing a path, if it is valid
|
|
111
107
|
* @see [Documentation](https://www.remotion.dev/docs/paths/translate-path)
|
|
112
108
|
*/
|
|
113
109
|
const translatePath = (path, x, y) => {
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { WarpPathFn } from './warp-helpers';
|
|
2
|
-
/**
|
|
3
|
-
* @description This function works by splitting SVG instructions into many smaller SVG instructions and then remapping the coordinates of each instruction.
|
|
4
|
-
* @param {string} path an SVG path string
|
|
5
|
-
* @see [Documentation](https://www.remotion.dev/docs/paths/warp-path)
|
|
6
|
-
*/
|
|
7
2
|
export declare const warpPath: (path: string, transformer: WarpPathFn, options?: {
|
|
8
3
|
interpolationThreshold?: number;
|
|
9
4
|
}) => string;
|
package/dist/warp-path/index.js
CHANGED
|
@@ -11,9 +11,8 @@ const getDefaultInterpolationThreshold = (instructions) => {
|
|
|
11
11
|
const longer = Math.max(boundingBox.y2 - boundingBox.y1, boundingBox.x2 - boundingBox.x1);
|
|
12
12
|
return longer * 0.01;
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
* @description
|
|
16
|
-
* @param {string} path an SVG path string
|
|
14
|
+
/*
|
|
15
|
+
* @description Allows you to remap the coordinates of an SVG using a function in order to create a warp effect.
|
|
17
16
|
* @see [Documentation](https://www.remotion.dev/docs/paths/warp-path)
|
|
18
17
|
*/
|
|
19
18
|
const warpPath = (path, transformer, options) => {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/paths"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/paths",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.245",
|
|
7
7
|
"description": "Utilities for working with SVG paths",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"eslint": "9.14.0",
|
|
24
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
24
|
+
"@remotion/eslint-config-internal": "4.0.245"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
"./package.json": "./package.json",
|