@remotion/shapes 4.0.476 → 4.0.478
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/components/arrow.js +1 -0
- package/dist/components/callout.d.ts +5 -0
- package/dist/components/callout.js +78 -0
- package/dist/components/circle.js +1 -0
- package/dist/components/ellipse.js +1 -0
- package/dist/components/heart.js +1 -0
- package/dist/components/pie.js +1 -0
- package/dist/components/polygon.js +1 -0
- package/dist/components/rect.js +1 -0
- package/dist/components/render-svg.d.ts +3 -3
- package/dist/components/render-svg.js +2 -2
- package/dist/components/schema.js +1 -0
- package/dist/components/star.js +1 -0
- package/dist/components/triangle.js +1 -0
- package/dist/esm/index.mjs +506 -184
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -1
- package/dist/utils/make-callout.d.ts +26 -0
- package/dist/utils/make-callout.js +240 -0
- package/package.json +4 -4
package/dist/components/arrow.js
CHANGED
|
@@ -60,6 +60,7 @@ const ArrowInner = ({ length, headWidth, headLength, shaftWidth, direction, corn
|
|
|
60
60
|
};
|
|
61
61
|
exports.Arrow = remotion_1.Internals.wrapInSchema({
|
|
62
62
|
Component: ArrowInner,
|
|
63
|
+
componentIdentity: 'dev.remotion.shapes.Arrow',
|
|
63
64
|
schema: arrowSchema,
|
|
64
65
|
supportsEffects: true,
|
|
65
66
|
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Callout = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const make_callout_1 = require("../utils/make-callout");
|
|
7
|
+
const render_svg_1 = require("./render-svg");
|
|
8
|
+
const schema_1 = require("./schema");
|
|
9
|
+
const calloutSchema = (0, schema_1.makeShapeSchema)({
|
|
10
|
+
width: (0, schema_1.numberField)({
|
|
11
|
+
defaultValue: 500,
|
|
12
|
+
description: 'Width',
|
|
13
|
+
min: 1,
|
|
14
|
+
}),
|
|
15
|
+
height: (0, schema_1.numberField)({
|
|
16
|
+
defaultValue: 200,
|
|
17
|
+
description: 'Height',
|
|
18
|
+
min: 1,
|
|
19
|
+
}),
|
|
20
|
+
pointerLength: (0, schema_1.numberField)({
|
|
21
|
+
defaultValue: 40,
|
|
22
|
+
description: 'Pointer Length',
|
|
23
|
+
min: 1,
|
|
24
|
+
}),
|
|
25
|
+
pointerBaseWidth: (0, schema_1.numberField)({
|
|
26
|
+
defaultValue: 60,
|
|
27
|
+
description: 'Pointer Base Width',
|
|
28
|
+
min: 1,
|
|
29
|
+
}),
|
|
30
|
+
pointerPosition: (0, schema_1.numberField)({
|
|
31
|
+
defaultValue: 0.5,
|
|
32
|
+
description: 'Pointer Position',
|
|
33
|
+
min: 0,
|
|
34
|
+
max: 1,
|
|
35
|
+
step: 0.01,
|
|
36
|
+
}),
|
|
37
|
+
pointerDirection: (0, schema_1.enumField)({
|
|
38
|
+
defaultValue: 'down',
|
|
39
|
+
description: 'Pointer Direction',
|
|
40
|
+
variants: ['up', 'down', 'left', 'right'],
|
|
41
|
+
}),
|
|
42
|
+
cornerRadius: (0, schema_1.numberField)({
|
|
43
|
+
defaultValue: 0,
|
|
44
|
+
description: 'Corner Radius',
|
|
45
|
+
min: 0,
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* @description Renders an SVG element containing a callout shape.
|
|
50
|
+
* @param {Number} width The width of the callout body. Default 500.
|
|
51
|
+
* @param {Number} height The height of the callout body. Default 200.
|
|
52
|
+
* @param {Number} pointerLength The length of the pointer. Default 40.
|
|
53
|
+
* @param {Number} pointerBaseWidth The width of the pointer where it meets the body. Default 60.
|
|
54
|
+
* @param {Number} pointerPosition Position of the pointer along its side, from 0 to 1. Default 0.5.
|
|
55
|
+
* @param {string} pointerDirection The direction the pointer points. Default 'down'.
|
|
56
|
+
* @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
|
|
57
|
+
* @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
|
|
58
|
+
* @see [Documentation](https://www.remotion.dev/docs/shapes/callout)
|
|
59
|
+
*/
|
|
60
|
+
const CalloutInner = ({ width, height, pointerLength, pointerBaseWidth, pointerPosition, pointerDirection, edgeRoundness, cornerRadius, ...props }) => {
|
|
61
|
+
return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { defaultName: "<Callout>", documentationLink: "https://www.remotion.dev/docs/shapes/callout", ...(0, make_callout_1.makeCallout)({
|
|
62
|
+
width,
|
|
63
|
+
height,
|
|
64
|
+
pointerLength,
|
|
65
|
+
pointerBaseWidth,
|
|
66
|
+
pointerPosition,
|
|
67
|
+
pointerDirection,
|
|
68
|
+
edgeRoundness,
|
|
69
|
+
cornerRadius,
|
|
70
|
+
}), ...props }));
|
|
71
|
+
};
|
|
72
|
+
exports.Callout = remotion_1.Internals.wrapInSchema({
|
|
73
|
+
Component: CalloutInner,
|
|
74
|
+
componentIdentity: 'dev.remotion.shapes.Callout',
|
|
75
|
+
schema: calloutSchema,
|
|
76
|
+
supportsEffects: true,
|
|
77
|
+
});
|
|
78
|
+
remotion_1.Internals.addSequenceStackTraces(exports.Callout);
|
package/dist/components/heart.js
CHANGED
|
@@ -44,6 +44,7 @@ const HeartInner = ({ aspectRatio, height, bottomRoundnessAdjustment = 0, depthA
|
|
|
44
44
|
};
|
|
45
45
|
exports.Heart = remotion_1.Internals.wrapInSchema({
|
|
46
46
|
Component: HeartInner,
|
|
47
|
+
componentIdentity: 'dev.remotion.shapes.Heart',
|
|
47
48
|
schema: heartSchema,
|
|
48
49
|
supportsEffects: true,
|
|
49
50
|
});
|
package/dist/components/pie.js
CHANGED
|
@@ -47,6 +47,7 @@ const PieInner = ({ radius, progress, closePath, counterClockwise, rotation, ...
|
|
|
47
47
|
};
|
|
48
48
|
exports.Pie = remotion_1.Internals.wrapInSchema({
|
|
49
49
|
Component: PieInner,
|
|
50
|
+
componentIdentity: 'dev.remotion.shapes.Pie',
|
|
50
51
|
schema: pieSchema,
|
|
51
52
|
supportsEffects: true,
|
|
52
53
|
});
|
|
@@ -34,6 +34,7 @@ const PolygonInner = ({ points, radius, cornerRadius, edgeRoundness, ...props })
|
|
|
34
34
|
};
|
|
35
35
|
exports.Polygon = remotion_1.Internals.wrapInSchema({
|
|
36
36
|
Component: PolygonInner,
|
|
37
|
+
componentIdentity: 'dev.remotion.shapes.Polygon',
|
|
37
38
|
schema: polygonSchema,
|
|
38
39
|
supportsEffects: true,
|
|
39
40
|
});
|
package/dist/components/rect.js
CHANGED
|
@@ -36,6 +36,7 @@ const RectInner = ({ width, edgeRoundness, height, cornerRadius, ...props }) =>
|
|
|
36
36
|
};
|
|
37
37
|
exports.Rect = remotion_1.Internals.wrapInSchema({
|
|
38
38
|
Component: RectInner,
|
|
39
|
+
componentIdentity: 'dev.remotion.shapes.Rect',
|
|
39
40
|
schema: rectSchema,
|
|
40
41
|
supportsEffects: true,
|
|
41
42
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Instruction } from '@remotion/paths';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { type EffectsProp, type HtmlInCanvasPixelDensity, type SequenceControls, type SequenceProps } from 'remotion';
|
|
4
|
-
type ShapeSequenceProps = Pick<SequenceProps, 'durationInFrames' | 'from' | 'hidden' | 'name' | 'showInTimeline'> & {
|
|
4
|
+
type ShapeSequenceProps = Pick<SequenceProps, 'durationInFrames' | 'from' | 'freeze' | 'hidden' | 'name' | 'showInTimeline'> & {
|
|
5
5
|
readonly _experimentalControls?: SequenceControls;
|
|
6
6
|
};
|
|
7
7
|
export type AllShapesProps = Omit<React.SVGProps<SVGPathElement>, 'width' | 'height' | 'd' | 'hidden' | 'name'> & ShapeSequenceProps & {
|
|
@@ -14,7 +14,7 @@ export type AllShapesProps = Omit<React.SVGProps<SVGPathElement>, 'width' | 'hei
|
|
|
14
14
|
*/
|
|
15
15
|
readonly stack?: string;
|
|
16
16
|
};
|
|
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 }: {
|
|
17
|
+
export declare const RenderSvg: ({ defaultName, documentationLink, width, height, path, style, pathStyle, transformOrigin, debug, effects, instructions, pixelDensity, durationInFrames, from, freeze, hidden, name, showInTimeline, _experimentalControls: controls, stack, ...props }: {
|
|
18
18
|
readonly defaultName: string;
|
|
19
19
|
readonly documentationLink: string;
|
|
20
20
|
readonly width: number;
|
|
@@ -22,7 +22,7 @@ export declare const RenderSvg: ({ defaultName, documentationLink, width, height
|
|
|
22
22
|
readonly path: string;
|
|
23
23
|
readonly instructions: Instruction[];
|
|
24
24
|
readonly transformOrigin: string;
|
|
25
|
-
} & Omit<React.SVGProps<SVGPathElement>, "d" | "height" | "hidden" | "name" | "width"> & Pick<SequenceProps, "durationInFrames" | "from" | "hidden" | "name" | "showInTimeline"> & {
|
|
25
|
+
} & Omit<React.SVGProps<SVGPathElement>, "d" | "height" | "hidden" | "name" | "width"> & Pick<SequenceProps, "durationInFrames" | "freeze" | "from" | "hidden" | "name" | "showInTimeline"> & {
|
|
26
26
|
readonly _experimentalControls?: SequenceControls | undefined;
|
|
27
27
|
} & {
|
|
28
28
|
readonly debug?: boolean | undefined;
|
|
@@ -39,7 +39,7 @@ const react_1 = __importStar(require("react"));
|
|
|
39
39
|
const react_dom_1 = require("react-dom");
|
|
40
40
|
const remotion_1 = require("remotion");
|
|
41
41
|
const does_react_support_canary_1 = require("../utils/does-react-support-canary");
|
|
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
|
+
const RenderSvg = ({ defaultName, documentationLink, width, height, path, style, pathStyle, transformOrigin, debug, effects = [], instructions, pixelDensity, durationInFrames, from, freeze, hidden, name, showInTimeline, _experimentalControls: controls, stack, ...props }) => {
|
|
43
43
|
const actualStyle = (0, react_1.useMemo)(() => {
|
|
44
44
|
return {
|
|
45
45
|
overflow: 'visible',
|
|
@@ -107,6 +107,6 @@ const RenderSvg = ({ defaultName, documentationLink, width, height, path, style,
|
|
|
107
107
|
if (!videoConfig) {
|
|
108
108
|
return svg;
|
|
109
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 }));
|
|
110
|
+
return (jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", from: from, freeze: freeze, 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 }));
|
|
111
111
|
};
|
|
112
112
|
exports.RenderSvg = RenderSvg;
|
|
@@ -42,6 +42,7 @@ exports.enumField = enumField;
|
|
|
42
42
|
const makeShapeSchema = (shapeFields) => {
|
|
43
43
|
return {
|
|
44
44
|
from: remotion_1.Internals.sequenceSchema.from,
|
|
45
|
+
freeze: remotion_1.Internals.sequenceSchema.freeze,
|
|
45
46
|
durationInFrames: remotion_1.Internals.sequenceSchema.durationInFrames,
|
|
46
47
|
...shapeFields,
|
|
47
48
|
fill: (0, exports.colorField)({
|
package/dist/components/star.js
CHANGED
|
@@ -49,6 +49,7 @@ const StarInner = ({ innerRadius, outerRadius, points, cornerRadius, edgeRoundne
|
|
|
49
49
|
};
|
|
50
50
|
exports.Star = remotion_1.Internals.wrapInSchema({
|
|
51
51
|
Component: StarInner,
|
|
52
|
+
componentIdentity: 'dev.remotion.shapes.Star',
|
|
52
53
|
schema: starSchema,
|
|
53
54
|
supportsEffects: true,
|
|
54
55
|
});
|
|
@@ -36,6 +36,7 @@ const TriangleInner = ({ length, direction, edgeRoundness, cornerRadius, ...prop
|
|
|
36
36
|
};
|
|
37
37
|
exports.Triangle = remotion_1.Internals.wrapInSchema({
|
|
38
38
|
Component: TriangleInner,
|
|
39
|
+
componentIdentity: 'dev.remotion.shapes.Triangle',
|
|
39
40
|
schema: triangleSchema,
|
|
40
41
|
supportsEffects: true,
|
|
41
42
|
});
|