@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.
- package/dist/components/arrow.d.ts +0 -10
- package/dist/components/arrow.js +42 -3
- package/dist/components/circle.d.ts +0 -5
- package/dist/components/circle.js +17 -3
- package/dist/components/ellipse.d.ts +0 -6
- package/dist/components/ellipse.js +22 -3
- package/dist/components/heart.d.ts +0 -5
- package/dist/components/heart.js +33 -3
- package/dist/components/pie.d.ts +0 -9
- package/dist/components/pie.js +37 -3
- package/dist/components/polygon.js +28 -3
- package/dist/components/rect.d.ts +0 -8
- package/dist/components/rect.js +27 -3
- package/dist/components/render-svg.d.ts +24 -3
- package/dist/components/render-svg.js +20 -2
- package/dist/components/schema.d.ts +23 -0
- package/dist/components/schema.js +55 -0
- package/dist/components/star.d.ts +0 -9
- package/dist/components/star.js +33 -3
- package/dist/components/triangle.d.ts +0 -8
- package/dist/components/triangle.js +27 -3
- package/dist/esm/index.mjs +410 -12
- package/package.json +4 -3
|
@@ -2,12 +2,4 @@ import React from 'react';
|
|
|
2
2
|
import type { MakeTriangleProps } from '../utils/make-triangle';
|
|
3
3
|
import type { AllShapesProps } from './render-svg';
|
|
4
4
|
export type TriangleProps = MakeTriangleProps & AllShapesProps;
|
|
5
|
-
/**
|
|
6
|
-
* @description Renders an SVG element containing a triangle with same length on all sides.
|
|
7
|
-
* @param {Number} length The length of one triangle side.
|
|
8
|
-
* @param {string} direction The direction of the triangle
|
|
9
|
-
* @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
|
|
10
|
-
* @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
|
|
11
|
-
* @see [Documentation](https://www.remotion.dev/docs/shapes/triangle)
|
|
12
|
-
*/
|
|
13
5
|
export declare const Triangle: React.FC<TriangleProps>;
|
|
@@ -2,8 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Triangle = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
5
6
|
const make_triangle_1 = require("../utils/make-triangle");
|
|
6
7
|
const render_svg_1 = require("./render-svg");
|
|
8
|
+
const schema_1 = require("./schema");
|
|
9
|
+
const triangleSchema = (0, schema_1.makeShapeSchema)({
|
|
10
|
+
length: (0, schema_1.numberField)({
|
|
11
|
+
defaultValue: 100,
|
|
12
|
+
description: 'Length',
|
|
13
|
+
min: 0,
|
|
14
|
+
}),
|
|
15
|
+
direction: (0, schema_1.enumField)({
|
|
16
|
+
defaultValue: 'right',
|
|
17
|
+
description: 'Direction',
|
|
18
|
+
variants: ['right', 'left', 'up', 'down'],
|
|
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 triangle with same length on all sides.
|
|
9
28
|
* @param {Number} length The length of one triangle side.
|
|
@@ -12,7 +31,12 @@ const render_svg_1 = require("./render-svg");
|
|
|
12
31
|
* @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
|
|
13
32
|
* @see [Documentation](https://www.remotion.dev/docs/shapes/triangle)
|
|
14
33
|
*/
|
|
15
|
-
const
|
|
16
|
-
return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { ...(0, make_triangle_1.makeTriangle)({ length, direction, edgeRoundness, cornerRadius }), ...props }));
|
|
34
|
+
const TriangleInner = ({ length, direction, edgeRoundness, cornerRadius, ...props }) => {
|
|
35
|
+
return (jsx_runtime_1.jsx(render_svg_1.RenderSvg, { defaultName: "<Triangle>", documentationLink: "https://www.remotion.dev/docs/shapes/triangle", ...(0, make_triangle_1.makeTriangle)({ length, direction, edgeRoundness, cornerRadius }), ...props }));
|
|
17
36
|
};
|
|
18
|
-
exports.Triangle =
|
|
37
|
+
exports.Triangle = remotion_1.Internals.wrapInSchema({
|
|
38
|
+
Component: TriangleInner,
|
|
39
|
+
schema: triangleSchema,
|
|
40
|
+
supportsEffects: true,
|
|
41
|
+
});
|
|
42
|
+
remotion_1.Internals.addSequenceStackTraces(exports.Triangle);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/components/arrow.tsx
|
|
2
|
+
import { Internals as Internals3 } from "remotion";
|
|
3
|
+
|
|
1
4
|
// src/utils/make-arrow.ts
|
|
2
5
|
import { serializeInstructions } from "@remotion/paths";
|
|
3
6
|
var unitDir = (from, to) => {
|
|
@@ -137,8 +140,13 @@ var makeArrow = ({
|
|
|
137
140
|
};
|
|
138
141
|
|
|
139
142
|
// src/components/render-svg.tsx
|
|
140
|
-
import React, { useMemo } from "react";
|
|
143
|
+
import React, { useCallback, useMemo, useRef } from "react";
|
|
141
144
|
import { version } from "react-dom";
|
|
145
|
+
import {
|
|
146
|
+
HtmlInCanvas,
|
|
147
|
+
Internals,
|
|
148
|
+
Sequence
|
|
149
|
+
} from "remotion";
|
|
142
150
|
|
|
143
151
|
// src/utils/does-react-support-canary.ts
|
|
144
152
|
var doesReactSupportTransformOriginProperty = (version) => {
|
|
@@ -153,6 +161,8 @@ var doesReactSupportTransformOriginProperty = (version) => {
|
|
|
153
161
|
// src/components/render-svg.tsx
|
|
154
162
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
155
163
|
var RenderSvg = ({
|
|
164
|
+
defaultName,
|
|
165
|
+
documentationLink,
|
|
156
166
|
width,
|
|
157
167
|
height,
|
|
158
168
|
path,
|
|
@@ -160,7 +170,16 @@ var RenderSvg = ({
|
|
|
160
170
|
pathStyle,
|
|
161
171
|
transformOrigin,
|
|
162
172
|
debug,
|
|
173
|
+
effects = [],
|
|
163
174
|
instructions,
|
|
175
|
+
pixelDensity,
|
|
176
|
+
durationInFrames,
|
|
177
|
+
from,
|
|
178
|
+
hidden,
|
|
179
|
+
name,
|
|
180
|
+
showInTimeline,
|
|
181
|
+
_experimentalControls: controls,
|
|
182
|
+
stack,
|
|
164
183
|
...props
|
|
165
184
|
}) => {
|
|
166
185
|
const actualStyle = useMemo(() => {
|
|
@@ -175,13 +194,23 @@ var RenderSvg = ({
|
|
|
175
194
|
...pathStyle ?? {}
|
|
176
195
|
};
|
|
177
196
|
}, [pathStyle]);
|
|
197
|
+
const outlineRef = useRef(null);
|
|
198
|
+
const setSvgRef = useCallback((node) => {
|
|
199
|
+
outlineRef.current = node;
|
|
200
|
+
}, []);
|
|
201
|
+
const setCanvasRef = useCallback((canvas) => {
|
|
202
|
+
outlineRef.current = canvas;
|
|
203
|
+
}, []);
|
|
204
|
+
const memoizedEffectDefinitions = Internals.useMemoizedEffectDefinitions(effects);
|
|
205
|
+
const videoConfig = Internals.useUnsafeVideoConfig();
|
|
178
206
|
const reactSupportsTransformOrigin = doesReactSupportTransformOriginProperty(version);
|
|
179
|
-
|
|
207
|
+
const svg = /* @__PURE__ */ jsxs("svg", {
|
|
208
|
+
ref: effects.length === 0 || !videoConfig ? setSvgRef : undefined,
|
|
180
209
|
width,
|
|
181
210
|
height,
|
|
182
211
|
viewBox: `0 0 ${width} ${height}`,
|
|
183
212
|
xmlns: "http://www.w3.org/2000/svg",
|
|
184
|
-
style: actualStyle,
|
|
213
|
+
style: effects.length === 0 || !videoConfig ? actualStyle : { overflow: "visible" },
|
|
185
214
|
children: [
|
|
186
215
|
/* @__PURE__ */ jsx("path", {
|
|
187
216
|
...reactSupportsTransformOrigin ? {
|
|
@@ -236,11 +265,140 @@ var RenderSvg = ({
|
|
|
236
265
|
}) : null
|
|
237
266
|
]
|
|
238
267
|
});
|
|
268
|
+
const content = effects.length === 0 ? svg : /* @__PURE__ */ jsx(HtmlInCanvas, {
|
|
269
|
+
ref: setCanvasRef,
|
|
270
|
+
width: Math.ceil(width),
|
|
271
|
+
height: Math.ceil(height),
|
|
272
|
+
effects,
|
|
273
|
+
pixelDensity,
|
|
274
|
+
showInTimeline: false,
|
|
275
|
+
style: actualStyle,
|
|
276
|
+
_experimentalControls: controls,
|
|
277
|
+
children: svg
|
|
278
|
+
});
|
|
279
|
+
const stackProps = stack === undefined ? null : { stack };
|
|
280
|
+
if (!videoConfig) {
|
|
281
|
+
return svg;
|
|
282
|
+
}
|
|
283
|
+
return /* @__PURE__ */ jsx(Sequence, {
|
|
284
|
+
layout: "none",
|
|
285
|
+
from,
|
|
286
|
+
hidden,
|
|
287
|
+
showInTimeline,
|
|
288
|
+
_experimentalControls: controls,
|
|
289
|
+
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
290
|
+
durationInFrames,
|
|
291
|
+
name: name ?? defaultName,
|
|
292
|
+
_remotionInternalRefForOutline: outlineRef,
|
|
293
|
+
_remotionInternalDocumentationLink: name === undefined ? documentationLink : undefined,
|
|
294
|
+
...stackProps,
|
|
295
|
+
children: content
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
// src/components/schema.ts
|
|
300
|
+
import {
|
|
301
|
+
Internals as Internals2
|
|
302
|
+
} from "remotion";
|
|
303
|
+
var numberField = ({
|
|
304
|
+
defaultValue,
|
|
305
|
+
description,
|
|
306
|
+
hiddenFromList = false,
|
|
307
|
+
max,
|
|
308
|
+
min,
|
|
309
|
+
step = 1
|
|
310
|
+
}) => {
|
|
311
|
+
return {
|
|
312
|
+
type: "number",
|
|
313
|
+
default: defaultValue,
|
|
314
|
+
description,
|
|
315
|
+
hiddenFromList,
|
|
316
|
+
max,
|
|
317
|
+
min,
|
|
318
|
+
step
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
var booleanField = ({
|
|
322
|
+
defaultValue,
|
|
323
|
+
description
|
|
324
|
+
}) => {
|
|
325
|
+
return {
|
|
326
|
+
type: "boolean",
|
|
327
|
+
default: defaultValue,
|
|
328
|
+
description
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
var colorField = ({
|
|
332
|
+
defaultValue,
|
|
333
|
+
description
|
|
334
|
+
}) => {
|
|
335
|
+
return {
|
|
336
|
+
type: "color",
|
|
337
|
+
default: defaultValue,
|
|
338
|
+
description
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
var enumField = ({
|
|
342
|
+
defaultValue,
|
|
343
|
+
description,
|
|
344
|
+
variants
|
|
345
|
+
}) => {
|
|
346
|
+
return {
|
|
347
|
+
type: "enum",
|
|
348
|
+
default: defaultValue,
|
|
349
|
+
description,
|
|
350
|
+
variants: Object.fromEntries(variants.map((variant) => [variant, {}]))
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
var makeShapeSchema = (shapeFields) => {
|
|
354
|
+
return {
|
|
355
|
+
from: Internals2.sequenceSchema.from,
|
|
356
|
+
durationInFrames: Internals2.sequenceSchema.durationInFrames,
|
|
357
|
+
...shapeFields,
|
|
358
|
+
fill: colorField({
|
|
359
|
+
defaultValue: "#0b84ff",
|
|
360
|
+
description: "Fill"
|
|
361
|
+
}),
|
|
362
|
+
...Internals2.sequenceVisualStyleSchema,
|
|
363
|
+
hidden: Internals2.sequenceSchema.hidden
|
|
364
|
+
};
|
|
239
365
|
};
|
|
240
366
|
|
|
241
367
|
// src/components/arrow.tsx
|
|
242
368
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
243
|
-
var
|
|
369
|
+
var arrowSchema = makeShapeSchema({
|
|
370
|
+
length: numberField({
|
|
371
|
+
defaultValue: 300,
|
|
372
|
+
description: "Length",
|
|
373
|
+
min: 0
|
|
374
|
+
}),
|
|
375
|
+
headWidth: numberField({
|
|
376
|
+
defaultValue: 185,
|
|
377
|
+
description: "Head Width",
|
|
378
|
+
min: 0
|
|
379
|
+
}),
|
|
380
|
+
headLength: numberField({
|
|
381
|
+
defaultValue: 120,
|
|
382
|
+
description: "Head Length",
|
|
383
|
+
min: 0
|
|
384
|
+
}),
|
|
385
|
+
shaftWidth: numberField({
|
|
386
|
+
defaultValue: 80,
|
|
387
|
+
description: "Shaft Width",
|
|
388
|
+
min: 0
|
|
389
|
+
}),
|
|
390
|
+
direction: enumField({
|
|
391
|
+
defaultValue: "right",
|
|
392
|
+
description: "Direction",
|
|
393
|
+
variants: ["right", "left", "up", "down"]
|
|
394
|
+
}),
|
|
395
|
+
cornerRadius: numberField({
|
|
396
|
+
defaultValue: 0,
|
|
397
|
+
description: "Corner Radius",
|
|
398
|
+
min: 0
|
|
399
|
+
})
|
|
400
|
+
});
|
|
401
|
+
var ArrowInner = ({
|
|
244
402
|
length,
|
|
245
403
|
headWidth,
|
|
246
404
|
headLength,
|
|
@@ -250,6 +408,8 @@ var Arrow = ({
|
|
|
250
408
|
...props
|
|
251
409
|
}) => {
|
|
252
410
|
return /* @__PURE__ */ jsx2(RenderSvg, {
|
|
411
|
+
defaultName: "<Arrow>",
|
|
412
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/arrow",
|
|
253
413
|
...makeArrow({
|
|
254
414
|
length,
|
|
255
415
|
headWidth,
|
|
@@ -261,6 +421,15 @@ var Arrow = ({
|
|
|
261
421
|
...props
|
|
262
422
|
});
|
|
263
423
|
};
|
|
424
|
+
var Arrow = Internals3.wrapInSchema({
|
|
425
|
+
Component: ArrowInner,
|
|
426
|
+
schema: arrowSchema,
|
|
427
|
+
supportsEffects: true
|
|
428
|
+
});
|
|
429
|
+
Internals3.addSequenceStackTraces(Arrow);
|
|
430
|
+
// src/components/circle.tsx
|
|
431
|
+
import { Internals as Internals4 } from "remotion";
|
|
432
|
+
|
|
264
433
|
// src/utils/make-circle.ts
|
|
265
434
|
import { serializeInstructions as serializeInstructions2 } from "@remotion/paths";
|
|
266
435
|
var makeCircle = ({ radius }) => {
|
|
@@ -306,12 +475,30 @@ var makeCircle = ({ radius }) => {
|
|
|
306
475
|
|
|
307
476
|
// src/components/circle.tsx
|
|
308
477
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
309
|
-
var
|
|
478
|
+
var circleSchema = makeShapeSchema({
|
|
479
|
+
radius: numberField({
|
|
480
|
+
defaultValue: 100,
|
|
481
|
+
description: "Radius",
|
|
482
|
+
min: 0
|
|
483
|
+
})
|
|
484
|
+
});
|
|
485
|
+
var CircleInner = ({ radius, ...props }) => {
|
|
310
486
|
return /* @__PURE__ */ jsx3(RenderSvg, {
|
|
487
|
+
defaultName: "<Circle>",
|
|
488
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/circle",
|
|
311
489
|
...makeCircle({ radius }),
|
|
312
490
|
...props
|
|
313
491
|
});
|
|
314
492
|
};
|
|
493
|
+
var Circle = Internals4.wrapInSchema({
|
|
494
|
+
Component: CircleInner,
|
|
495
|
+
schema: circleSchema,
|
|
496
|
+
supportsEffects: true
|
|
497
|
+
});
|
|
498
|
+
Internals4.addSequenceStackTraces(Circle);
|
|
499
|
+
// src/components/ellipse.tsx
|
|
500
|
+
import { Internals as Internals5 } from "remotion";
|
|
501
|
+
|
|
315
502
|
// src/utils/make-ellipse.ts
|
|
316
503
|
import { serializeInstructions as serializeInstructions3 } from "@remotion/paths";
|
|
317
504
|
var makeEllipse = ({ rx, ry }) => {
|
|
@@ -347,12 +534,35 @@ var makeEllipse = ({ rx, ry }) => {
|
|
|
347
534
|
|
|
348
535
|
// src/components/ellipse.tsx
|
|
349
536
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
350
|
-
var
|
|
537
|
+
var ellipseSchema = makeShapeSchema({
|
|
538
|
+
rx: numberField({
|
|
539
|
+
defaultValue: 100,
|
|
540
|
+
description: "X Radius",
|
|
541
|
+
min: 0
|
|
542
|
+
}),
|
|
543
|
+
ry: numberField({
|
|
544
|
+
defaultValue: 50,
|
|
545
|
+
description: "Y Radius",
|
|
546
|
+
min: 0
|
|
547
|
+
})
|
|
548
|
+
});
|
|
549
|
+
var EllipseInner = ({ rx, ry, ...props }) => {
|
|
351
550
|
return /* @__PURE__ */ jsx4(RenderSvg, {
|
|
551
|
+
defaultName: "<Ellipse>",
|
|
552
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/ellipse",
|
|
352
553
|
...makeEllipse({ rx, ry }),
|
|
353
554
|
...props
|
|
354
555
|
});
|
|
355
556
|
};
|
|
557
|
+
var Ellipse = Internals5.wrapInSchema({
|
|
558
|
+
Component: EllipseInner,
|
|
559
|
+
schema: ellipseSchema,
|
|
560
|
+
supportsEffects: true
|
|
561
|
+
});
|
|
562
|
+
Internals5.addSequenceStackTraces(Ellipse);
|
|
563
|
+
// src/components/heart.tsx
|
|
564
|
+
import { Internals as Internals6 } from "remotion";
|
|
565
|
+
|
|
356
566
|
// src/utils/make-heart.ts
|
|
357
567
|
import { serializeInstructions as serializeInstructions4 } from "@remotion/paths";
|
|
358
568
|
var makeHeart = ({
|
|
@@ -447,7 +657,30 @@ var makeHeart = ({
|
|
|
447
657
|
|
|
448
658
|
// src/components/heart.tsx
|
|
449
659
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
450
|
-
var
|
|
660
|
+
var heartSchema = makeShapeSchema({
|
|
661
|
+
height: numberField({
|
|
662
|
+
defaultValue: 100,
|
|
663
|
+
description: "Height",
|
|
664
|
+
min: 0
|
|
665
|
+
}),
|
|
666
|
+
aspectRatio: numberField({
|
|
667
|
+
defaultValue: 1.1,
|
|
668
|
+
description: "Aspect Ratio",
|
|
669
|
+
min: 0,
|
|
670
|
+
step: 0.01
|
|
671
|
+
}),
|
|
672
|
+
bottomRoundnessAdjustment: numberField({
|
|
673
|
+
defaultValue: 0,
|
|
674
|
+
description: "Bottom Roundness Adjustment",
|
|
675
|
+
step: 0.01
|
|
676
|
+
}),
|
|
677
|
+
depthAdjustment: numberField({
|
|
678
|
+
defaultValue: 0,
|
|
679
|
+
description: "Depth Adjustment",
|
|
680
|
+
step: 0.01
|
|
681
|
+
})
|
|
682
|
+
});
|
|
683
|
+
var HeartInner = ({
|
|
451
684
|
aspectRatio,
|
|
452
685
|
height,
|
|
453
686
|
bottomRoundnessAdjustment = 0,
|
|
@@ -455,6 +688,8 @@ var Heart = ({
|
|
|
455
688
|
...props
|
|
456
689
|
}) => {
|
|
457
690
|
return /* @__PURE__ */ jsx5(RenderSvg, {
|
|
691
|
+
defaultName: "<Heart>",
|
|
692
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/heart",
|
|
458
693
|
...makeHeart({
|
|
459
694
|
aspectRatio,
|
|
460
695
|
height,
|
|
@@ -464,6 +699,15 @@ var Heart = ({
|
|
|
464
699
|
...props
|
|
465
700
|
});
|
|
466
701
|
};
|
|
702
|
+
var Heart = Internals6.wrapInSchema({
|
|
703
|
+
Component: HeartInner,
|
|
704
|
+
schema: heartSchema,
|
|
705
|
+
supportsEffects: true
|
|
706
|
+
});
|
|
707
|
+
Internals6.addSequenceStackTraces(Heart);
|
|
708
|
+
// src/components/pie.tsx
|
|
709
|
+
import { Internals as Internals7 } from "remotion";
|
|
710
|
+
|
|
467
711
|
// src/utils/make-pie.ts
|
|
468
712
|
import { serializeInstructions as serializeInstructions5 } from "@remotion/paths";
|
|
469
713
|
var getCoord = ({
|
|
@@ -574,7 +818,34 @@ var makePie = ({
|
|
|
574
818
|
|
|
575
819
|
// src/components/pie.tsx
|
|
576
820
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
577
|
-
var
|
|
821
|
+
var pieSchema = makeShapeSchema({
|
|
822
|
+
radius: numberField({
|
|
823
|
+
defaultValue: 100,
|
|
824
|
+
description: "Radius",
|
|
825
|
+
min: 0
|
|
826
|
+
}),
|
|
827
|
+
progress: numberField({
|
|
828
|
+
defaultValue: 0.5,
|
|
829
|
+
description: "Progress",
|
|
830
|
+
max: 1,
|
|
831
|
+
min: 0,
|
|
832
|
+
step: 0.01
|
|
833
|
+
}),
|
|
834
|
+
closePath: booleanField({
|
|
835
|
+
defaultValue: true,
|
|
836
|
+
description: "Close Path"
|
|
837
|
+
}),
|
|
838
|
+
counterClockwise: booleanField({
|
|
839
|
+
defaultValue: false,
|
|
840
|
+
description: "Counter Clockwise"
|
|
841
|
+
}),
|
|
842
|
+
rotation: numberField({
|
|
843
|
+
defaultValue: 0,
|
|
844
|
+
description: "Rotation",
|
|
845
|
+
step: 0.01
|
|
846
|
+
})
|
|
847
|
+
});
|
|
848
|
+
var PieInner = ({
|
|
578
849
|
radius,
|
|
579
850
|
progress,
|
|
580
851
|
closePath,
|
|
@@ -583,10 +854,21 @@ var Pie = ({
|
|
|
583
854
|
...props
|
|
584
855
|
}) => {
|
|
585
856
|
return /* @__PURE__ */ jsx6(RenderSvg, {
|
|
857
|
+
defaultName: "<Pie>",
|
|
858
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/pie",
|
|
586
859
|
...makePie({ radius, progress, closePath, counterClockwise, rotation }),
|
|
587
860
|
...props
|
|
588
861
|
});
|
|
589
862
|
};
|
|
863
|
+
var Pie = Internals7.wrapInSchema({
|
|
864
|
+
Component: PieInner,
|
|
865
|
+
schema: pieSchema,
|
|
866
|
+
supportsEffects: true
|
|
867
|
+
});
|
|
868
|
+
Internals7.addSequenceStackTraces(Pie);
|
|
869
|
+
// src/components/polygon.tsx
|
|
870
|
+
import { Internals as Internals8 } from "remotion";
|
|
871
|
+
|
|
590
872
|
// src/utils/make-polygon.ts
|
|
591
873
|
import {
|
|
592
874
|
PathInternals,
|
|
@@ -780,7 +1062,25 @@ var makePolygon = ({
|
|
|
780
1062
|
|
|
781
1063
|
// src/components/polygon.tsx
|
|
782
1064
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
783
|
-
var
|
|
1065
|
+
var polygonSchema = makeShapeSchema({
|
|
1066
|
+
points: numberField({
|
|
1067
|
+
defaultValue: 5,
|
|
1068
|
+
description: "Points",
|
|
1069
|
+
min: 3,
|
|
1070
|
+
step: 1
|
|
1071
|
+
}),
|
|
1072
|
+
radius: numberField({
|
|
1073
|
+
defaultValue: 100,
|
|
1074
|
+
description: "Radius",
|
|
1075
|
+
min: 0
|
|
1076
|
+
}),
|
|
1077
|
+
cornerRadius: numberField({
|
|
1078
|
+
defaultValue: 0,
|
|
1079
|
+
description: "Corner Radius",
|
|
1080
|
+
min: 0
|
|
1081
|
+
})
|
|
1082
|
+
});
|
|
1083
|
+
var PolygonInner = ({
|
|
784
1084
|
points,
|
|
785
1085
|
radius,
|
|
786
1086
|
cornerRadius,
|
|
@@ -788,6 +1088,8 @@ var Polygon = ({
|
|
|
788
1088
|
...props
|
|
789
1089
|
}) => {
|
|
790
1090
|
return /* @__PURE__ */ jsx7(RenderSvg, {
|
|
1091
|
+
defaultName: "<Polygon>",
|
|
1092
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/polygon",
|
|
791
1093
|
...makePolygon({
|
|
792
1094
|
points,
|
|
793
1095
|
cornerRadius,
|
|
@@ -797,6 +1099,15 @@ var Polygon = ({
|
|
|
797
1099
|
...props
|
|
798
1100
|
});
|
|
799
1101
|
};
|
|
1102
|
+
var Polygon = Internals8.wrapInSchema({
|
|
1103
|
+
Component: PolygonInner,
|
|
1104
|
+
schema: polygonSchema,
|
|
1105
|
+
supportsEffects: true
|
|
1106
|
+
});
|
|
1107
|
+
Internals8.addSequenceStackTraces(Polygon);
|
|
1108
|
+
// src/components/rect.tsx
|
|
1109
|
+
import { Internals as Internals9 } from "remotion";
|
|
1110
|
+
|
|
800
1111
|
// src/utils/make-rect.ts
|
|
801
1112
|
import { serializeInstructions as serializeInstructions7 } from "@remotion/paths";
|
|
802
1113
|
var makeRect = ({
|
|
@@ -830,7 +1141,24 @@ var makeRect = ({
|
|
|
830
1141
|
|
|
831
1142
|
// src/components/rect.tsx
|
|
832
1143
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
833
|
-
var
|
|
1144
|
+
var rectSchema = makeShapeSchema({
|
|
1145
|
+
width: numberField({
|
|
1146
|
+
defaultValue: 100,
|
|
1147
|
+
description: "Width",
|
|
1148
|
+
min: 0
|
|
1149
|
+
}),
|
|
1150
|
+
height: numberField({
|
|
1151
|
+
defaultValue: 100,
|
|
1152
|
+
description: "Height",
|
|
1153
|
+
min: 0
|
|
1154
|
+
}),
|
|
1155
|
+
cornerRadius: numberField({
|
|
1156
|
+
defaultValue: 0,
|
|
1157
|
+
description: "Corner Radius",
|
|
1158
|
+
min: 0
|
|
1159
|
+
})
|
|
1160
|
+
});
|
|
1161
|
+
var RectInner = ({
|
|
834
1162
|
width,
|
|
835
1163
|
edgeRoundness,
|
|
836
1164
|
height,
|
|
@@ -838,10 +1166,21 @@ var Rect = ({
|
|
|
838
1166
|
...props
|
|
839
1167
|
}) => {
|
|
840
1168
|
return /* @__PURE__ */ jsx8(RenderSvg, {
|
|
1169
|
+
defaultName: "<Rect>",
|
|
1170
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/rect",
|
|
841
1171
|
...makeRect({ height, width, edgeRoundness, cornerRadius }),
|
|
842
1172
|
...props
|
|
843
1173
|
});
|
|
844
1174
|
};
|
|
1175
|
+
var Rect = Internals9.wrapInSchema({
|
|
1176
|
+
Component: RectInner,
|
|
1177
|
+
schema: rectSchema,
|
|
1178
|
+
supportsEffects: true
|
|
1179
|
+
});
|
|
1180
|
+
Internals9.addSequenceStackTraces(Rect);
|
|
1181
|
+
// src/components/star.tsx
|
|
1182
|
+
import { Internals as Internals10 } from "remotion";
|
|
1183
|
+
|
|
845
1184
|
// src/utils/make-star.ts
|
|
846
1185
|
import {
|
|
847
1186
|
PathInternals as PathInternals2,
|
|
@@ -911,7 +1250,30 @@ var makeStar = ({
|
|
|
911
1250
|
|
|
912
1251
|
// src/components/star.tsx
|
|
913
1252
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
914
|
-
var
|
|
1253
|
+
var starSchema = makeShapeSchema({
|
|
1254
|
+
points: numberField({
|
|
1255
|
+
defaultValue: 5,
|
|
1256
|
+
description: "Points",
|
|
1257
|
+
min: 3,
|
|
1258
|
+
step: 1
|
|
1259
|
+
}),
|
|
1260
|
+
innerRadius: numberField({
|
|
1261
|
+
defaultValue: 50,
|
|
1262
|
+
description: "Inner Radius",
|
|
1263
|
+
min: 0
|
|
1264
|
+
}),
|
|
1265
|
+
outerRadius: numberField({
|
|
1266
|
+
defaultValue: 100,
|
|
1267
|
+
description: "Outer Radius",
|
|
1268
|
+
min: 0
|
|
1269
|
+
}),
|
|
1270
|
+
cornerRadius: numberField({
|
|
1271
|
+
defaultValue: 0,
|
|
1272
|
+
description: "Corner Radius",
|
|
1273
|
+
min: 0
|
|
1274
|
+
})
|
|
1275
|
+
});
|
|
1276
|
+
var StarInner = ({
|
|
915
1277
|
innerRadius,
|
|
916
1278
|
outerRadius,
|
|
917
1279
|
points,
|
|
@@ -920,6 +1282,8 @@ var Star = ({
|
|
|
920
1282
|
...props
|
|
921
1283
|
}) => {
|
|
922
1284
|
return /* @__PURE__ */ jsx9(RenderSvg, {
|
|
1285
|
+
defaultName: "<Star>",
|
|
1286
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/star",
|
|
923
1287
|
...makeStar({
|
|
924
1288
|
innerRadius,
|
|
925
1289
|
outerRadius,
|
|
@@ -930,6 +1294,15 @@ var Star = ({
|
|
|
930
1294
|
...props
|
|
931
1295
|
});
|
|
932
1296
|
};
|
|
1297
|
+
var Star = Internals10.wrapInSchema({
|
|
1298
|
+
Component: StarInner,
|
|
1299
|
+
schema: starSchema,
|
|
1300
|
+
supportsEffects: true
|
|
1301
|
+
});
|
|
1302
|
+
Internals10.addSequenceStackTraces(Star);
|
|
1303
|
+
// src/components/triangle.tsx
|
|
1304
|
+
import { Internals as Internals11 } from "remotion";
|
|
1305
|
+
|
|
933
1306
|
// src/utils/make-triangle.ts
|
|
934
1307
|
import { serializeInstructions as serializeInstructions9 } from "@remotion/paths";
|
|
935
1308
|
var makeTriangle = ({
|
|
@@ -1003,7 +1376,24 @@ var makeTriangle = ({
|
|
|
1003
1376
|
|
|
1004
1377
|
// src/components/triangle.tsx
|
|
1005
1378
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1006
|
-
var
|
|
1379
|
+
var triangleSchema = makeShapeSchema({
|
|
1380
|
+
length: numberField({
|
|
1381
|
+
defaultValue: 100,
|
|
1382
|
+
description: "Length",
|
|
1383
|
+
min: 0
|
|
1384
|
+
}),
|
|
1385
|
+
direction: enumField({
|
|
1386
|
+
defaultValue: "right",
|
|
1387
|
+
description: "Direction",
|
|
1388
|
+
variants: ["right", "left", "up", "down"]
|
|
1389
|
+
}),
|
|
1390
|
+
cornerRadius: numberField({
|
|
1391
|
+
defaultValue: 0,
|
|
1392
|
+
description: "Corner Radius",
|
|
1393
|
+
min: 0
|
|
1394
|
+
})
|
|
1395
|
+
});
|
|
1396
|
+
var TriangleInner = ({
|
|
1007
1397
|
length,
|
|
1008
1398
|
direction,
|
|
1009
1399
|
edgeRoundness,
|
|
@@ -1011,10 +1401,18 @@ var Triangle = ({
|
|
|
1011
1401
|
...props
|
|
1012
1402
|
}) => {
|
|
1013
1403
|
return /* @__PURE__ */ jsx10(RenderSvg, {
|
|
1404
|
+
defaultName: "<Triangle>",
|
|
1405
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/triangle",
|
|
1014
1406
|
...makeTriangle({ length, direction, edgeRoundness, cornerRadius }),
|
|
1015
1407
|
...props
|
|
1016
1408
|
});
|
|
1017
1409
|
};
|
|
1410
|
+
var Triangle = Internals11.wrapInSchema({
|
|
1411
|
+
Component: TriangleInner,
|
|
1412
|
+
schema: triangleSchema,
|
|
1413
|
+
supportsEffects: true
|
|
1414
|
+
});
|
|
1415
|
+
Internals11.addSequenceStackTraces(Triangle);
|
|
1018
1416
|
export {
|
|
1019
1417
|
makeTriangle,
|
|
1020
1418
|
makeStar,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/shapes"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/shapes",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.474",
|
|
7
7
|
"description": "Generate SVG shapes",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"react": "19.2.3",
|
|
35
35
|
"react-dom": "19.2.3",
|
|
36
36
|
"@happy-dom/global-registrator": "14.5.1",
|
|
37
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
37
|
+
"@remotion/eslint-config-internal": "4.0.474",
|
|
38
38
|
"eslint": "9.19.0",
|
|
39
39
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
40
40
|
},
|
|
@@ -51,7 +51,8 @@
|
|
|
51
51
|
"react-dom": ">=16.8.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@remotion/paths": "4.0.
|
|
54
|
+
"@remotion/paths": "4.0.474",
|
|
55
|
+
"remotion": "4.0.474"
|
|
55
56
|
},
|
|
56
57
|
"homepage": "https://www.remotion.dev/docs/shapes"
|
|
57
58
|
}
|