@remotion/paths 4.0.0-prefetch.11 → 4.0.0-prefetch.12
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 -0
- package/dist/evolve-path.js +0 -0
- package/dist/extend-viewbox.d.ts +6 -0
- package/dist/extend-viewbox.js +35 -0
- package/dist/get-length.d.ts +0 -0
- package/dist/get-length.js +0 -0
- package/dist/get-parts.d.ts +0 -0
- package/dist/get-parts.js +0 -0
- package/dist/get-point-at-length.d.ts +0 -0
- package/dist/get-point-at-length.js +0 -0
- package/dist/get-tangent-at-length.d.ts +0 -0
- package/dist/get-tangent-at-length.js +0 -0
- package/dist/helpers/arc.d.ts +0 -0
- package/dist/helpers/arc.js +0 -0
- package/dist/helpers/bezier-functions.d.ts +0 -0
- package/dist/helpers/bezier-functions.js +0 -0
- package/dist/helpers/bezier-values.d.ts +0 -0
- package/dist/helpers/bezier-values.js +0 -0
- package/dist/helpers/bezier.d.ts +0 -0
- package/dist/helpers/bezier.js +0 -0
- package/dist/helpers/construct.d.ts +0 -0
- package/dist/helpers/construct.js +0 -0
- package/dist/helpers/get-part-at-length.d.ts +0 -0
- package/dist/helpers/get-part-at-length.js +0 -0
- package/dist/helpers/linear.d.ts +0 -0
- package/dist/helpers/linear.js +0 -0
- package/dist/helpers/parse.d.ts +0 -0
- package/dist/helpers/parse.js +0 -0
- package/dist/helpers/split-curve.d.ts +0 -0
- package/dist/helpers/split-curve.js +0 -0
- package/dist/helpers/types.d.ts +0 -0
- package/dist/helpers/types.js +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/interpolate-path.d.ts +0 -0
- package/dist/interpolate-path.js +0 -0
- package/dist/normalize-path.d.ts +0 -0
- package/dist/normalize-path.js +0 -0
- package/dist/reverse-path.d.ts +0 -0
- package/dist/reverse-path.js +0 -0
- package/package.json +5 -5
package/dist/evolve-path.d.ts
CHANGED
|
File without changes
|
package/dist/evolve-path.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extendViewBox = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Extends a viewbox in all directions by a scale factor.
|
|
6
|
+
* @param {string} currentViewBox A valid SVG viewBox
|
|
7
|
+
* @link https://remotion.dev/docs/paths/extend-viewbox
|
|
8
|
+
*/
|
|
9
|
+
const extendViewBox = (currentViewBox, scale) => {
|
|
10
|
+
const relativeScale = scale - 1;
|
|
11
|
+
const splitted = currentViewBox
|
|
12
|
+
.split(' ')
|
|
13
|
+
.map((a) => a.trim())
|
|
14
|
+
.filter((a) => a !== '')
|
|
15
|
+
.map(Number);
|
|
16
|
+
if (splitted.length !== 4) {
|
|
17
|
+
throw new Error(`currentViewBox must be 4 valid numbers, but got "${currentViewBox}"`);
|
|
18
|
+
}
|
|
19
|
+
for (const part of splitted) {
|
|
20
|
+
if (Number.isNaN(part)) {
|
|
21
|
+
throw new Error(`currentViewBox must be 4 valid numbers, but got "${currentViewBox}"`);
|
|
22
|
+
}
|
|
23
|
+
if (!Number.isFinite(part)) {
|
|
24
|
+
throw new Error(`currentViewBox must be 4 valid numbers, but got "${currentViewBox}"`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const [x, y, width, height] = splitted;
|
|
28
|
+
return [
|
|
29
|
+
x - (relativeScale * width) / 2,
|
|
30
|
+
y - (relativeScale * height) / 2,
|
|
31
|
+
width + relativeScale * width,
|
|
32
|
+
height + relativeScale * height,
|
|
33
|
+
].join(' ');
|
|
34
|
+
};
|
|
35
|
+
exports.extendViewBox = extendViewBox;
|
package/dist/get-length.d.ts
CHANGED
|
File without changes
|
package/dist/get-length.js
CHANGED
|
File without changes
|
package/dist/get-parts.d.ts
CHANGED
|
File without changes
|
package/dist/get-parts.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/helpers/arc.d.ts
CHANGED
|
File without changes
|
package/dist/helpers/arc.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/helpers/bezier.d.ts
CHANGED
|
File without changes
|
package/dist/helpers/bezier.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/helpers/linear.d.ts
CHANGED
|
File without changes
|
package/dist/helpers/linear.js
CHANGED
|
File without changes
|
package/dist/helpers/parse.d.ts
CHANGED
|
File without changes
|
package/dist/helpers/parse.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/helpers/types.d.ts
CHANGED
|
File without changes
|
package/dist/helpers/types.js
CHANGED
|
File without changes
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reversePath = exports.normalizePath = exports.interpolatePath = exports.getTangentAtLength = exports.getPointAtLength = exports.getParts = exports.getLength = exports.evolvePath = void 0;
|
|
3
|
+
exports.reversePath = exports.normalizePath = exports.interpolatePath = exports.getTangentAtLength = exports.getPointAtLength = exports.getParts = exports.getLength = exports.extendViewBox = exports.evolvePath = void 0;
|
|
4
4
|
var evolve_path_1 = require("./evolve-path");
|
|
5
5
|
Object.defineProperty(exports, "evolvePath", { enumerable: true, get: function () { return evolve_path_1.evolvePath; } });
|
|
6
|
+
var extend_viewbox_1 = require("./extend-viewbox");
|
|
7
|
+
Object.defineProperty(exports, "extendViewBox", { enumerable: true, get: function () { return extend_viewbox_1.extendViewBox; } });
|
|
6
8
|
var get_length_1 = require("./get-length");
|
|
7
9
|
Object.defineProperty(exports, "getLength", { enumerable: true, get: function () { return get_length_1.getLength; } });
|
|
8
10
|
var get_parts_1 = require("./get-parts");
|
|
File without changes
|
package/dist/interpolate-path.js
CHANGED
|
File without changes
|
package/dist/normalize-path.d.ts
CHANGED
|
File without changes
|
package/dist/normalize-path.js
CHANGED
|
File without changes
|
package/dist/reverse-path.d.ts
CHANGED
|
File without changes
|
package/dist/reverse-path.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/paths",
|
|
3
|
-
"version": "4.0.0-prefetch.
|
|
3
|
+
"version": "4.0.0-prefetch.12+c7eb5bd76",
|
|
4
4
|
"description": "Utility functions for SVG paths",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@jonny/eslint-config": "3.0.266",
|
|
23
23
|
"@types/node": "^16.7.5",
|
|
24
|
-
"eslint": "8.
|
|
25
|
-
"prettier": "^2.
|
|
24
|
+
"eslint": "8.25.0",
|
|
25
|
+
"prettier": "^2.7.1",
|
|
26
26
|
"prettier-plugin-organize-imports": "^2.3.4",
|
|
27
27
|
"typescript": "^4.7.0",
|
|
28
|
-
"vitest": "
|
|
28
|
+
"vitest": "0.24.3"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [
|
|
31
31
|
"svg",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "c7eb5bd76f2f89677f007a54e1bc5d3e3403094f"
|
|
39
39
|
}
|