@remotion/shapes 4.0.472 → 4.0.474

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.
@@ -2,14 +2,4 @@ import React from 'react';
2
2
  import type { MakeArrowProps } from '../utils/make-arrow';
3
3
  import type { AllShapesProps } from './render-svg';
4
4
  export type ArrowProps = MakeArrowProps & AllShapesProps;
5
- /**
6
- * @description Renders an SVG element containing an arrow shape.
7
- * @param {Number} length The total length of the arrow along its direction axis. Default 300.
8
- * @param {Number} headWidth The width of the arrowhead at its widest point. Default 185.
9
- * @param {Number} headLength The length of the arrowhead portion. Default 120.
10
- * @param {Number} shaftWidth The width of the arrow shaft. Default 80.
11
- * @param {string} direction The direction the arrow points. Default 'right'.
12
- * @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius.
13
- * @see [Documentation](https://www.remotion.dev/docs/shapes/arrow)
14
- */
15
5
  export declare const Arrow: React.FC<ArrowProps>;
@@ -2,8 +2,42 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Arrow = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const remotion_1 = require("remotion");
5
6
  const make_arrow_1 = require("../utils/make-arrow");
6
7
  const render_svg_1 = require("./render-svg");
8
+ const schema_1 = require("./schema");
9
+ const arrowSchema = (0, schema_1.makeShapeSchema)({
10
+ length: (0, schema_1.numberField)({
11
+ defaultValue: 300,
12
+ description: 'Length',
13
+ min: 0,
14
+ }),
15
+ headWidth: (0, schema_1.numberField)({
16
+ defaultValue: 185,
17
+ description: 'Head Width',
18
+ min: 0,
19
+ }),
20
+ headLength: (0, schema_1.numberField)({
21
+ defaultValue: 120,
22
+ description: 'Head Length',
23
+ min: 0,
24
+ }),
25
+ shaftWidth: (0, schema_1.numberField)({
26
+ defaultValue: 80,
27
+ description: 'Shaft Width',
28
+ min: 0,
29
+ }),
30
+ direction: (0, schema_1.enumField)({
31
+ defaultValue: 'right',
32
+ description: 'Direction',
33
+ variants: ['right', 'left', 'up', 'down'],
34
+ }),
35
+ cornerRadius: (0, schema_1.numberField)({
36
+ defaultValue: 0,
37
+ description: 'Corner Radius',
38
+ min: 0,
39
+ }),
40
+ });
7
41
  /**
8
42
  * @description Renders an SVG element containing an arrow shape.
9
43
  * @param {Number} length The total length of the arrow along its direction axis. Default 300.
@@ -14,8 +48,8 @@ const render_svg_1 = require("./render-svg");
14
48
  * @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius.
15
49
  * @see [Documentation](https://www.remotion.dev/docs/shapes/arrow)
16
50
  */
17
- const Arrow = ({ length, headWidth, headLength, shaftWidth, direction, cornerRadius, ...props }) => {
18
- return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { ...(0, make_arrow_1.makeArrow)({
51
+ const ArrowInner = ({ length, headWidth, headLength, shaftWidth, direction, cornerRadius, ...props }) => {
52
+ return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { defaultName: "<Arrow>", documentationLink: "https://www.remotion.dev/docs/shapes/arrow", ...(0, make_arrow_1.makeArrow)({
19
53
  length,
20
54
  headWidth,
21
55
  headLength,
@@ -24,4 +58,9 @@ const Arrow = ({ length, headWidth, headLength, shaftWidth, direction, cornerRad
24
58
  cornerRadius,
25
59
  }), ...props }));
26
60
  };
27
- exports.Arrow = Arrow;
61
+ exports.Arrow = remotion_1.Internals.wrapInSchema({
62
+ Component: ArrowInner,
63
+ schema: arrowSchema,
64
+ supportsEffects: true,
65
+ });
66
+ remotion_1.Internals.addSequenceStackTraces(exports.Arrow);
@@ -2,9 +2,4 @@ import React from 'react';
2
2
  import type { MakeCircleProps } from '../utils/make-circle';
3
3
  import type { AllShapesProps } from './render-svg';
4
4
  export type CircleProps = MakeCircleProps & AllShapesProps;
5
- /**
6
- * @description Renders an SVG element drawing a circle.
7
- * @param {Number} radius The radius of the circle.
8
- * @see [Documentation](https://www.remotion.dev/docs/shapes/circle)
9
- */
10
5
  export declare const Circle: React.FC<CircleProps>;
@@ -2,14 +2,28 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Circle = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const remotion_1 = require("remotion");
5
6
  const make_circle_1 = require("../utils/make-circle");
6
7
  const render_svg_1 = require("./render-svg");
8
+ const schema_1 = require("./schema");
9
+ const circleSchema = (0, schema_1.makeShapeSchema)({
10
+ radius: (0, schema_1.numberField)({
11
+ defaultValue: 100,
12
+ description: 'Radius',
13
+ min: 0,
14
+ }),
15
+ });
7
16
  /**
8
17
  * @description Renders an SVG element drawing a circle.
9
18
  * @param {Number} radius The radius of the circle.
10
19
  * @see [Documentation](https://www.remotion.dev/docs/shapes/circle)
11
20
  */
12
- const Circle = ({ radius, ...props }) => {
13
- return jsx_runtime_1.jsx(render_svg_1.RenderSvg, { ...(0, make_circle_1.makeCircle)({ radius }), ...props });
21
+ const CircleInner = ({ radius, ...props }) => {
22
+ return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { defaultName: "<Circle>", documentationLink: "https://www.remotion.dev/docs/shapes/circle", ...(0, make_circle_1.makeCircle)({ radius }), ...props }));
14
23
  };
15
- exports.Circle = Circle;
24
+ exports.Circle = remotion_1.Internals.wrapInSchema({
25
+ Component: CircleInner,
26
+ schema: circleSchema,
27
+ supportsEffects: true,
28
+ });
29
+ remotion_1.Internals.addSequenceStackTraces(exports.Circle);
@@ -2,10 +2,4 @@ import React from 'react';
2
2
  import type { MakeEllipseOptions } from '../utils/make-ellipse';
3
3
  import type { AllShapesProps } from './render-svg';
4
4
  export type EllipseProps = MakeEllipseOptions & AllShapesProps;
5
- /**
6
- * @description Renders an SVG element drawing an ellipse.
7
- * @param {Number} rx The radius of the ellipse on the X axis.
8
- * @param {Number} ry The radius of the ellipse on the Y axis.
9
- * @see [Documentation](https://www.remotion.dev/docs/shapes/ellipse)
10
- */
11
5
  export declare const Ellipse: React.FC<EllipseProps>;
@@ -2,15 +2,34 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Ellipse = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const remotion_1 = require("remotion");
5
6
  const make_ellipse_1 = require("../utils/make-ellipse");
6
7
  const render_svg_1 = require("./render-svg");
8
+ const schema_1 = require("./schema");
9
+ const ellipseSchema = (0, schema_1.makeShapeSchema)({
10
+ rx: (0, schema_1.numberField)({
11
+ defaultValue: 100,
12
+ description: 'X Radius',
13
+ min: 0,
14
+ }),
15
+ ry: (0, schema_1.numberField)({
16
+ defaultValue: 50,
17
+ description: 'Y Radius',
18
+ min: 0,
19
+ }),
20
+ });
7
21
  /**
8
22
  * @description Renders an SVG element drawing an ellipse.
9
23
  * @param {Number} rx The radius of the ellipse on the X axis.
10
24
  * @param {Number} ry The radius of the ellipse on the Y axis.
11
25
  * @see [Documentation](https://www.remotion.dev/docs/shapes/ellipse)
12
26
  */
13
- const Ellipse = ({ rx, ry, ...props }) => {
14
- return jsx_runtime_1.jsx(render_svg_1.RenderSvg, { ...(0, make_ellipse_1.makeEllipse)({ rx, ry }), ...props });
27
+ const EllipseInner = ({ rx, ry, ...props }) => {
28
+ return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { defaultName: "<Ellipse>", documentationLink: "https://www.remotion.dev/docs/shapes/ellipse", ...(0, make_ellipse_1.makeEllipse)({ rx, ry }), ...props }));
15
29
  };
16
- exports.Ellipse = Ellipse;
30
+ exports.Ellipse = remotion_1.Internals.wrapInSchema({
31
+ Component: EllipseInner,
32
+ schema: ellipseSchema,
33
+ supportsEffects: true,
34
+ });
35
+ remotion_1.Internals.addSequenceStackTraces(exports.Ellipse);
@@ -2,9 +2,4 @@ import React from 'react';
2
2
  import type { MakeHeartProps } from '../utils/make-heart';
3
3
  import type { AllShapesProps } from './render-svg';
4
4
  export type HeartProps = MakeHeartProps & AllShapesProps;
5
- /**
6
- * @description Renders an SVG element containing a heart.
7
- * @param {Number} size The size of the heart.
8
- * @see [Documentation](https://www.remotion.dev/docs/shapes/heart)
9
- */
10
5
  export declare const Heart: React.FC<HeartProps>;
@@ -2,19 +2,49 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Heart = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const remotion_1 = require("remotion");
5
6
  const make_heart_1 = require("../utils/make-heart");
6
7
  const render_svg_1 = require("./render-svg");
8
+ const schema_1 = require("./schema");
9
+ const heartSchema = (0, schema_1.makeShapeSchema)({
10
+ height: (0, schema_1.numberField)({
11
+ defaultValue: 100,
12
+ description: 'Height',
13
+ min: 0,
14
+ }),
15
+ aspectRatio: (0, schema_1.numberField)({
16
+ defaultValue: 1.1,
17
+ description: 'Aspect Ratio',
18
+ min: 0,
19
+ step: 0.01,
20
+ }),
21
+ bottomRoundnessAdjustment: (0, schema_1.numberField)({
22
+ defaultValue: 0,
23
+ description: 'Bottom Roundness Adjustment',
24
+ step: 0.01,
25
+ }),
26
+ depthAdjustment: (0, schema_1.numberField)({
27
+ defaultValue: 0,
28
+ description: 'Depth Adjustment',
29
+ step: 0.01,
30
+ }),
31
+ });
7
32
  /**
8
33
  * @description Renders an SVG element containing a heart.
9
34
  * @param {Number} size The size of the heart.
10
35
  * @see [Documentation](https://www.remotion.dev/docs/shapes/heart)
11
36
  */
12
- const Heart = ({ aspectRatio, height, bottomRoundnessAdjustment = 0, depthAdjustment = 0, ...props }) => {
13
- return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { ...(0, make_heart_1.makeHeart)({
37
+ const HeartInner = ({ aspectRatio, height, bottomRoundnessAdjustment = 0, depthAdjustment = 0, ...props }) => {
38
+ return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { defaultName: "<Heart>", documentationLink: "https://www.remotion.dev/docs/shapes/heart", ...(0, make_heart_1.makeHeart)({
14
39
  aspectRatio,
15
40
  height,
16
41
  bottomRoundnessAdjustment,
17
42
  depthAdjustment,
18
43
  }), ...props }));
19
44
  };
20
- exports.Heart = Heart;
45
+ exports.Heart = remotion_1.Internals.wrapInSchema({
46
+ Component: HeartInner,
47
+ schema: heartSchema,
48
+ supportsEffects: true,
49
+ });
50
+ remotion_1.Internals.addSequenceStackTraces(exports.Heart);
@@ -2,13 +2,4 @@ import React from 'react';
2
2
  import type { MakePieProps } from '../utils/make-pie';
3
3
  import type { AllShapesProps } from './render-svg';
4
4
  export type PieProps = MakePieProps & AllShapesProps;
5
- /**
6
- * @description Renders an SVG element drawing a pie piece.
7
- * @param {Number} radius The radius of the circle..
8
- * @param {Number} progress The percentage of the circle that is filled. 0 means fully empty, 1 means fully filled.
9
- * @param {Boolean} closePath If set to false, no path to the middle of the circle will be drawn, leading to an open arc. Default true.
10
- * @param {Boolean} counterClockwise If set, the circle gets filled counterclockwise instead of clockwise. Default false.
11
- * @param {Number} rotation Add rotation to the path. 0 means no rotation, Math.PI * 2 means 1 full clockwise rotation
12
- * @see [Documentation](https://www.remotion.dev/docs/shapes/pie)
13
- */
14
5
  export declare const Pie: React.FC<PieProps>;
@@ -2,8 +2,37 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Pie = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const remotion_1 = require("remotion");
5
6
  const make_pie_1 = require("../utils/make-pie");
6
7
  const render_svg_1 = require("./render-svg");
8
+ const schema_1 = require("./schema");
9
+ const pieSchema = (0, schema_1.makeShapeSchema)({
10
+ radius: (0, schema_1.numberField)({
11
+ defaultValue: 100,
12
+ description: 'Radius',
13
+ min: 0,
14
+ }),
15
+ progress: (0, schema_1.numberField)({
16
+ defaultValue: 0.5,
17
+ description: 'Progress',
18
+ max: 1,
19
+ min: 0,
20
+ step: 0.01,
21
+ }),
22
+ closePath: (0, schema_1.booleanField)({
23
+ defaultValue: true,
24
+ description: 'Close Path',
25
+ }),
26
+ counterClockwise: (0, schema_1.booleanField)({
27
+ defaultValue: false,
28
+ description: 'Counter Clockwise',
29
+ }),
30
+ rotation: (0, schema_1.numberField)({
31
+ defaultValue: 0,
32
+ description: 'Rotation',
33
+ step: 0.01,
34
+ }),
35
+ });
7
36
  /**
8
37
  * @description Renders an SVG element drawing a pie piece.
9
38
  * @param {Number} radius The radius of the circle..
@@ -13,7 +42,12 @@ const render_svg_1 = require("./render-svg");
13
42
  * @param {Number} rotation Add rotation to the path. 0 means no rotation, Math.PI * 2 means 1 full clockwise rotation
14
43
  * @see [Documentation](https://www.remotion.dev/docs/shapes/pie)
15
44
  */
16
- const Pie = ({ radius, progress, closePath, counterClockwise, rotation, ...props }) => {
17
- return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { ...(0, make_pie_1.makePie)({ radius, progress, closePath, counterClockwise, rotation }), ...props }));
45
+ const PieInner = ({ radius, progress, closePath, counterClockwise, rotation, ...props }) => {
46
+ return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { defaultName: "<Pie>", documentationLink: "https://www.remotion.dev/docs/shapes/pie", ...(0, make_pie_1.makePie)({ radius, progress, closePath, counterClockwise, rotation }), ...props }));
18
47
  };
19
- exports.Pie = Pie;
48
+ exports.Pie = remotion_1.Internals.wrapInSchema({
49
+ Component: PieInner,
50
+ schema: pieSchema,
51
+ supportsEffects: true,
52
+ });
53
+ remotion_1.Internals.addSequenceStackTraces(exports.Pie);
@@ -2,14 +2,39 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Polygon = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const remotion_1 = require("remotion");
5
6
  const make_polygon_1 = require("../utils/make-polygon");
6
7
  const render_svg_1 = require("./render-svg");
7
- const Polygon = ({ points, radius, cornerRadius, edgeRoundness, ...props }) => {
8
- return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { ...(0, make_polygon_1.makePolygon)({
8
+ const schema_1 = require("./schema");
9
+ const polygonSchema = (0, schema_1.makeShapeSchema)({
10
+ points: (0, schema_1.numberField)({
11
+ defaultValue: 5,
12
+ description: 'Points',
13
+ min: 3,
14
+ step: 1,
15
+ }),
16
+ radius: (0, schema_1.numberField)({
17
+ defaultValue: 100,
18
+ description: 'Radius',
19
+ min: 0,
20
+ }),
21
+ cornerRadius: (0, schema_1.numberField)({
22
+ defaultValue: 0,
23
+ description: 'Corner Radius',
24
+ min: 0,
25
+ }),
26
+ });
27
+ const PolygonInner = ({ points, radius, cornerRadius, edgeRoundness, ...props }) => {
28
+ return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { defaultName: "<Polygon>", documentationLink: "https://www.remotion.dev/docs/shapes/polygon", ...(0, make_polygon_1.makePolygon)({
9
29
  points,
10
30
  cornerRadius,
11
31
  edgeRoundness,
12
32
  radius,
13
33
  }), ...props }));
14
34
  };
15
- exports.Polygon = Polygon;
35
+ exports.Polygon = remotion_1.Internals.wrapInSchema({
36
+ Component: PolygonInner,
37
+ schema: polygonSchema,
38
+ supportsEffects: true,
39
+ });
40
+ remotion_1.Internals.addSequenceStackTraces(exports.Polygon);
@@ -2,12 +2,4 @@ import React from 'react';
2
2
  import type { MakeRectOptions } from '../utils/make-rect';
3
3
  import type { AllShapesProps } from './render-svg';
4
4
  export type RectProps = MakeRectOptions & AllShapesProps;
5
- /**
6
- * @description Renders an SVG element containing a rectangle.
7
- * @param {Number} width The width of the Rectangle
8
- * @param {Number} height The height of the Rectangle
9
- * @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
10
- * @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
11
- * @see [Documentation](https://www.remotion.dev/docs/shapes/rect)
12
- */
13
5
  export declare const Rect: React.FC<RectProps>;
@@ -2,8 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Rect = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const remotion_1 = require("remotion");
5
6
  const make_rect_1 = require("../utils/make-rect");
6
7
  const render_svg_1 = require("./render-svg");
8
+ const schema_1 = require("./schema");
9
+ const rectSchema = (0, schema_1.makeShapeSchema)({
10
+ width: (0, schema_1.numberField)({
11
+ defaultValue: 100,
12
+ description: 'Width',
13
+ min: 0,
14
+ }),
15
+ height: (0, schema_1.numberField)({
16
+ defaultValue: 100,
17
+ description: 'Height',
18
+ min: 0,
19
+ }),
20
+ cornerRadius: (0, schema_1.numberField)({
21
+ defaultValue: 0,
22
+ description: 'Corner Radius',
23
+ min: 0,
24
+ }),
25
+ });
7
26
  /**
8
27
  * @description Renders an SVG element containing a rectangle.
9
28
  * @param {Number} width The width of the Rectangle
@@ -12,7 +31,12 @@ const render_svg_1 = require("./render-svg");
12
31
  * @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
13
32
  * @see [Documentation](https://www.remotion.dev/docs/shapes/rect)
14
33
  */
15
- const Rect = ({ width, edgeRoundness, height, cornerRadius, ...props }) => {
16
- return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { ...(0, make_rect_1.makeRect)({ height, width, edgeRoundness, cornerRadius }), ...props }));
34
+ const RectInner = ({ width, edgeRoundness, height, cornerRadius, ...props }) => {
35
+ return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { defaultName: "<Rect>", documentationLink: "https://www.remotion.dev/docs/shapes/rect", ...(0, make_rect_1.makeRect)({ height, width, edgeRoundness, cornerRadius }), ...props }));
17
36
  };
18
- exports.Rect = Rect;
37
+ exports.Rect = remotion_1.Internals.wrapInSchema({
38
+ Component: RectInner,
39
+ schema: rectSchema,
40
+ supportsEffects: true,
41
+ });
42
+ remotion_1.Internals.addSequenceStackTraces(exports.Rect);
@@ -1,16 +1,37 @@
1
1
  import type { Instruction } from '@remotion/paths';
2
2
  import React from 'react';
3
- export type AllShapesProps = Omit<React.SVGProps<SVGPathElement>, 'width' | 'height' | 'd'> & {
3
+ import { type EffectsProp, type HtmlInCanvasPixelDensity, type SequenceControls, type SequenceProps } from 'remotion';
4
+ type ShapeSequenceProps = Pick<SequenceProps, 'durationInFrames' | 'from' | 'hidden' | 'name' | 'showInTimeline'> & {
5
+ readonly _experimentalControls?: SequenceControls;
6
+ };
7
+ export type AllShapesProps = Omit<React.SVGProps<SVGPathElement>, 'width' | 'height' | 'd' | 'hidden' | 'name'> & ShapeSequenceProps & {
4
8
  readonly debug?: boolean;
9
+ readonly effects?: EffectsProp;
5
10
  readonly pathStyle?: React.CSSProperties;
11
+ readonly pixelDensity?: HtmlInCanvasPixelDensity;
12
+ /**
13
+ * @deprecated For internal use only
14
+ */
15
+ readonly stack?: string;
6
16
  };
7
- export declare const RenderSvg: ({ width, height, path, style, pathStyle, transformOrigin, debug, instructions, ...props }: {
17
+ export declare const RenderSvg: ({ defaultName, documentationLink, width, height, path, style, pathStyle, transformOrigin, debug, effects, instructions, pixelDensity, durationInFrames, from, hidden, name, showInTimeline, _experimentalControls: controls, stack, ...props }: {
18
+ readonly defaultName: string;
19
+ readonly documentationLink: string;
8
20
  readonly width: number;
9
21
  readonly height: number;
10
22
  readonly path: string;
11
23
  readonly instructions: Instruction[];
12
24
  readonly transformOrigin: string;
13
- } & Omit<React.SVGProps<SVGPathElement>, "d" | "height" | "width"> & {
25
+ } & Omit<React.SVGProps<SVGPathElement>, "d" | "height" | "hidden" | "name" | "width"> & Pick<SequenceProps, "durationInFrames" | "from" | "hidden" | "name" | "showInTimeline"> & {
26
+ readonly _experimentalControls?: SequenceControls | undefined;
27
+ } & {
14
28
  readonly debug?: boolean | undefined;
29
+ readonly effects?: EffectsProp | undefined;
15
30
  readonly pathStyle?: React.CSSProperties | undefined;
31
+ readonly pixelDensity?: number | undefined;
32
+ /**
33
+ * @deprecated For internal use only
34
+ */
35
+ readonly stack?: string | undefined;
16
36
  }) => import("react/jsx-runtime").JSX.Element;
37
+ export {};
@@ -37,8 +37,9 @@ exports.RenderSvg = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = __importStar(require("react"));
39
39
  const react_dom_1 = require("react-dom");
40
+ const remotion_1 = require("remotion");
40
41
  const does_react_support_canary_1 = require("../utils/does-react-support-canary");
41
- const RenderSvg = ({ width, height, path, style, pathStyle, transformOrigin, debug, instructions, ...props }) => {
42
+ const RenderSvg = ({ defaultName, documentationLink, width, height, path, style, pathStyle, transformOrigin, debug, effects = [], instructions, pixelDensity, durationInFrames, from, hidden, name, showInTimeline, _experimentalControls: controls, stack, ...props }) => {
42
43
  const actualStyle = (0, react_1.useMemo)(() => {
43
44
  return {
44
45
  overflow: 'visible',
@@ -51,8 +52,19 @@ const RenderSvg = ({ width, height, path, style, pathStyle, transformOrigin, deb
51
52
  ...(pathStyle !== null && pathStyle !== void 0 ? pathStyle : {}),
52
53
  };
53
54
  }, [pathStyle]);
55
+ const outlineRef = (0, react_1.useRef)(null);
56
+ const setSvgRef = (0, react_1.useCallback)((node) => {
57
+ outlineRef.current = node;
58
+ }, []);
59
+ const setCanvasRef = (0, react_1.useCallback)((canvas) => {
60
+ outlineRef.current = canvas;
61
+ }, []);
62
+ const memoizedEffectDefinitions = remotion_1.Internals.useMemoizedEffectDefinitions(effects);
63
+ const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
54
64
  const reactSupportsTransformOrigin = (0, does_react_support_canary_1.doesReactSupportTransformOriginProperty)(react_dom_1.version);
55
- return (jsx_runtime_1.jsxs("svg", { width: width, height: height, viewBox: `0 0 ${width} ${height}`, xmlns: "http://www.w3.org/2000/svg", style: actualStyle, children: [
65
+ const svg = (jsx_runtime_1.jsxs("svg", { ref: effects.length === 0 || !videoConfig ? setSvgRef : undefined, width: width, height: height, viewBox: `0 0 ${width} ${height}`, xmlns: "http://www.w3.org/2000/svg", style: effects.length === 0 || !videoConfig
66
+ ? actualStyle
67
+ : { overflow: 'visible' }, children: [
56
68
  jsx_runtime_1.jsx("path", { ...(reactSupportsTransformOrigin
57
69
  ? {
58
70
  transformOrigin,
@@ -90,5 +102,11 @@ const RenderSvg = ({ width, height, path, style, pathStyle, transformOrigin, deb
90
102
  return null;
91
103
  })
92
104
  : null] }));
105
+ const content = effects.length === 0 ? (svg) : (jsx_runtime_1.jsx(remotion_1.HtmlInCanvas, { ref: setCanvasRef, width: Math.ceil(width), height: Math.ceil(height), effects: effects, pixelDensity: pixelDensity, showInTimeline: false, style: actualStyle, _experimentalControls: controls, children: svg }));
106
+ const stackProps = stack === undefined ? null : { stack };
107
+ if (!videoConfig) {
108
+ return svg;
109
+ }
110
+ return (jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", from: from, hidden: hidden, showInTimeline: showInTimeline, _experimentalControls: controls, _remotionInternalEffects: memoizedEffectDefinitions, durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : defaultName, _remotionInternalRefForOutline: outlineRef, _remotionInternalDocumentationLink: name === undefined ? documentationLink : undefined, ...stackProps, children: content }));
93
111
  };
94
112
  exports.RenderSvg = RenderSvg;
@@ -0,0 +1,23 @@
1
+ import { type SequenceFieldSchema, type SequenceSchema } from 'remotion';
2
+ export declare const numberField: ({ defaultValue, description, hiddenFromList, max, min, step, }: {
3
+ readonly defaultValue: number | undefined;
4
+ readonly description: string;
5
+ readonly hiddenFromList?: boolean | undefined;
6
+ readonly max?: number | undefined;
7
+ readonly min?: number | undefined;
8
+ readonly step?: number | undefined;
9
+ }) => SequenceFieldSchema;
10
+ export declare const booleanField: ({ defaultValue, description, }: {
11
+ readonly defaultValue: boolean;
12
+ readonly description: string;
13
+ }) => SequenceFieldSchema;
14
+ export declare const colorField: ({ defaultValue, description, }: {
15
+ readonly defaultValue: string | undefined;
16
+ readonly description: string;
17
+ }) => SequenceFieldSchema;
18
+ export declare const enumField: <T extends string>({ defaultValue, description, variants, }: {
19
+ readonly defaultValue: T;
20
+ readonly description: string;
21
+ readonly variants: readonly T[];
22
+ }) => SequenceFieldSchema;
23
+ export declare const makeShapeSchema: (shapeFields: SequenceSchema) => SequenceSchema;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeShapeSchema = exports.enumField = exports.colorField = exports.booleanField = exports.numberField = void 0;
4
+ const remotion_1 = require("remotion");
5
+ const numberField = ({ defaultValue, description, hiddenFromList = false, max, min, step = 1, }) => {
6
+ return {
7
+ type: 'number',
8
+ default: defaultValue,
9
+ description,
10
+ hiddenFromList,
11
+ max,
12
+ min,
13
+ step,
14
+ };
15
+ };
16
+ exports.numberField = numberField;
17
+ const booleanField = ({ defaultValue, description, }) => {
18
+ return {
19
+ type: 'boolean',
20
+ default: defaultValue,
21
+ description,
22
+ };
23
+ };
24
+ exports.booleanField = booleanField;
25
+ const colorField = ({ defaultValue, description, }) => {
26
+ return {
27
+ type: 'color',
28
+ default: defaultValue,
29
+ description,
30
+ };
31
+ };
32
+ exports.colorField = colorField;
33
+ const enumField = ({ defaultValue, description, variants, }) => {
34
+ return {
35
+ type: 'enum',
36
+ default: defaultValue,
37
+ description,
38
+ variants: Object.fromEntries(variants.map((variant) => [variant, {}])),
39
+ };
40
+ };
41
+ exports.enumField = enumField;
42
+ const makeShapeSchema = (shapeFields) => {
43
+ return {
44
+ from: remotion_1.Internals.sequenceSchema.from,
45
+ durationInFrames: remotion_1.Internals.sequenceSchema.durationInFrames,
46
+ ...shapeFields,
47
+ fill: (0, exports.colorField)({
48
+ defaultValue: '#0b84ff',
49
+ description: 'Fill',
50
+ }),
51
+ ...remotion_1.Internals.sequenceVisualStyleSchema,
52
+ hidden: remotion_1.Internals.sequenceSchema.hidden,
53
+ };
54
+ };
55
+ exports.makeShapeSchema = makeShapeSchema;
@@ -2,13 +2,4 @@ import React from 'react';
2
2
  import type { MakeStarProps } from '../utils/make-star';
3
3
  import type { AllShapesProps } from './render-svg';
4
4
  export type StarProps = MakeStarProps & Omit<AllShapesProps, 'points'>;
5
- /**
6
- * @description Renders an SVG element containing a star.
7
- * @param {Number} innerRadius The inner radius of the star.
8
- * @param {Number} outerRadius The outer radius of the star.
9
- * @param {Number} points The amount of points of the star.
10
- * @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
11
- * @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
12
- * @see [Documentation](https://www.remotion.dev/docs/shapes/star)
13
- */
14
5
  export declare const Star: React.FC<StarProps>;
@@ -2,8 +2,33 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Star = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const remotion_1 = require("remotion");
5
6
  const make_star_1 = require("../utils/make-star");
6
7
  const render_svg_1 = require("./render-svg");
8
+ const schema_1 = require("./schema");
9
+ const starSchema = (0, schema_1.makeShapeSchema)({
10
+ points: (0, schema_1.numberField)({
11
+ defaultValue: 5,
12
+ description: 'Points',
13
+ min: 3,
14
+ step: 1,
15
+ }),
16
+ innerRadius: (0, schema_1.numberField)({
17
+ defaultValue: 50,
18
+ description: 'Inner Radius',
19
+ min: 0,
20
+ }),
21
+ outerRadius: (0, schema_1.numberField)({
22
+ defaultValue: 100,
23
+ description: 'Outer Radius',
24
+ min: 0,
25
+ }),
26
+ cornerRadius: (0, schema_1.numberField)({
27
+ defaultValue: 0,
28
+ description: 'Corner Radius',
29
+ min: 0,
30
+ }),
31
+ });
7
32
  /**
8
33
  * @description Renders an SVG element containing a star.
9
34
  * @param {Number} innerRadius The inner radius of the star.
@@ -13,8 +38,8 @@ const render_svg_1 = require("./render-svg");
13
38
  * @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
14
39
  * @see [Documentation](https://www.remotion.dev/docs/shapes/star)
15
40
  */
16
- const Star = ({ innerRadius, outerRadius, points, cornerRadius, edgeRoundness, ...props }) => {
17
- return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { ...(0, make_star_1.makeStar)({
41
+ const StarInner = ({ innerRadius, outerRadius, points, cornerRadius, edgeRoundness, ...props }) => {
42
+ return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { defaultName: "<Star>", documentationLink: "https://www.remotion.dev/docs/shapes/star", ...(0, make_star_1.makeStar)({
18
43
  innerRadius,
19
44
  outerRadius,
20
45
  points,
@@ -22,4 +47,9 @@ const Star = ({ innerRadius, outerRadius, points, cornerRadius, edgeRoundness, .
22
47
  edgeRoundness,
23
48
  }), ...props }));
24
49
  };
25
- exports.Star = Star;
50
+ exports.Star = remotion_1.Internals.wrapInSchema({
51
+ Component: StarInner,
52
+ schema: starSchema,
53
+ supportsEffects: true,
54
+ });
55
+ remotion_1.Internals.addSequenceStackTraces(exports.Star);