@remotion/shapes 3.3.41 → 3.3.43

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.
@@ -1,4 +1,6 @@
1
1
  export declare type MakeCircleProps = {
2
- radius: number;
2
+ cx?: number | string;
3
+ cy?: number | string;
4
+ radius?: number | string;
3
5
  };
4
- export declare const makeCircle: ({ radius }: MakeCircleProps) => string;
6
+ export declare const makeCircle: ({ cx, cy, radius, }: MakeCircleProps) => string;
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeCircle = void 0;
4
- const makeCircle = ({ radius }) => {
5
- const cx = radius;
6
- const cy = radius;
4
+ const makeCircle = ({ cx = 50, cy = 50, radius = 50, }) => {
7
5
  return `M ${cx} ${cy} m -${radius} 0 a ${radius} ${radius} 0 1 0 ${radius * 2} 0 ${radius} ${radius} 0 1 0 ${-radius * 2} 0`;
8
6
  };
9
7
  exports.makeCircle = makeCircle;
@@ -1,5 +1,5 @@
1
1
  export declare type MakeEllipseOptions = {
2
- rx: number;
3
- ry: number;
2
+ rx?: number | string;
3
+ ry?: number | string;
4
4
  };
5
5
  export declare const makeEllipse: ({ rx, ry }: MakeEllipseOptions) => string;
@@ -1,5 +1,7 @@
1
1
  export declare type MakeRectOptions = {
2
+ x?: number;
3
+ y?: number;
2
4
  width: number;
3
5
  height: number;
4
6
  };
5
- export declare const makeRect: ({ width, height }: MakeRectOptions) => string;
7
+ export declare const makeRect: ({ x, y, width, height }: MakeRectOptions) => string;
package/dist/make-rect.js CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeRect = void 0;
4
- const makeRect = ({ width, height }) => {
5
- const x = 0;
6
- const y = 0;
4
+ const makeRect = ({ x = 0, y = 0, width, height }) => {
7
5
  return `M ${x} ${y} l ${width} 0 l 0 ${height} l ${-width} 0 Z`;
8
6
  };
9
7
  exports.makeRect = makeRect;
@@ -0,0 +1,7 @@
1
+ export declare type MakeRectOptions = {
2
+ x?: number;
3
+ y?: number;
4
+ width: number;
5
+ height: number;
6
+ };
7
+ export declare const makeRect: ({ x, y, width, height }: MakeRectOptions) => string;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeRect = void 0;
4
+ const makeRect = ({ x = 0, y = 0, width, height }) => {
5
+ return `M ${x} ${y} l ${width} 0 l 0 ${height} l ${-width} 0 Z`;
6
+ };
7
+ exports.makeRect = makeRect;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare type SquareProps = {
3
+ width: number;
4
+ height: number;
5
+ fill?: string;
6
+ style?: React.CSSProperties;
7
+ };
8
+ export declare const Square: React.FC<SquareProps>;
package/dist/square.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Square = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const make_square_1 = require("./make-square");
6
+ const Square = ({ width, height, fill, style }) => {
7
+ return ((0, jsx_runtime_1.jsx)("svg", { width: width, height: height, viewBox: `0 0 ${width} ${height}`, xmlns: "http://www.w3.org/2000/svg", style: style, "data-shape-type": "square", children: (0, jsx_runtime_1.jsx)("path", { d: (0, make_square_1.makeSquare)({
8
+ width,
9
+ height,
10
+ }), fill: fill }) }));
11
+ };
12
+ exports.Square = Square;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/shapes",
3
- "version": "3.3.41",
3
+ "version": "3.3.43",
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.41"
48
+ "@remotion/paths": "3.3.43"
49
49
  },
50
- "gitHead": "8e408247d151ac824864acf357782f10c89ed5f5"
50
+ "gitHead": "3585e437a30ba001e983539728eb1914172b729c"
51
51
  }
@@ -1,5 +0,0 @@
1
- export declare type ShapeInfo = {
2
- path: string;
3
- width: string;
4
- height: string;
5
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +0,0 @@
1
- export declare type ShapeInfo = {
2
- path: string;
3
- width: number;
4
- height: number;
5
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- export declare type StarProps = {
2
- centerX: number;
3
- centerY: number;
4
- points: number;
5
- innerRadius: number;
6
- outerRadius: number;
7
- edgeRoundness: number | null;
8
- cornerRadius: number;
9
- };
10
- export declare const star: ({ centerX, centerY, points, innerRadius, outerRadius, cornerRadius, edgeRoundness, }: StarProps) => string;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.star = void 0;
4
- const instructions_1 = require("./instructions");
5
- const join_points_1 = require("./join-points");
6
- const polarToCartesian = ({ centerX, centerY, radius, angleInDegrees, }) => {
7
- const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0;
8
- return {
9
- x: centerX + radius * Math.cos(angleInRadians),
10
- y: centerY + radius * Math.sin(angleInRadians),
11
- };
12
- };
13
- const star = ({ centerX, centerY, points, innerRadius, outerRadius, cornerRadius, edgeRoundness, }) => {
14
- const degreeIncrement = 360 / (points * 2);
15
- const d = new Array(points * 2)
16
- .fill('true')
17
- .map((_p, i) => {
18
- const radius = i % 2 === 0 ? outerRadius : innerRadius;
19
- const degrees = degreeIncrement * i;
20
- const point = polarToCartesian({
21
- centerX,
22
- centerY,
23
- radius,
24
- angleInDegrees: degrees,
25
- });
26
- return [point.x, point.y];
27
- });
28
- return (0, instructions_1.serializeInstructions)((0, join_points_1.joinPoints)([...d, d[0]], {
29
- edgeRoundness,
30
- cornerRadius,
31
- roundCornerStrategy: 'arc',
32
- }));
33
- };
34
- exports.star = star;