@remotion/shapes 4.0.527 → 4.0.529

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.
@@ -12,6 +12,7 @@ const polygonSchema = (0, schema_1.makeShapeSchema)({
12
12
  description: 'Points',
13
13
  min: 3,
14
14
  step: 1,
15
+ integer: true,
15
16
  }),
16
17
  radius: (0, schema_1.numberField)({
17
18
  defaultValue: 100,
@@ -1,7 +1,7 @@
1
1
  import type { Instruction } from '@remotion/paths';
2
2
  import React from 'react';
3
- import { type EffectsProp, type HtmlInCanvasPixelDensity, type InteractiveBaseProps, type SequenceControls } from 'remotion';
4
- type ShapeSequenceProps = InteractiveBaseProps & {
3
+ import { type EffectsProp, type HtmlInCanvasPixelDensity, type InteractiveBaseProps, type InteractivePremountProps, type SequenceControls } from 'remotion';
4
+ type ShapeSequenceProps = InteractiveBaseProps & InteractivePremountProps & {
5
5
  readonly controls?: SequenceControls;
6
6
  };
7
7
  export type AllShapesProps = Omit<React.SVGProps<SVGPathElement>, 'width' | 'height' | 'd' | 'hidden' | 'name'> & ShapeSequenceProps & {
@@ -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, trimBefore, 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, freeze, hidden, name, showInTimeline, controls, ...props }: {
14
14
  readonly defaultName: string;
15
15
  readonly documentationLink: string;
16
16
  readonly width: number;
@@ -18,7 +18,7 @@ export declare const RenderSvg: ({ defaultName, documentationLink, width, height
18
18
  readonly path: string;
19
19
  readonly instructions: Instruction[];
20
20
  readonly transformOrigin: string;
21
- } & Omit<React.SVGProps<SVGPathElement>, "d" | "height" | "hidden" | "name" | "width"> & InteractiveBaseProps & {
21
+ } & Omit<React.SVGProps<SVGPathElement>, "d" | "height" | "hidden" | "name" | "width"> & InteractiveBaseProps & InteractivePremountProps & {
22
22
  readonly controls?: SequenceControls | undefined;
23
23
  } & {
24
24
  readonly debug?: boolean | undefined;
@@ -40,7 +40,20 @@ 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 RenderSvg = ({ defaultName, documentationLink, width, height, path, style, pathStyle, transformOrigin, debug, effects = [], instructions, pixelDensity, durationInFrames, from, trimBefore, freeze, hidden, name, showInTimeline, controls, ...props }) => {
43
+ const RenderSvgWithTiming = ({ premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, from, trimBefore, playbackRate, freeze, hidden, showInTimeline, controls, durationInFrames, name, defaultName, outlineRef, documentationLink, memoizedEffectDefinitions, content, actualStyle, }) => {
44
+ const { effectivePremountFor, effectivePostmountFor, freezeFrame, isPremountingOrPostmounting, premountingActive, postmountingActive, premountingStyle, } = remotion_1.Internals.usePremounting({
45
+ from: from !== null && from !== void 0 ? from : 0,
46
+ durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity,
47
+ premountFor: premountFor !== null && premountFor !== void 0 ? premountFor : null,
48
+ postmountFor: postmountFor !== null && postmountFor !== void 0 ? postmountFor : null,
49
+ style: actualStyle,
50
+ styleWhilePremounted: styleWhilePremounted !== null && styleWhilePremounted !== void 0 ? styleWhilePremounted : null,
51
+ styleWhilePostmounted: styleWhilePostmounted !== null && styleWhilePostmounted !== void 0 ? styleWhilePostmounted : null,
52
+ hideWhilePremounted: 'opacity',
53
+ });
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, outlineRef: outlineRef, _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
+ };
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 }) => {
44
57
  const actualStyle = (0, react_1.useMemo)(() => {
45
58
  return {
46
59
  overflow: 'visible',
@@ -107,6 +120,6 @@ const RenderSvg = ({ defaultName, documentationLink, width, height, path, style,
107
120
  if (!videoConfig) {
108
121
  return svg;
109
122
  }
110
- return (jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", from: from, trimBefore: trimBefore, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : defaultName, outlineRef: outlineRef, _remotionInternalDocumentationLink: name === undefined ? documentationLink : undefined, children: content }));
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, outlineRef: outlineRef, documentationLink: documentationLink, memoizedEffectDefinitions: memoizedEffectDefinitions, content: content, actualStyle: actualStyle }));
111
124
  };
112
125
  exports.RenderSvg = RenderSvg;
@@ -1,8 +1,9 @@
1
1
  import { type InteractivitySchemaField, type InteractivitySchema } from 'remotion';
2
- export declare const numberField: ({ defaultValue, description, hiddenFromList, max, min, step, }: {
2
+ export declare const numberField: ({ defaultValue, description, hiddenFromList, integer, max, min, step, }: {
3
3
  readonly defaultValue: number | undefined;
4
4
  readonly description: string;
5
5
  readonly hiddenFromList?: boolean | undefined;
6
+ readonly integer?: boolean | undefined;
6
7
  readonly max?: number | undefined;
7
8
  readonly min?: number | undefined;
8
9
  readonly step?: number | undefined;
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeShapeSchema = exports.enumField = exports.colorField = exports.booleanField = exports.numberField = void 0;
4
4
  const remotion_1 = require("remotion");
5
- const numberField = ({ defaultValue, description, hiddenFromList = false, max, min, step = 1, }) => {
5
+ const numberField = ({ defaultValue, description, hiddenFromList = false, integer, max, min, step = 1, }) => {
6
6
  return {
7
7
  type: 'number',
8
8
  default: defaultValue,
9
9
  description,
10
10
  hiddenFromList,
11
+ integer,
11
12
  max,
12
13
  min,
13
14
  step,
@@ -42,6 +43,7 @@ exports.enumField = enumField;
42
43
  const makeShapeSchema = (shapeFields) => {
43
44
  return {
44
45
  ...remotion_1.Internals.baseSchema,
46
+ ...remotion_1.Internals.premountSchema,
45
47
  ...shapeFields,
46
48
  fill: (0, exports.colorField)({
47
49
  defaultValue: '#0b84ff',
@@ -12,6 +12,7 @@ const starSchema = (0, schema_1.makeShapeSchema)({
12
12
  description: 'Points',
13
13
  min: 3,
14
14
  step: 1,
15
+ integer: true,
15
16
  }),
16
17
  innerRadius: (0, schema_1.numberField)({
17
18
  defaultValue: 50,
@@ -144,8 +144,9 @@ import React, { useCallback, useMemo, useRef } from "react";
144
144
  import { version } from "react-dom";
145
145
  import {
146
146
  HtmlInCanvas,
147
- Internals,
148
- Sequence
147
+ Freeze,
148
+ Sequence,
149
+ Internals
149
150
  } from "remotion";
150
151
 
151
152
  // src/utils/does-react-support-canary.ts
@@ -161,6 +162,70 @@ var doesReactSupportTransformOriginProperty = (version) => {
161
162
  // src/components/render-svg.tsx
162
163
  import { jsx, jsxs } from "react/jsx-runtime";
163
164
  var HtmlInCanvasWithPrivateProps = HtmlInCanvas;
165
+ var RenderSvgWithTiming = ({
166
+ premountFor,
167
+ postmountFor,
168
+ styleWhilePremounted,
169
+ styleWhilePostmounted,
170
+ from,
171
+ trimBefore,
172
+ playbackRate,
173
+ freeze,
174
+ hidden,
175
+ showInTimeline,
176
+ controls,
177
+ durationInFrames,
178
+ name,
179
+ defaultName,
180
+ outlineRef,
181
+ documentationLink,
182
+ memoizedEffectDefinitions,
183
+ content,
184
+ actualStyle
185
+ }) => {
186
+ const {
187
+ effectivePremountFor,
188
+ effectivePostmountFor,
189
+ freezeFrame,
190
+ isPremountingOrPostmounting,
191
+ premountingActive,
192
+ postmountingActive,
193
+ premountingStyle
194
+ } = Internals.usePremounting({
195
+ from: from ?? 0,
196
+ durationInFrames: durationInFrames ?? Infinity,
197
+ premountFor: premountFor ?? null,
198
+ postmountFor: postmountFor ?? null,
199
+ style: actualStyle,
200
+ styleWhilePremounted: styleWhilePremounted ?? null,
201
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
202
+ hideWhilePremounted: "opacity"
203
+ });
204
+ return /* @__PURE__ */ jsx(Freeze, {
205
+ frame: freezeFrame,
206
+ active: isPremountingOrPostmounting,
207
+ children: /* @__PURE__ */ jsx(Sequence, {
208
+ layout: "none",
209
+ from,
210
+ trimBefore,
211
+ playbackRate,
212
+ freeze,
213
+ hidden,
214
+ showInTimeline,
215
+ controls,
216
+ _remotionInternalEffects: memoizedEffectDefinitions,
217
+ durationInFrames,
218
+ name: name ?? defaultName,
219
+ outlineRef,
220
+ _remotionInternalDocumentationLink: name === undefined ? documentationLink : undefined,
221
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
222
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
223
+ _remotionInternalIsPremounting: premountingActive,
224
+ _remotionInternalIsPostmounting: postmountingActive,
225
+ children: React.cloneElement(content, { style: premountingStyle ?? undefined })
226
+ })
227
+ });
228
+ };
164
229
  var RenderSvg = ({
165
230
  defaultName,
166
231
  documentationLink,
@@ -176,7 +241,12 @@ var RenderSvg = ({
176
241
  pixelDensity,
177
242
  durationInFrames,
178
243
  from,
244
+ premountFor,
245
+ postmountFor,
246
+ styleWhilePremounted,
247
+ styleWhilePostmounted,
179
248
  trimBefore,
249
+ playbackRate,
180
250
  freeze,
181
251
  hidden,
182
252
  name,
@@ -281,20 +351,26 @@ var RenderSvg = ({
281
351
  if (!videoConfig) {
282
352
  return svg;
283
353
  }
284
- return /* @__PURE__ */ jsx(Sequence, {
285
- layout: "none",
354
+ return /* @__PURE__ */ jsx(RenderSvgWithTiming, {
355
+ premountFor,
356
+ postmountFor,
357
+ styleWhilePremounted,
358
+ styleWhilePostmounted,
286
359
  from,
287
360
  trimBefore,
361
+ playbackRate,
288
362
  freeze,
289
363
  hidden,
290
364
  showInTimeline,
291
365
  controls,
292
- _remotionInternalEffects: memoizedEffectDefinitions,
293
366
  durationInFrames,
294
- name: name ?? defaultName,
367
+ name,
368
+ defaultName,
295
369
  outlineRef,
296
- _remotionInternalDocumentationLink: name === undefined ? documentationLink : undefined,
297
- children: content
370
+ documentationLink,
371
+ memoizedEffectDefinitions,
372
+ content,
373
+ actualStyle
298
374
  });
299
375
  };
300
376
 
@@ -307,6 +383,7 @@ var numberField = ({
307
383
  defaultValue,
308
384
  description,
309
385
  hiddenFromList = false,
386
+ integer,
310
387
  max,
311
388
  min,
312
389
  step = 1
@@ -316,6 +393,7 @@ var numberField = ({
316
393
  default: defaultValue,
317
394
  description,
318
395
  hiddenFromList,
396
+ integer,
319
397
  max,
320
398
  min,
321
399
  step
@@ -356,6 +434,7 @@ var enumField = ({
356
434
  var makeShapeSchema = (shapeFields) => {
357
435
  return {
358
436
  ...Internals2.baseSchema,
437
+ ...Internals2.premountSchema,
359
438
  ...shapeFields,
360
439
  fill: colorField({
361
440
  defaultValue: "#0b84ff",
@@ -1384,7 +1463,8 @@ var polygonSchema = makeShapeSchema({
1384
1463
  defaultValue: 5,
1385
1464
  description: "Points",
1386
1465
  min: 3,
1387
- step: 1
1466
+ step: 1,
1467
+ integer: true
1388
1468
  }),
1389
1469
  radius: numberField({
1390
1470
  defaultValue: 100,
@@ -1793,7 +1873,8 @@ var starSchema = makeShapeSchema({
1793
1873
  defaultValue: 5,
1794
1874
  description: "Points",
1795
1875
  min: 3,
1796
- step: 1
1876
+ step: 1,
1877
+ integer: true
1797
1878
  }),
1798
1879
  innerRadius: numberField({
1799
1880
  defaultValue: 50,
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.527",
6
+ "version": "4.0.529",
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.527",
37
+ "@remotion/eslint-config-internal": "4.0.529",
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.527",
55
- "remotion": "4.0.527"
54
+ "@remotion/paths": "4.0.529",
55
+ "remotion": "4.0.529"
56
56
  },
57
57
  "homepage": "https://www.remotion.dev/docs/shapes"
58
58
  }