@remotion/paths 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.
|
@@ -4,5 +4,13 @@ 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
|
+
*/
|
|
7
15
|
export declare const getInstructionIndexAtLength: (path: string, length: number) => InstructionAtLength;
|
|
8
16
|
export {};
|
|
@@ -19,6 +19,14 @@ const getInstructionIndexAtLengthFromConstructed = (constructed, fractionLength)
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
exports.getInstructionIndexAtLengthFromConstructed = getInstructionIndexAtLengthFromConstructed;
|
|
22
|
+
/**
|
|
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.
|
|
29
|
+
*/
|
|
22
30
|
const getInstructionIndexAtLength = (path, length) => {
|
|
23
31
|
const constructed = (0, construct_1.construct)(path);
|
|
24
32
|
if (length > constructed.totalLength) {
|
package/dist/index.d.ts
CHANGED
|
@@ -17,3 +17,6 @@ export { scalePath } from './scale-path';
|
|
|
17
17
|
export { serializeInstructions } from './serialize-instructions';
|
|
18
18
|
export { translatePath } from './translate-path';
|
|
19
19
|
export { WarpPathFn, warpPath } from './warp-path';
|
|
20
|
+
export declare const PathInternals: {
|
|
21
|
+
getBoundingBoxFromInstructions: (instructions: import("./helpers/types").ReducedInstruction[]) => import("./helpers/types").BoundingBox;
|
|
22
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.warpPath = exports.translatePath = exports.serializeInstructions = exports.scalePath = exports.reversePath = exports.resetPath = exports.reduceInstructions = exports.parsePath = exports.normalizePath = exports.interpolatePath = exports.getTangentAtLength = exports.getSubpaths = exports.getPointAtLength = exports.getLength = exports.getInstructionIndexAtLength = exports.getBoundingBox = exports.extendViewBox = exports.evolvePath = void 0;
|
|
3
|
+
exports.PathInternals = exports.warpPath = exports.translatePath = exports.serializeInstructions = exports.scalePath = exports.reversePath = exports.resetPath = exports.reduceInstructions = exports.parsePath = exports.normalizePath = exports.interpolatePath = exports.getTangentAtLength = exports.getSubpaths = exports.getPointAtLength = exports.getLength = exports.getInstructionIndexAtLength = exports.getBoundingBox = exports.extendViewBox = exports.evolvePath = void 0;
|
|
4
|
+
const get_bounding_box_1 = require("./get-bounding-box");
|
|
4
5
|
var evolve_path_1 = require("./evolve-path");
|
|
5
6
|
Object.defineProperty(exports, "evolvePath", { enumerable: true, get: function () { return evolve_path_1.evolvePath; } });
|
|
6
7
|
var extend_viewbox_1 = require("./extend-viewbox");
|
|
7
8
|
Object.defineProperty(exports, "extendViewBox", { enumerable: true, get: function () { return extend_viewbox_1.extendViewBox; } });
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "getBoundingBox", { enumerable: true, get: function () { return
|
|
9
|
+
var get_bounding_box_2 = require("./get-bounding-box");
|
|
10
|
+
Object.defineProperty(exports, "getBoundingBox", { enumerable: true, get: function () { return get_bounding_box_2.getBoundingBox; } });
|
|
10
11
|
var get_instruction_index_at_length_1 = require("./get-instruction-index-at-length");
|
|
11
12
|
Object.defineProperty(exports, "getInstructionIndexAtLength", { enumerable: true, get: function () { return get_instruction_index_at_length_1.getInstructionIndexAtLength; } });
|
|
12
13
|
var get_length_1 = require("./get-length");
|
|
@@ -37,3 +38,6 @@ var translate_path_1 = require("./translate-path");
|
|
|
37
38
|
Object.defineProperty(exports, "translatePath", { enumerable: true, get: function () { return translate_path_1.translatePath; } });
|
|
38
39
|
var warp_path_1 = require("./warp-path");
|
|
39
40
|
Object.defineProperty(exports, "warpPath", { enumerable: true, get: function () { return warp_path_1.warpPath; } });
|
|
41
|
+
exports.PathInternals = {
|
|
42
|
+
getBoundingBoxFromInstructions: get_bounding_box_1.getBoundingBoxFromInstructions,
|
|
43
|
+
};
|
package/dist/normalize-path.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import type { AbsoluteInstruction, Instruction } from './helpers/types';
|
|
|
2
2
|
export declare const normalizeInstructions: (instructions: Instruction[]) => AbsoluteInstruction[];
|
|
3
3
|
/**
|
|
4
4
|
* @description Removes all relative coordinates from an SVG path and converts them into absolute coordinates.
|
|
5
|
-
* @param {string} path A valid SVG path
|
|
6
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.
|
|
7
8
|
*/
|
|
8
9
|
export declare const normalizePath: (path: string) => string;
|
package/dist/normalize-path.js
CHANGED
|
@@ -153,8 +153,9 @@ const normalizeInstructions = (instructions) => {
|
|
|
153
153
|
exports.normalizeInstructions = normalizeInstructions;
|
|
154
154
|
/**
|
|
155
155
|
* @description Removes all relative coordinates from an SVG path and converts them into absolute coordinates.
|
|
156
|
-
* @param {string} path A valid SVG path
|
|
157
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.
|
|
158
159
|
*/
|
|
159
160
|
const normalizePath = (path) => {
|
|
160
161
|
const instructions = (0, parse_path_1.parsePath)(path);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/paths",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.144",
|
|
4
4
|
"description": "Utility functions for SVG paths",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"@types/node": "18.14.6",
|
|
18
18
|
"eslint": "8.56.0",
|
|
19
19
|
"prettier": "3.2.5",
|
|
20
|
-
"prettier-plugin-organize-imports": "3.2.4"
|
|
21
|
-
"vitest": "0.31.1"
|
|
20
|
+
"prettier-plugin-organize-imports": "3.2.4"
|
|
22
21
|
},
|
|
23
22
|
"keywords": [
|
|
24
23
|
"svg",
|
|
@@ -33,6 +32,6 @@
|
|
|
33
32
|
"lint": "eslint src --ext ts,tsx",
|
|
34
33
|
"watch": "tsc -w",
|
|
35
34
|
"build": "tsc -d",
|
|
36
|
-
"test": "
|
|
35
|
+
"test": "bun test src"
|
|
37
36
|
}
|
|
38
37
|
}
|