@remotion/shapes 3.3.51 → 3.3.52
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.
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare type Instruction = {
|
|
2
|
+
type: 'M';
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'L';
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'C';
|
|
11
|
+
cp1x: number;
|
|
12
|
+
cp1y: number;
|
|
13
|
+
cp2x: number;
|
|
14
|
+
cp2y: number;
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'm';
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'a';
|
|
23
|
+
rx: number;
|
|
24
|
+
ry: number;
|
|
25
|
+
xAxisRotation: number;
|
|
26
|
+
largeArcFlag: boolean;
|
|
27
|
+
sweepFlag: boolean;
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
};
|
|
31
|
+
export declare const serializeInstructions: (instructions: Instruction[]) => string;
|
|
32
|
+
export declare const serializeInstruction: (instruction: Instruction) => string | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeInstruction = exports.serializeInstructions = void 0;
|
|
4
|
+
const serializeInstructions = (instructions) => {
|
|
5
|
+
return instructions.map(exports.serializeInstruction).join(' ');
|
|
6
|
+
};
|
|
7
|
+
exports.serializeInstructions = serializeInstructions;
|
|
8
|
+
const serializeInstruction = (instruction) => {
|
|
9
|
+
if (instruction.type === 'M') {
|
|
10
|
+
return `M ${instruction.x} ${instruction.y}`;
|
|
11
|
+
}
|
|
12
|
+
if (instruction.type === 'L') {
|
|
13
|
+
return `L ${instruction.x} ${instruction.y}`;
|
|
14
|
+
}
|
|
15
|
+
if (instruction.type === 'C') {
|
|
16
|
+
return `C ${instruction.cp1x} ${instruction.cp1y} ${instruction.cp2x} ${instruction.cp2y} ${instruction.x} ${instruction.y}`;
|
|
17
|
+
}
|
|
18
|
+
if (instruction.type === 'm') {
|
|
19
|
+
return `m ${instruction.x} ${instruction.y}`;
|
|
20
|
+
}
|
|
21
|
+
if (instruction.type === 'a') {
|
|
22
|
+
return `a ${instruction.rx} ${instruction.ry} ${instruction.xAxisRotation} ${Number(instruction.largeArcFlag)} ${Number(instruction.sweepFlag ? 1 : 0)} ${instruction.x} ${instruction.y}`;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.serializeInstruction = serializeInstruction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/shapes",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.52",
|
|
4
4
|
"description": "Utility functions and components for SVG shapes",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"react-dom": ">=16.8.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@remotion/paths": "3.3.
|
|
48
|
+
"@remotion/paths": "3.3.52"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "b48dff6c96081c924ae3bbc37f2f00bdd53e6e1f"
|
|
51
51
|
}
|