@remotion/paths 4.0.212 → 4.0.214
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/cut-instruction.js +2 -2
- package/dist/helpers/iterate.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/interpolate-path/convert-to-same-instruction-type.js +1 -2
- package/dist/interpolate-path/de-casteljau.js +1 -2
- package/dist/interpolate-path/extend-command.js +1 -2
- package/dist/interpolate-path/interpolate-instructions.js +1 -2
- package/dist/interpolate-path/points-to-command.js +1 -2
- package/dist/interpolate-path/split-curve-as-points.js +1 -2
- package/dist/interpolate-path/split-segment.js +1 -2
- package/dist/warp-path/warp-helpers.js +2 -2
- package/package.json +1 -1
package/dist/cut-instruction.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cutInstruction =
|
|
3
|
+
exports.cutInstruction = void 0;
|
|
4
|
+
exports.cutCInstruction = cutCInstruction;
|
|
4
5
|
const cutLInstruction = ({ instruction, lastPoint, progress, }) => {
|
|
5
6
|
const x = lastPoint.x + (instruction.x - lastPoint.x) * progress;
|
|
6
7
|
const y = lastPoint.y + (instruction.y - lastPoint.y) * progress;
|
|
@@ -43,7 +44,6 @@ function cutCInstruction({ progress, lastPoint, instruction, }) {
|
|
|
43
44
|
y: p0123.y,
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
|
-
exports.cutCInstruction = cutCInstruction;
|
|
47
47
|
const cutInstruction = ({ instruction, lastPoint, progress, }) => {
|
|
48
48
|
if (instruction.type === 'M') {
|
|
49
49
|
return instruction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AbsoluteInstruction, QInstruction, ReducedInstruction } from './types';
|
|
2
|
-
export declare const iterateOverSegments: <T extends
|
|
2
|
+
export declare const iterateOverSegments: <T extends ReducedInstruction | QInstruction>({ segments, iterate, }: {
|
|
3
3
|
segments: (AbsoluteInstruction | QInstruction)[];
|
|
4
4
|
iterate: (options: {
|
|
5
5
|
segment: AbsoluteInstruction | QInstruction;
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { reversePath } from './reverse-path';
|
|
|
16
16
|
export { scalePath } from './scale-path';
|
|
17
17
|
export { serializeInstructions } from './serialize-instructions';
|
|
18
18
|
export { translatePath } from './translate-path';
|
|
19
|
-
export {
|
|
19
|
+
export { warpPath, WarpPathFn } from './warp-path';
|
|
20
20
|
export declare const PathInternals: {
|
|
21
21
|
getBoundingBoxFromInstructions: (instructions: import("./helpers/types").ReducedInstruction[]) => import("./helpers/types").BoundingBox;
|
|
22
22
|
debugPath: (d: string) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertToSameInstructionType =
|
|
3
|
+
exports.convertToSameInstructionType = convertToSameInstructionType;
|
|
4
4
|
const convertToLCommand = (command) => {
|
|
5
5
|
if (command.type === 'M' || command.type === 'L' || command.type === 'Z') {
|
|
6
6
|
throw new Error('unexpected');
|
|
@@ -68,4 +68,3 @@ function convertToSameInstructionType(aCommand, bCommand, currentPoint) {
|
|
|
68
68
|
}
|
|
69
69
|
throw new TypeError('unhandled');
|
|
70
70
|
}
|
|
71
|
-
exports.convertToSameInstructionType = convertToSameInstructionType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decasteljau =
|
|
3
|
+
exports.decasteljau = decasteljau;
|
|
4
4
|
/**
|
|
5
5
|
* de Casteljau's algorithm for drawing and splitting bezier curves.
|
|
6
6
|
* Inspired by https://pomax.github.io/bezierinfo/
|
|
@@ -41,4 +41,3 @@ function decasteljau(points, t) {
|
|
|
41
41
|
}
|
|
42
42
|
return { left, right: right.reverse() };
|
|
43
43
|
}
|
|
44
|
-
exports.decasteljau = decasteljau;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extendInstruction =
|
|
3
|
+
exports.extendInstruction = extendInstruction;
|
|
4
4
|
const split_segment_1 = require("./split-segment");
|
|
5
5
|
/**
|
|
6
6
|
* Extends an array of commandsToExtend to the length of the referenceCommands by
|
|
@@ -52,4 +52,3 @@ function extendInstruction(commandsToExtend, referenceCommands) {
|
|
|
52
52
|
extended.unshift(commandsToExtend[0]);
|
|
53
53
|
return extended;
|
|
54
54
|
}
|
|
55
|
-
exports.extendInstruction = extendInstruction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.interpolateInstructions =
|
|
3
|
+
exports.interpolateInstructions = interpolateInstructions;
|
|
4
4
|
const get_end_position_1 = require("../get-end-position");
|
|
5
5
|
const convert_to_same_instruction_type_1 = require("./convert-to-same-instruction-type");
|
|
6
6
|
const extend_command_1 = require("./extend-command");
|
|
@@ -89,4 +89,3 @@ function interpolateInstructions(aCommandsInput, bCommandsInput) {
|
|
|
89
89
|
return interpolatedCommands;
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
exports.interpolateInstructions = interpolateInstructions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pointsToInstruction =
|
|
3
|
+
exports.pointsToInstruction = pointsToInstruction;
|
|
4
4
|
const convert_q_to_c_instruction_1 = require("../helpers/convert-q-to-c-instruction");
|
|
5
5
|
/**
|
|
6
6
|
* Convert segments represented as points back into a command object
|
|
@@ -47,4 +47,3 @@ function pointsToInstruction(points) {
|
|
|
47
47
|
y,
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
exports.pointsToInstruction = pointsToInstruction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.splitCurveAsPoints =
|
|
3
|
+
exports.splitCurveAsPoints = splitCurveAsPoints;
|
|
4
4
|
const de_casteljau_1 = require("./de-casteljau");
|
|
5
5
|
/**
|
|
6
6
|
* Runs de Casteljau's algorithm enough times to produce the desired number of segments.
|
|
@@ -37,4 +37,3 @@ function splitCurveAsPoints(points, segmentCount = 2) {
|
|
|
37
37
|
segments.push(remainingCurve);
|
|
38
38
|
return segments;
|
|
39
39
|
}
|
|
40
|
-
exports.splitCurveAsPoints = splitCurveAsPoints;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.splitSegmentInstructions =
|
|
3
|
+
exports.splitSegmentInstructions = splitSegmentInstructions;
|
|
4
4
|
const split_curve_1 = require("./split-curve");
|
|
5
5
|
/**
|
|
6
6
|
* Interpolate between command objects commandStart and commandEnd segmentCount times.
|
|
@@ -36,4 +36,3 @@ function splitSegmentInstructions(commandStart, commandEnd, segmentCount) {
|
|
|
36
36
|
}
|
|
37
37
|
return segments;
|
|
38
38
|
}
|
|
39
|
-
exports.splitSegmentInstructions = splitSegmentInstructions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fixZInstruction = exports.warpTransform =
|
|
3
|
+
exports.fixZInstruction = exports.warpTransform = void 0;
|
|
4
|
+
exports.svgPathInterpolate = svgPathInterpolate;
|
|
4
5
|
const convert_q_to_c_instruction_1 = require("../helpers/convert-q-to-c-instruction");
|
|
5
6
|
const euclideanDistance = (points) => {
|
|
6
7
|
const startPoint = points[0];
|
|
@@ -128,7 +129,6 @@ function svgPathInterpolate(path, threshold) {
|
|
|
128
129
|
};
|
|
129
130
|
return warpInterpolate(path, threshold, deltaFunction);
|
|
130
131
|
}
|
|
131
|
-
exports.svgPathInterpolate = svgPathInterpolate;
|
|
132
132
|
const warpTransform = (path, transformer) => {
|
|
133
133
|
return path
|
|
134
134
|
.map((segment) => {
|
package/package.json
CHANGED