@remotion/shapes 4.0.529 → 4.0.531
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/render-svg.d.ts +1 -1
- package/dist/components/render-svg.js +11 -14
- package/dist/esm/index.mjs +10 -14
- package/package.json +4 -4
|
@@ -10,7 +10,7 @@ export type AllShapesProps = Omit<React.SVGProps<SVGPathElement>, 'width' | 'hei
|
|
|
10
10
|
readonly pathStyle?: React.CSSProperties;
|
|
11
11
|
readonly pixelDensity?: HtmlInCanvasPixelDensity;
|
|
12
12
|
};
|
|
13
|
-
export declare const RenderSvg: ({ defaultName, documentationLink, width, height, path, style, pathStyle, transformOrigin, debug, effects, instructions, pixelDensity, durationInFrames, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, trimBefore, playbackRate, freeze, hidden, name, showInTimeline, controls, ...props }: {
|
|
13
|
+
export declare const RenderSvg: ({ defaultName, documentationLink, width, height, path, style, pathStyle, transformOrigin, debug, effects, instructions, pixelDensity, durationInFrames, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, trimBefore, playbackRate, loop, freeze, hidden, name, showInTimeline, controls, ...props }: {
|
|
14
14
|
readonly defaultName: string;
|
|
15
15
|
readonly documentationLink: string;
|
|
16
16
|
readonly width: number;
|
|
@@ -40,10 +40,14 @@ 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
42
|
const HtmlInCanvasWithPrivateProps = remotion_1.HtmlInCanvas;
|
|
43
|
-
const RenderSvgWithTiming = ({ premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, from, trimBefore, playbackRate, freeze, hidden, showInTimeline, controls, durationInFrames, name, defaultName,
|
|
43
|
+
const RenderSvgWithTiming = ({ premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, from, trimBefore, playbackRate, loop, freeze, hidden, showInTimeline, controls, durationInFrames, name, defaultName, documentationLink, memoizedEffectDefinitions, content, actualStyle, }) => {
|
|
44
44
|
const { effectivePremountFor, effectivePostmountFor, freezeFrame, isPremountingOrPostmounting, premountingActive, postmountingActive, premountingStyle, } = remotion_1.Internals.usePremounting({
|
|
45
45
|
from: from !== null && from !== void 0 ? from : 0,
|
|
46
|
-
durationInFrames:
|
|
46
|
+
durationInFrames: remotion_1.Internals.resolveSequenceDuration({
|
|
47
|
+
durationInFrames,
|
|
48
|
+
playbackRate,
|
|
49
|
+
loop,
|
|
50
|
+
}),
|
|
47
51
|
premountFor: premountFor !== null && premountFor !== void 0 ? premountFor : null,
|
|
48
52
|
postmountFor: postmountFor !== null && postmountFor !== void 0 ? postmountFor : null,
|
|
49
53
|
style: actualStyle,
|
|
@@ -51,9 +55,9 @@ const RenderSvgWithTiming = ({ premountFor, postmountFor, styleWhilePremounted,
|
|
|
51
55
|
styleWhilePostmounted: styleWhilePostmounted !== null && styleWhilePostmounted !== void 0 ? styleWhilePostmounted : null,
|
|
52
56
|
hideWhilePremounted: 'opacity',
|
|
53
57
|
});
|
|
54
|
-
return (jsx_runtime_1.jsx(remotion_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", from: from, trimBefore: trimBefore, playbackRate: playbackRate, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : defaultName,
|
|
58
|
+
return (jsx_runtime_1.jsx(remotion_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", from: from, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : defaultName, _remotionInternalDocumentationLink: name === undefined ? documentationLink : undefined, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, children: react_1.default.cloneElement(content, { style: premountingStyle !== null && premountingStyle !== void 0 ? premountingStyle : undefined }) }) }));
|
|
55
59
|
};
|
|
56
|
-
const RenderSvg = ({ defaultName, documentationLink, width, height, path, style, pathStyle, transformOrigin, debug, effects = [], instructions, pixelDensity, durationInFrames, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, trimBefore, playbackRate, freeze, hidden, name, showInTimeline, controls, ...props }) => {
|
|
60
|
+
const RenderSvg = ({ defaultName, documentationLink, width, height, path, style, pathStyle, transformOrigin, debug, effects = [], instructions, pixelDensity, durationInFrames, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, trimBefore, playbackRate, loop, freeze, hidden, name, showInTimeline, controls, ...props }) => {
|
|
57
61
|
const actualStyle = (0, react_1.useMemo)(() => {
|
|
58
62
|
return {
|
|
59
63
|
overflow: 'visible',
|
|
@@ -66,17 +70,10 @@ const RenderSvg = ({ defaultName, documentationLink, width, height, path, style,
|
|
|
66
70
|
...(pathStyle !== null && pathStyle !== void 0 ? pathStyle : {}),
|
|
67
71
|
};
|
|
68
72
|
}, [pathStyle]);
|
|
69
|
-
const outlineRef = (0, react_1.useRef)(null);
|
|
70
|
-
const setSvgRef = (0, react_1.useCallback)((node) => {
|
|
71
|
-
outlineRef.current = node;
|
|
72
|
-
}, []);
|
|
73
|
-
const setCanvasRef = (0, react_1.useCallback)((canvas) => {
|
|
74
|
-
outlineRef.current = canvas;
|
|
75
|
-
}, []);
|
|
76
73
|
const memoizedEffectDefinitions = remotion_1.Internals.useMemoizedEffectDefinitions(effects);
|
|
77
74
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
78
75
|
const reactSupportsTransformOrigin = (0, does_react_support_canary_1.doesReactSupportTransformOriginProperty)(react_dom_1.version);
|
|
79
|
-
const svg = (jsx_runtime_1.jsxs("svg", {
|
|
76
|
+
const svg = (jsx_runtime_1.jsxs("svg", { width: width, height: height, viewBox: `0 0 ${width} ${height}`, xmlns: "http://www.w3.org/2000/svg", style: effects.length === 0 || !videoConfig
|
|
80
77
|
? actualStyle
|
|
81
78
|
: { overflow: 'visible' }, children: [
|
|
82
79
|
jsx_runtime_1.jsx("path", { ...(reactSupportsTransformOrigin
|
|
@@ -116,10 +113,10 @@ const RenderSvg = ({ defaultName, documentationLink, width, height, path, style,
|
|
|
116
113
|
return null;
|
|
117
114
|
})
|
|
118
115
|
: null] }));
|
|
119
|
-
const content = effects.length === 0 ? (svg) : (jsx_runtime_1.jsx(HtmlInCanvasWithPrivateProps, {
|
|
116
|
+
const content = effects.length === 0 ? (svg) : (jsx_runtime_1.jsx(HtmlInCanvasWithPrivateProps, { width: Math.ceil(width), height: Math.ceil(height), effects: effects, pixelDensity: pixelDensity, showInTimeline: false, style: actualStyle, controls: controls, children: svg }));
|
|
120
117
|
if (!videoConfig) {
|
|
121
118
|
return svg;
|
|
122
119
|
}
|
|
123
|
-
return (jsx_runtime_1.jsx(RenderSvgWithTiming, { premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, from: from, trimBefore: trimBefore, playbackRate: playbackRate, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, controls: controls, durationInFrames: durationInFrames, name: name, defaultName: defaultName,
|
|
120
|
+
return (jsx_runtime_1.jsx(RenderSvgWithTiming, { premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, from: from, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, controls: controls, durationInFrames: durationInFrames, name: name, defaultName: defaultName, documentationLink: documentationLink, memoizedEffectDefinitions: memoizedEffectDefinitions, content: content, actualStyle: actualStyle }));
|
|
124
121
|
};
|
|
125
122
|
exports.RenderSvg = RenderSvg;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -140,7 +140,7 @@ var makeArrow = ({
|
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
// src/components/render-svg.tsx
|
|
143
|
-
import React, {
|
|
143
|
+
import React, { useMemo } from "react";
|
|
144
144
|
import { version } from "react-dom";
|
|
145
145
|
import {
|
|
146
146
|
HtmlInCanvas,
|
|
@@ -170,6 +170,7 @@ var RenderSvgWithTiming = ({
|
|
|
170
170
|
from,
|
|
171
171
|
trimBefore,
|
|
172
172
|
playbackRate,
|
|
173
|
+
loop,
|
|
173
174
|
freeze,
|
|
174
175
|
hidden,
|
|
175
176
|
showInTimeline,
|
|
@@ -177,7 +178,6 @@ var RenderSvgWithTiming = ({
|
|
|
177
178
|
durationInFrames,
|
|
178
179
|
name,
|
|
179
180
|
defaultName,
|
|
180
|
-
outlineRef,
|
|
181
181
|
documentationLink,
|
|
182
182
|
memoizedEffectDefinitions,
|
|
183
183
|
content,
|
|
@@ -193,7 +193,11 @@ var RenderSvgWithTiming = ({
|
|
|
193
193
|
premountingStyle
|
|
194
194
|
} = Internals.usePremounting({
|
|
195
195
|
from: from ?? 0,
|
|
196
|
-
durationInFrames:
|
|
196
|
+
durationInFrames: Internals.resolveSequenceDuration({
|
|
197
|
+
durationInFrames,
|
|
198
|
+
playbackRate,
|
|
199
|
+
loop
|
|
200
|
+
}),
|
|
197
201
|
premountFor: premountFor ?? null,
|
|
198
202
|
postmountFor: postmountFor ?? null,
|
|
199
203
|
style: actualStyle,
|
|
@@ -209,6 +213,7 @@ var RenderSvgWithTiming = ({
|
|
|
209
213
|
from,
|
|
210
214
|
trimBefore,
|
|
211
215
|
playbackRate,
|
|
216
|
+
loop,
|
|
212
217
|
freeze,
|
|
213
218
|
hidden,
|
|
214
219
|
showInTimeline,
|
|
@@ -216,7 +221,6 @@ var RenderSvgWithTiming = ({
|
|
|
216
221
|
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
217
222
|
durationInFrames,
|
|
218
223
|
name: name ?? defaultName,
|
|
219
|
-
outlineRef,
|
|
220
224
|
_remotionInternalDocumentationLink: name === undefined ? documentationLink : undefined,
|
|
221
225
|
_remotionInternalPremountDisplay: effectivePremountFor || null,
|
|
222
226
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
@@ -247,6 +251,7 @@ var RenderSvg = ({
|
|
|
247
251
|
styleWhilePostmounted,
|
|
248
252
|
trimBefore,
|
|
249
253
|
playbackRate,
|
|
254
|
+
loop,
|
|
250
255
|
freeze,
|
|
251
256
|
hidden,
|
|
252
257
|
name,
|
|
@@ -266,18 +271,10 @@ var RenderSvg = ({
|
|
|
266
271
|
...pathStyle ?? {}
|
|
267
272
|
};
|
|
268
273
|
}, [pathStyle]);
|
|
269
|
-
const outlineRef = useRef(null);
|
|
270
|
-
const setSvgRef = useCallback((node) => {
|
|
271
|
-
outlineRef.current = node;
|
|
272
|
-
}, []);
|
|
273
|
-
const setCanvasRef = useCallback((canvas) => {
|
|
274
|
-
outlineRef.current = canvas;
|
|
275
|
-
}, []);
|
|
276
274
|
const memoizedEffectDefinitions = Internals.useMemoizedEffectDefinitions(effects);
|
|
277
275
|
const videoConfig = Internals.useUnsafeVideoConfig();
|
|
278
276
|
const reactSupportsTransformOrigin = doesReactSupportTransformOriginProperty(version);
|
|
279
277
|
const svg = /* @__PURE__ */ jsxs("svg", {
|
|
280
|
-
ref: effects.length === 0 || !videoConfig ? setSvgRef : undefined,
|
|
281
278
|
width,
|
|
282
279
|
height,
|
|
283
280
|
viewBox: `0 0 ${width} ${height}`,
|
|
@@ -338,7 +335,6 @@ var RenderSvg = ({
|
|
|
338
335
|
]
|
|
339
336
|
});
|
|
340
337
|
const content = effects.length === 0 ? svg : /* @__PURE__ */ jsx(HtmlInCanvasWithPrivateProps, {
|
|
341
|
-
ref: setCanvasRef,
|
|
342
338
|
width: Math.ceil(width),
|
|
343
339
|
height: Math.ceil(height),
|
|
344
340
|
effects,
|
|
@@ -359,6 +355,7 @@ var RenderSvg = ({
|
|
|
359
355
|
from,
|
|
360
356
|
trimBefore,
|
|
361
357
|
playbackRate,
|
|
358
|
+
loop,
|
|
362
359
|
freeze,
|
|
363
360
|
hidden,
|
|
364
361
|
showInTimeline,
|
|
@@ -366,7 +363,6 @@ var RenderSvg = ({
|
|
|
366
363
|
durationInFrames,
|
|
367
364
|
name,
|
|
368
365
|
defaultName,
|
|
369
|
-
outlineRef,
|
|
370
366
|
documentationLink,
|
|
371
367
|
memoizedEffectDefinitions,
|
|
372
368
|
content,
|
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.531",
|
|
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.531",
|
|
38
38
|
"eslint": "9.19.0",
|
|
39
39
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
40
40
|
},
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"react-dom": ">=16.8.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@remotion/paths": "4.0.
|
|
55
|
-
"remotion": "4.0.
|
|
54
|
+
"@remotion/paths": "4.0.531",
|
|
55
|
+
"remotion": "4.0.531"
|
|
56
56
|
},
|
|
57
57
|
"homepage": "https://www.remotion.dev/docs/shapes"
|
|
58
58
|
}
|