remotion 3.3.51 → 3.3.52

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.
Files changed (198) hide show
  1. package/dist/AbsoluteFill.d.ts +6 -0
  2. package/dist/AbsoluteFill.js +28 -0
  3. package/dist/CanUseRemotionHooks.d.ts +5 -0
  4. package/dist/CanUseRemotionHooks.js +10 -0
  5. package/dist/Clipper.d.ts +7 -0
  6. package/dist/Clipper.js +24 -0
  7. package/dist/Composition.d.ts +23 -0
  8. package/dist/Composition.js +113 -0
  9. package/dist/CompositionManager.d.ts +82 -0
  10. package/dist/CompositionManager.js +164 -0
  11. package/dist/Folder.d.ts +15 -0
  12. package/dist/Folder.js +33 -0
  13. package/dist/IFrame.d.ts +2 -0
  14. package/dist/IFrame.js +24 -0
  15. package/dist/Img.d.ts +2 -0
  16. package/dist/Img.js +52 -0
  17. package/dist/NativeLayers.d.ts +13 -0
  18. package/dist/NativeLayers.js +29 -0
  19. package/dist/Null.d.ts +2 -0
  20. package/dist/Null.js +25 -0
  21. package/dist/RemotionRoot.d.ts +5 -0
  22. package/dist/RemotionRoot.js +73 -0
  23. package/dist/Sequence.d.ts +29 -0
  24. package/dist/Sequence.js +131 -0
  25. package/dist/Still.d.ts +2 -0
  26. package/dist/Still.js +9 -0
  27. package/dist/absolute-src.d.ts +1 -0
  28. package/dist/absolute-src.js +7 -0
  29. package/dist/asset-types.d.ts +50 -0
  30. package/dist/asset-types.js +1 -0
  31. package/dist/audio/Audio.d.ts +8 -0
  32. package/dist/audio/Audio.js +52 -0
  33. package/dist/audio/AudioForDevelopment.d.ts +11 -0
  34. package/dist/audio/AudioForDevelopment.js +94 -0
  35. package/dist/audio/AudioForRendering.d.ts +10 -0
  36. package/dist/audio/AudioForRendering.js +111 -0
  37. package/dist/audio/index.d.ts +2 -0
  38. package/dist/audio/index.js +18 -0
  39. package/dist/audio/props.d.ts +12 -0
  40. package/dist/audio/props.js +2 -0
  41. package/dist/audio/shared-audio-tags.d.ts +37 -0
  42. package/dist/audio/shared-audio-tags.js +222 -0
  43. package/dist/audio/use-audio-frame.d.ts +6 -0
  44. package/dist/audio/use-audio-frame.js +23 -0
  45. package/dist/bezier.d.ts +1 -0
  46. package/dist/bezier.js +114 -0
  47. package/dist/cancel-render.d.ts +1 -0
  48. package/dist/cancel-render.js +43 -0
  49. package/dist/cjs/series/index.js +5 -2
  50. package/dist/cjs/test/series.test.js +32 -27
  51. package/dist/cjs/version.d.ts +1 -1
  52. package/dist/cjs/version.js +1 -1
  53. package/dist/config/input-props.d.ts +1 -0
  54. package/dist/config/input-props.js +31 -0
  55. package/dist/config.d.ts +285 -0
  56. package/dist/config.js +21 -0
  57. package/dist/default-css.d.ts +3 -0
  58. package/dist/default-css.js +49 -0
  59. package/dist/delay-render.d.ts +14 -0
  60. package/dist/delay-render.js +77 -0
  61. package/dist/easing.d.ts +19 -0
  62. package/dist/easing.js +77 -0
  63. package/dist/esm/series/index.js +5 -2
  64. package/dist/esm/test/series.test.js +32 -27
  65. package/dist/esm/version.d.ts +1 -1
  66. package/dist/esm/version.js +1 -1
  67. package/dist/freeze.d.ts +7 -0
  68. package/dist/freeze.js +34 -0
  69. package/dist/get-asset-file-name.d.ts +1 -0
  70. package/dist/get-asset-file-name.js +14 -0
  71. package/dist/get-environment.d.ts +3 -0
  72. package/dist/get-environment.js +34 -0
  73. package/dist/get-preview-dom-element.d.ts +1 -0
  74. package/dist/get-preview-dom-element.js +7 -0
  75. package/dist/get-static-files.d.ts +17 -0
  76. package/dist/get-static-files.js +31 -0
  77. package/dist/get-timeline-clip-name.d.ts +1 -0
  78. package/dist/get-timeline-clip-name.js +25 -0
  79. package/dist/index.d.ts +92 -0
  80. package/dist/index.js +73 -0
  81. package/dist/internals.d.ts +97 -0
  82. package/dist/internals.js +99 -0
  83. package/dist/interpolate-colors.d.ts +5 -0
  84. package/dist/interpolate-colors.js +401 -0
  85. package/dist/interpolate.d.ts +18 -0
  86. package/dist/interpolate.js +123 -0
  87. package/dist/is-approximately-the-same.d.ts +1 -0
  88. package/dist/is-approximately-the-same.js +8 -0
  89. package/dist/is-player.d.ts +3 -0
  90. package/dist/is-player.js +14 -0
  91. package/dist/loading-indicator.d.ts +2 -0
  92. package/dist/loading-indicator.js +35 -0
  93. package/dist/loop/index.d.ts +9 -0
  94. package/dist/loop/index.js +29 -0
  95. package/dist/multiple-versions-warning.d.ts +1 -0
  96. package/dist/multiple-versions-warning.js +32 -0
  97. package/dist/nonce.d.ts +7 -0
  98. package/dist/nonce.js +17 -0
  99. package/dist/play-and-handle-not-allowed-error.d.ts +2 -0
  100. package/dist/play-and-handle-not-allowed-error.js +44 -0
  101. package/dist/portal-node.d.ts +1 -0
  102. package/dist/portal-node.js +23 -0
  103. package/dist/prefetch-state.d.ts +8 -0
  104. package/dist/prefetch-state.js +27 -0
  105. package/dist/prefetch.d.ts +9 -0
  106. package/dist/prefetch.js +108 -0
  107. package/dist/random.d.ts +7 -0
  108. package/dist/random.js +41 -0
  109. package/dist/register-root.d.ts +4 -0
  110. package/dist/register-root.js +33 -0
  111. package/dist/series/flatten-children.d.ts +2 -0
  112. package/dist/series/flatten-children.js +19 -0
  113. package/dist/series/index.d.ts +13 -0
  114. package/dist/series/index.js +60 -0
  115. package/dist/setup-env-variables.d.ts +2 -0
  116. package/dist/setup-env-variables.js +36 -0
  117. package/dist/spring/index.d.ts +27 -0
  118. package/dist/spring/index.js +51 -0
  119. package/dist/spring/measure-spring.d.ts +8 -0
  120. package/dist/spring/measure-spring.js +64 -0
  121. package/dist/spring/spring-utils.d.ts +21 -0
  122. package/dist/spring/spring-utils.js +103 -0
  123. package/dist/static-file.d.ts +5 -0
  124. package/dist/static-file.js +33 -0
  125. package/dist/timeline-position-state.d.ts +29 -0
  126. package/dist/timeline-position-state.js +41 -0
  127. package/dist/truthy.d.ts +3 -0
  128. package/dist/truthy.js +7 -0
  129. package/dist/tsconfig-cjs.tsbuildinfo +1 -1
  130. package/dist/use-current-frame.d.ts +6 -0
  131. package/dist/use-current-frame.js +28 -0
  132. package/dist/use-lazy-component.d.ts +7 -0
  133. package/dist/use-lazy-component.js +49 -0
  134. package/dist/use-media-in-timeline.d.ts +10 -0
  135. package/dist/use-media-in-timeline.js +129 -0
  136. package/dist/use-media-playback.d.ts +10 -0
  137. package/dist/use-media-playback.js +77 -0
  138. package/dist/use-media-tag-volume.d.ts +2 -0
  139. package/dist/use-media-tag-volume.js +31 -0
  140. package/dist/use-sync-volume-with-media-tag.d.ts +10 -0
  141. package/dist/use-sync-volume-with-media-tag.js +21 -0
  142. package/dist/use-unsafe-video-config.d.ts +2 -0
  143. package/dist/use-unsafe-video-config.js +27 -0
  144. package/dist/use-video-config.d.ts +7 -0
  145. package/dist/use-video-config.js +29 -0
  146. package/dist/use-video.d.ts +12 -0
  147. package/dist/use-video.js +28 -0
  148. package/dist/validate-media-props.d.ts +4 -0
  149. package/dist/validate-media-props.js +24 -0
  150. package/dist/validate-start-from-props.d.ts +1 -0
  151. package/dist/validate-start-from-props.js +31 -0
  152. package/dist/validation/validate-composition-id.d.ts +3 -0
  153. package/dist/validation/validate-composition-id.js +13 -0
  154. package/dist/validation/validate-dimensions.d.ts +1 -0
  155. package/dist/validation/validate-dimensions.js +21 -0
  156. package/dist/validation/validate-duration-in-frames.d.ts +1 -0
  157. package/dist/validation/validate-duration-in-frames.js +15 -0
  158. package/dist/validation/validate-folder-name.d.ts +3 -0
  159. package/dist/validation/validate-folder-name.js +19 -0
  160. package/dist/validation/validate-fps.d.ts +1 -0
  161. package/dist/validation/validate-fps.js +21 -0
  162. package/dist/validation/validate-offthreadvideo-image-format.d.ts +1 -0
  163. package/dist/validation/validate-offthreadvideo-image-format.js +15 -0
  164. package/dist/validation/validation-spring-duration.d.ts +1 -0
  165. package/dist/validation/validation-spring-duration.js +21 -0
  166. package/dist/version.d.ts +1 -0
  167. package/dist/version.js +5 -0
  168. package/dist/video/OffthreadVideo.d.ts +3 -0
  169. package/dist/video/OffthreadVideo.js +33 -0
  170. package/dist/video/OffthreadVideoForRendering.d.ts +3 -0
  171. package/dist/video/OffthreadVideoForRendering.js +104 -0
  172. package/dist/video/Video.d.ts +8 -0
  173. package/dist/video/Video.js +50 -0
  174. package/dist/video/VideoForDevelopment.d.ts +11 -0
  175. package/dist/video/VideoForDevelopment.js +113 -0
  176. package/dist/video/VideoForRendering.d.ts +10 -0
  177. package/dist/video/VideoForRendering.js +203 -0
  178. package/dist/video/duration-state.d.ts +17 -0
  179. package/dist/video/duration-state.js +34 -0
  180. package/dist/video/get-current-time.d.ts +13 -0
  181. package/dist/video/get-current-time.js +31 -0
  182. package/dist/video/index.d.ts +3 -0
  183. package/dist/video/index.js +7 -0
  184. package/dist/video/props.d.ts +25 -0
  185. package/dist/video/props.js +2 -0
  186. package/dist/video/video-fragment.d.ts +12 -0
  187. package/dist/video/video-fragment.js +60 -0
  188. package/dist/video-config.d.ts +8 -0
  189. package/dist/video-config.js +2 -0
  190. package/dist/volume-position-state.d.ts +19 -0
  191. package/dist/volume-position-state.js +32 -0
  192. package/dist/volume-prop.d.ts +7 -0
  193. package/dist/volume-prop.js +24 -0
  194. package/dist/warn-about-non-seekable-media.d.ts +1 -0
  195. package/dist/warn-about-non-seekable-media.js +34 -0
  196. package/dist/wrap-remotion-context.d.ts +18 -0
  197. package/dist/wrap-remotion-context.js +73 -0
  198. package/package.json +4 -5
@@ -1,9 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /**
3
- * @vitest-environment jsdom
4
- */
5
- /* eslint-disable react/jsx-no-constructed-context-values */
6
- import { render } from '@testing-library/react';
2
+ import { renderToString } from 'react-dom/server';
7
3
  import { expect, test } from 'vitest';
8
4
  import { CanUseRemotionHooksProvider } from '../CanUseRemotionHooks.js';
9
5
  import { Series } from '../series';
@@ -23,7 +19,7 @@ const Third = () => {
23
19
  return _jsx("div", { children: 'third ' + frame });
24
20
  };
25
21
  const renderForFrame = (frame, markup) => {
26
- return render(_jsx(CanUseRemotionHooksProvider, { children: _jsx(TimelineContext.Provider, { value: {
22
+ return renderToString(_jsx(CanUseRemotionHooksProvider, { children: _jsx(TimelineContext.Provider, { value: {
27
23
  rootId: '',
28
24
  frame,
29
25
  playing: false,
@@ -38,27 +34,27 @@ const renderForFrame = (frame, markup) => {
38
34
  }, children: markup }) }));
39
35
  };
40
36
  test('Basic series test', () => {
41
- const { queryByText } = renderForFrame(10, _jsxs(WrapSequenceContext, { children: [_jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(First, {}) }), _jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(Second, {}) }), _jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(Third, {}) })] }), ' '] }));
42
- expect(queryByText(/^third\s0$/)).not.toBe(null);
37
+ const outerHTML = renderForFrame(10, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(First, {}) }), _jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(Second, {}) }), _jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(Third, {}) })] }) }));
38
+ expect(outerHTML).toBe('<div style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;display:flex"><div>third 0</div></div>');
43
39
  });
44
40
  test('Should support fragments', () => {
45
- const { container } = renderForFrame(10, _jsxs(WrapSequenceContext, { children: [_jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(First, {}) }), _jsxs(_Fragment, { children: [_jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(Second, {}) }, "0"), _jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(Third, {}) }, "1")] })] }), ' '] }));
46
- expect(container.outerHTML).not.toBe(null);
41
+ const outerHtml = renderForFrame(10, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(First, {}) }), _jsxs(_Fragment, { children: [_jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(Second, {}) }, "0"), _jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(Third, {}) }, "1")] })] }) }));
42
+ expect(outerHtml).not.toBe('<div style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;display:flex"><div>second 1</div></div>');
47
43
  });
48
44
  test('Should not allow foreign elements', () => {
49
45
  expect(() => {
50
- render(_jsx(WrapSequenceContext, { children: _jsx(Series, { children: _jsx(First, {}) }) }));
46
+ renderForFrame(0, _jsx(WrapSequenceContext, { children: _jsx(Series, { children: _jsx(First, {}) }) }));
51
47
  }).toThrow(/only accepts a/);
52
48
  });
53
49
  test('Should allow layout prop', () => {
54
- const { container } = renderForFrame(0, _jsx(WrapSequenceContext, { children: _jsx(Series, { children: _jsx(Series.Sequence, { durationInFrames: 1, children: _jsx(First, {}) }) }) }));
55
- expect(container.outerHTML).toBe('<div><div style="position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; width: 100%; height: 100%; display: flex;"><div>first 0</div></div></div>');
56
- const { container: withoutLayoutContainer } = renderForFrame(0, _jsx(WrapSequenceContext, { children: _jsx(Series, { children: _jsx(Series.Sequence, { durationInFrames: 1, layout: "none", children: _jsx(First, {}) }) }) }));
57
- expect(withoutLayoutContainer.outerHTML).toBe('<div><div>first 0</div></div>');
50
+ const outerHTML = renderForFrame(0, _jsx(WrapSequenceContext, { children: _jsx(Series, { children: _jsx(Series.Sequence, { durationInFrames: 1, children: _jsx(First, {}) }) }) }));
51
+ expect(outerHTML).toBe('<div style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;display:flex"><div>first 0</div></div>');
52
+ const outerHTML2 = renderForFrame(0, _jsx(WrapSequenceContext, { children: _jsx(Series, { children: _jsx(Series.Sequence, { durationInFrames: 1, layout: "none", children: _jsx(First, {}) }) }) }));
53
+ expect(outerHTML2).toBe('<div>first 0</div>');
58
54
  });
59
55
  test('Should render nothing after the end', () => {
60
- const { container } = renderForFrame(10, _jsx(WrapSequenceContext, { children: _jsx(Series, { children: _jsx(Series.Sequence, { durationInFrames: 1, children: _jsx(First, {}) }) }) }));
61
- expect(container.outerHTML).toBe('<div></div>');
56
+ const outerHTML = renderForFrame(10, _jsx(WrapSequenceContext, { children: _jsx(Series, { children: _jsx(Series.Sequence, { durationInFrames: 1, children: _jsx(First, {}) }) }) }));
57
+ expect(outerHTML).toBe('');
62
58
  });
63
59
  test('Should throw if invalid or no duration provided', () => {
64
60
  expect(() => {
@@ -69,19 +65,19 @@ test('Should throw if invalid or no duration provided', () => {
69
65
  }).toThrow(/The "durationInFrames" prop of a <Series.Sequence \/> component must be a number, but you passed a value of type undefined/);
70
66
  });
71
67
  test('Should allow whitespace', () => {
72
- const { queryByText } = renderForFrame(11, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 10, children: _jsx(First, {}) }), ' ', _jsx(Series.Sequence, { durationInFrames: 10, children: _jsx(Second, {}) })] }) }));
73
- expect(queryByText(/^second\s1$/g)).not.toBe(null);
68
+ const outerHtml = renderForFrame(11, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 10, children: _jsx(First, {}) }), ' ', _jsx(Series.Sequence, { durationInFrames: 10, children: _jsx(Second, {}) })] }) }));
69
+ expect(outerHtml).toBe('<div style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;display:flex"><div>second 1</div></div>');
74
70
  });
75
71
  test('Handle empty Series.Sequence', () => {
76
72
  expect(() => renderForFrame(11, _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 10, children: _jsx(First, {}) }), _jsx(Series.Sequence, { durationInFrames: 10 })] }))).toThrow(/A <Series.Sequence \/> component \(index = 1, duration = 10\) was detected to not have any children\. Delete it to fix this error\./);
77
73
  });
78
74
  test('Should allow negative overlap prop', () => {
79
- const { container } = renderForFrame(4, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, layout: "none", children: _jsx(First, {}) }), _jsx(Series.Sequence, { offset: -1, layout: "none", durationInFrames: 5, children: _jsx(Second, {}) })] }) }));
80
- expect(container.outerHTML).toBe('<div><div>first 4</div><div>second 0</div></div>');
75
+ const outerHTML = renderForFrame(4, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, layout: "none", children: _jsx(First, {}) }), _jsx(Series.Sequence, { offset: -1, layout: "none", durationInFrames: 5, children: _jsx(Second, {}) })] }) }));
76
+ expect(outerHTML).toBe('<div>first 4</div><div>second 0</div>');
81
77
  });
82
78
  test('Should allow positive overlap prop', () => {
83
- const { container } = renderForFrame(5, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, layout: "none", children: _jsx(First, {}) }), _jsx(Series.Sequence, { offset: 1, layout: "none", durationInFrames: 5, children: _jsx(Second, {}) })] }) }));
84
- expect(container.outerHTML).toBe('<div></div>');
79
+ const outerHTML = renderForFrame(5, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, layout: "none", children: _jsx(First, {}) }), _jsx(Series.Sequence, { offset: 1, layout: "none", durationInFrames: 5, children: _jsx(Second, {}) })] }) }));
80
+ expect(outerHTML).toBe('');
85
81
  });
86
82
  test('Should disallow NaN as offset prop', () => {
87
83
  expect(() => {
@@ -99,10 +95,19 @@ test('Should disallow non-integer numbers as offset prop', () => {
99
95
  }).toThrow(/The "offset" property of a <Series.Sequence \/> must be finite, but got 3.141592653589793 \(index = 0, duration = 5\)\./);
100
96
  });
101
97
  test('Should cascade negative offset props', () => {
102
- const { container } = renderForFrame(9, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, layout: "none", children: _jsx(First, {}) }), _jsx(Series.Sequence, { offset: -1, layout: "none", durationInFrames: 5, children: _jsx(Second, {}) }), _jsx(Series.Sequence, { layout: "none", durationInFrames: 5, children: _jsx(Third, {}) })] }) }));
103
- expect(container.outerHTML).toBe('<div><div>third 0</div></div>');
98
+ const outerHTML = renderForFrame(9, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, layout: "none", children: _jsx(First, {}) }), _jsx(Series.Sequence, { offset: -1, layout: "none", durationInFrames: 5, children: _jsx(Second, {}) }), _jsx(Series.Sequence, { layout: "none", durationInFrames: 5, children: _jsx(Third, {}) })] }) }));
99
+ expect(outerHTML).toBe('<div>third 0</div>');
104
100
  });
105
101
  test('Should cascade positive offset props', () => {
106
- const { container } = renderForFrame(11, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, layout: "none", children: _jsx(First, {}) }), _jsx(Series.Sequence, { offset: 1, layout: "none", durationInFrames: 5, children: _jsx(Second, {}) }), _jsx(Series.Sequence, { layout: "none", durationInFrames: 5, children: _jsx(Third, {}) })] }) }));
107
- expect(container.outerHTML).toBe('<div><div>third 0</div></div>');
102
+ const outerHTML = renderForFrame(11, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, layout: "none", children: _jsx(First, {}) }), _jsx(Series.Sequence, { offset: 1, layout: "none", durationInFrames: 5, children: _jsx(Second, {}) }), _jsx(Series.Sequence, { layout: "none", durationInFrames: 5, children: _jsx(Third, {}) })] }) }));
103
+ expect(outerHTML).toBe('<div>third 0</div>');
104
+ });
105
+ test('Allow durationInFrames as Infinity for last Series.Sequence', () => {
106
+ const outerHTML = renderForFrame(10, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(First, {}) }), _jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(Second, {}) }), _jsx(Series.Sequence, { durationInFrames: Infinity, children: _jsx(Third, {}) })] }) }));
107
+ expect(outerHTML).toBe('<div style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;display:flex"><div>third 0</div></div>');
108
+ });
109
+ test('Disallow durationInFrames as Infinity for first n-1 Series.Sequence', () => {
110
+ expect(() => {
111
+ renderForFrame(10, _jsx(WrapSequenceContext, { children: _jsxs(Series, { children: [_jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(First, {}) }), _jsx(Series.Sequence, { durationInFrames: Infinity, children: _jsx(Second, {}) }), _jsx(Series.Sequence, { durationInFrames: 5, children: _jsx(Third, {}) })] }) }));
112
+ }).toThrow(/The "durationInFrames" prop of a <Series.Sequence \/> component must be an integer, but got Infinity\./);
108
113
  });
@@ -1 +1 @@
1
- export declare const VERSION = "3.3.51";
1
+ export declare const VERSION = "3.3.52";
@@ -1,2 +1,2 @@
1
1
  // Automatically generated on publish
2
- export const VERSION = '3.3.51';
2
+ export const VERSION = '3.3.52';
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare type FreezeProps = {
3
+ frame: number;
4
+ children: React.ReactNode;
5
+ };
6
+ export declare const Freeze: React.FC<FreezeProps>;
7
+ export {};
package/dist/freeze.js ADDED
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Freeze = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const Sequence_1 = require("./Sequence");
7
+ const timeline_position_state_1 = require("./timeline-position-state");
8
+ const Freeze = ({ frame, children }) => {
9
+ if (typeof frame === 'undefined') {
10
+ throw new Error(`The <Freeze /> component requires a 'frame' prop, but none was passed.`);
11
+ }
12
+ if (typeof frame !== 'number') {
13
+ throw new Error(`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof frame}`);
14
+ }
15
+ if (Number.isNaN(frame)) {
16
+ throw new Error(`The 'frame' prop of <Freeze /> must be a real number, but it is NaN.`);
17
+ }
18
+ if (!Number.isFinite(frame)) {
19
+ throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frame}.`);
20
+ }
21
+ const context = (0, react_1.useContext)(timeline_position_state_1.TimelineContext);
22
+ const value = (0, react_1.useMemo)(() => {
23
+ return {
24
+ ...context,
25
+ playing: false,
26
+ imperativePlaying: {
27
+ current: false,
28
+ },
29
+ frame,
30
+ };
31
+ }, [context, frame]);
32
+ return ((0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: value, children: (0, jsx_runtime_1.jsx)(Sequence_1.SequenceContext.Provider, { value: null, children: children }) }));
33
+ };
34
+ exports.Freeze = Freeze;
@@ -0,0 +1 @@
1
+ export declare const getAssetDisplayName: (filename: string) => string;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAssetDisplayName = void 0;
4
+ const getAssetDisplayName = (filename) => {
5
+ if (/data:|blob:/.test(filename.substring(0, 5))) {
6
+ return 'Data URL';
7
+ }
8
+ const splitted = filename
9
+ .split('/')
10
+ .map((s) => s.split('\\'))
11
+ .flat(1);
12
+ return splitted[splitted.length - 1];
13
+ };
14
+ exports.getAssetDisplayName = getAssetDisplayName;
@@ -0,0 +1,3 @@
1
+ export declare type RemotionEnvironment = 'preview' | 'rendering' | 'player-development' | 'player-production';
2
+ export declare const getRemotionEnvironment: () => RemotionEnvironment;
3
+ export declare const useRemotionEnvironment: () => RemotionEnvironment;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useRemotionEnvironment = exports.getRemotionEnvironment = void 0;
4
+ const is_player_1 = require("./is-player");
5
+ const getRemotionEnvironment = () => {
6
+ if (process.env.NODE_ENV === 'production') {
7
+ if (typeof window !== 'undefined' && window.remotion_isPlayer) {
8
+ return 'player-production';
9
+ }
10
+ return 'rendering';
11
+ }
12
+ // The Vitest framework sets NODE_ENV as test.
13
+ // Right now we don't need to treat it in a special
14
+ // way which is good - defaulting to `rendering`.
15
+ if (process.env.NODE_ENV === 'test') {
16
+ return 'rendering';
17
+ }
18
+ if (typeof window !== 'undefined' && window.remotion_isPlayer) {
19
+ return 'player-development';
20
+ }
21
+ return 'preview';
22
+ };
23
+ exports.getRemotionEnvironment = getRemotionEnvironment;
24
+ const useRemotionEnvironment = () => {
25
+ const isPlayer = (0, is_player_1.useIsPlayer)();
26
+ if (isPlayer) {
27
+ if (process.env.NODE_ENV === 'production') {
28
+ return 'player-production';
29
+ }
30
+ return 'player-development';
31
+ }
32
+ return (0, exports.getRemotionEnvironment)();
33
+ };
34
+ exports.useRemotionEnvironment = useRemotionEnvironment;
@@ -0,0 +1 @@
1
+ export declare const getPreviewDomElement: () => HTMLElement | null;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPreviewDomElement = void 0;
4
+ const getPreviewDomElement = () => {
5
+ return document.getElementById('container');
6
+ };
7
+ exports.getPreviewDomElement = getPreviewDomElement;
@@ -0,0 +1,17 @@
1
+ export declare const getStaticFiles: () => StaticFile[];
2
+ export declare type StaticFile = {
3
+ /**
4
+ * A string that you can pass to the `src` attribute of an `<Audio>`, `<Img>` and `<Video>` element.
5
+ */
6
+ src: string;
7
+ /**
8
+ * The filepath of the file, relative to the public folder.
9
+ * Example: `subfolder/image.png`
10
+ */
11
+ name: string;
12
+ sizeInBytes: number;
13
+ /**
14
+ * UNIX timestamp in milliseconds
15
+ */
16
+ lastModified: number;
17
+ };
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getStaticFiles = void 0;
4
+ let warnedServer = false;
5
+ let warnedPlayer = false;
6
+ const warnServerOnce = () => {
7
+ if (warnedServer) {
8
+ return;
9
+ }
10
+ warnedServer = true;
11
+ console.warn('Called getStaticFiles() on the server. The API is only available in the browser. An empty array was returned.');
12
+ };
13
+ const warnPlayerOnce = () => {
14
+ if (warnedPlayer) {
15
+ return;
16
+ }
17
+ warnedPlayer = true;
18
+ console.warn('Called getStaticFiles() while using the Remotion Player. The API is only available while using the Remotion Preview. An empty array was returned.');
19
+ };
20
+ const getStaticFiles = () => {
21
+ if (typeof document === 'undefined') {
22
+ warnServerOnce();
23
+ return [];
24
+ }
25
+ if (window.remotion_isPlayer) {
26
+ warnPlayerOnce();
27
+ return [];
28
+ }
29
+ return window.remotion_staticFiles;
30
+ };
31
+ exports.getStaticFiles = getStaticFiles;
@@ -0,0 +1 @@
1
+ export declare const getTimelineClipName: (children: React.ReactNode) => string;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTimelineClipName = void 0;
4
+ const react_1 = require("react");
5
+ const HIDDEN_NAMES = ['__WEBPACK_DEFAULT_EXPORT__'];
6
+ const getTimelineClipName = (children) => {
7
+ var _a;
8
+ const tree = (_a = react_1.Children.map(children, (ch) => {
9
+ if (!(0, react_1.isValidElement)(ch)) {
10
+ return null;
11
+ }
12
+ // Must be name, not ID
13
+ const name = typeof ch.type !== 'string' && ch.type.name;
14
+ if (name && !HIDDEN_NAMES.includes(name)) {
15
+ return name;
16
+ }
17
+ if (ch.props.children) {
18
+ const chName = (0, exports.getTimelineClipName)(ch.props.children);
19
+ return chName;
20
+ }
21
+ return null;
22
+ })) === null || _a === void 0 ? void 0 : _a.filter(Boolean);
23
+ return (tree === null || tree === void 0 ? void 0 : tree.length) ? tree[0] : '';
24
+ };
25
+ exports.getTimelineClipName = getTimelineClipName;
@@ -0,0 +1,92 @@
1
+ import './asset-types';
2
+ import type { TAsset, TCompMetadata } from './CompositionManager';
3
+ import type { StaticFile } from './get-static-files';
4
+ import type { ClipRegion } from './NativeLayers';
5
+ declare global {
6
+ interface Window {
7
+ ready: boolean;
8
+ remotion_cancelledError: string | undefined;
9
+ getStaticCompositions: () => TCompMetadata[];
10
+ setBundleMode: (bundleMode: BundleState) => void;
11
+ remotion_staticBase: string;
12
+ remotion_staticFiles: StaticFile[];
13
+ remotion_editorName: string | null;
14
+ remotion_numberOfAudioTags: number;
15
+ remotion_projectName: string;
16
+ remotion_cwd: string;
17
+ remotion_previewServerCommand: string;
18
+ remotion_setFrame: (frame: number) => void;
19
+ remotion_initialFrame: number;
20
+ remotion_proxyPort: number;
21
+ remotion_audioEnabled: boolean;
22
+ remotion_videoEnabled: boolean;
23
+ remotion_puppeteerTimeout: number;
24
+ remotion_inputProps: string;
25
+ remotion_envVariables: string;
26
+ remotion_collectAssets: () => TAsset[];
27
+ remotion_getClipRegion: () => ClipRegion | null;
28
+ remotion_isPlayer: boolean;
29
+ remotion_isBuilding: undefined | (() => void);
30
+ remotion_finishedBuilding: undefined | (() => void);
31
+ siteVersion: '4';
32
+ remotion_version: string;
33
+ remotion_imported: string | boolean;
34
+ }
35
+ }
36
+ export declare type BundleState = {
37
+ type: 'index';
38
+ } | {
39
+ type: 'evaluation';
40
+ } | {
41
+ type: 'composition';
42
+ compositionName: string;
43
+ compositionDefaultProps: unknown;
44
+ compositionHeight: number;
45
+ compositionDurationInFrames: number;
46
+ compositionWidth: number;
47
+ compositionFps: number;
48
+ };
49
+ export * from './AbsoluteFill';
50
+ export * from './audio';
51
+ export { cancelRender } from './cancel-render';
52
+ export * from './Composition';
53
+ export { SmallTCompMetadata, TAsset, TCompMetadata } from './CompositionManager';
54
+ export { Config, ConfigType } from './config';
55
+ export { getInputProps } from './config/input-props';
56
+ export { continueRender, delayRender } from './delay-render';
57
+ export * from './easing';
58
+ export * from './Folder';
59
+ export * from './freeze';
60
+ export { getStaticFiles, StaticFile } from './get-static-files';
61
+ export * from './IFrame';
62
+ export * from './Img';
63
+ export * from './internals';
64
+ export * from './interpolate';
65
+ export { interpolateColors } from './interpolate-colors';
66
+ export { Loop } from './loop';
67
+ export { ClipRegion } from './NativeLayers';
68
+ export { prefetch } from './prefetch';
69
+ export { random, RandomSeed } from './random';
70
+ export { registerRoot } from './register-root';
71
+ export { Sequence } from './Sequence';
72
+ export { Series } from './series';
73
+ export * from './spring';
74
+ export { staticFile } from './static-file';
75
+ export * from './Still';
76
+ export type { PlayableMediaTag } from './timeline-position-state';
77
+ export { useCurrentFrame } from './use-current-frame';
78
+ export * from './use-video-config';
79
+ export * from './version';
80
+ export * from './video';
81
+ export * from './video-config';
82
+ export declare const Experimental: {
83
+ Clipper: import("react").FC<{
84
+ width: number;
85
+ height: number;
86
+ x: number;
87
+ y: number;
88
+ }>;
89
+ Null: import("react").FC<{}>;
90
+ useIsPlayer: () => boolean;
91
+ };
92
+ export declare type WebpackOverrideFn = "The 'WebpackOverrideFn' has been moved to '@remotion/bundler'. Update your imports and install '@remotion/bundler' if necessary.";
package/dist/index.js ADDED
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Experimental = exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.random = exports.prefetch = exports.Loop = exports.interpolateColors = exports.getStaticFiles = exports.delayRender = exports.continueRender = exports.getInputProps = exports.Config = exports.cancelRender = void 0;
18
+ require("./asset-types");
19
+ const Clipper_1 = require("./Clipper");
20
+ const is_player_1 = require("./is-player");
21
+ const multiple_versions_warning_1 = require("./multiple-versions-warning");
22
+ const Null_1 = require("./Null");
23
+ (0, multiple_versions_warning_1.checkMultipleRemotionVersions)();
24
+ __exportStar(require("./AbsoluteFill"), exports);
25
+ __exportStar(require("./audio"), exports);
26
+ var cancel_render_1 = require("./cancel-render");
27
+ Object.defineProperty(exports, "cancelRender", { enumerable: true, get: function () { return cancel_render_1.cancelRender; } });
28
+ __exportStar(require("./Composition"), exports);
29
+ var config_1 = require("./config");
30
+ Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_1.Config; } });
31
+ var input_props_1 = require("./config/input-props");
32
+ Object.defineProperty(exports, "getInputProps", { enumerable: true, get: function () { return input_props_1.getInputProps; } });
33
+ var delay_render_1 = require("./delay-render");
34
+ Object.defineProperty(exports, "continueRender", { enumerable: true, get: function () { return delay_render_1.continueRender; } });
35
+ Object.defineProperty(exports, "delayRender", { enumerable: true, get: function () { return delay_render_1.delayRender; } });
36
+ __exportStar(require("./easing"), exports);
37
+ __exportStar(require("./Folder"), exports);
38
+ __exportStar(require("./freeze"), exports);
39
+ var get_static_files_1 = require("./get-static-files");
40
+ Object.defineProperty(exports, "getStaticFiles", { enumerable: true, get: function () { return get_static_files_1.getStaticFiles; } });
41
+ __exportStar(require("./IFrame"), exports);
42
+ __exportStar(require("./Img"), exports);
43
+ __exportStar(require("./internals"), exports);
44
+ __exportStar(require("./interpolate"), exports);
45
+ var interpolate_colors_1 = require("./interpolate-colors");
46
+ Object.defineProperty(exports, "interpolateColors", { enumerable: true, get: function () { return interpolate_colors_1.interpolateColors; } });
47
+ var loop_1 = require("./loop");
48
+ Object.defineProperty(exports, "Loop", { enumerable: true, get: function () { return loop_1.Loop; } });
49
+ var prefetch_1 = require("./prefetch");
50
+ Object.defineProperty(exports, "prefetch", { enumerable: true, get: function () { return prefetch_1.prefetch; } });
51
+ var random_1 = require("./random");
52
+ Object.defineProperty(exports, "random", { enumerable: true, get: function () { return random_1.random; } });
53
+ var register_root_1 = require("./register-root");
54
+ Object.defineProperty(exports, "registerRoot", { enumerable: true, get: function () { return register_root_1.registerRoot; } });
55
+ var Sequence_1 = require("./Sequence");
56
+ Object.defineProperty(exports, "Sequence", { enumerable: true, get: function () { return Sequence_1.Sequence; } });
57
+ var series_1 = require("./series");
58
+ Object.defineProperty(exports, "Series", { enumerable: true, get: function () { return series_1.Series; } });
59
+ __exportStar(require("./spring"), exports);
60
+ var static_file_1 = require("./static-file");
61
+ Object.defineProperty(exports, "staticFile", { enumerable: true, get: function () { return static_file_1.staticFile; } });
62
+ __exportStar(require("./Still"), exports);
63
+ var use_current_frame_1 = require("./use-current-frame");
64
+ Object.defineProperty(exports, "useCurrentFrame", { enumerable: true, get: function () { return use_current_frame_1.useCurrentFrame; } });
65
+ __exportStar(require("./use-video-config"), exports);
66
+ __exportStar(require("./version"), exports);
67
+ __exportStar(require("./video"), exports);
68
+ __exportStar(require("./video-config"), exports);
69
+ exports.Experimental = {
70
+ Clipper: Clipper_1.Clipper,
71
+ Null: Null_1.Null,
72
+ useIsPlayer: is_player_1.useIsPlayer,
73
+ };
@@ -0,0 +1,97 @@
1
+ import type { CompProps } from './Composition';
2
+ import type { CompositionManagerContext, TAsset, TCompMetadata, TComposition, TSequence } from './CompositionManager';
3
+ import * as CSSUtils from './default-css';
4
+ import type { RemotionEnvironment } from './get-environment';
5
+ import type { SetTimelineContextValue, TimelineContextValue } from './timeline-position-state';
6
+ import * as TimelinePosition from './timeline-position-state';
7
+ import { truthy } from './truthy';
8
+ import type { MediaVolumeContextValue, SetMediaVolumeContextValue } from './volume-position-state';
9
+ import { useRemotionContexts } from './wrap-remotion-context';
10
+ declare const Timeline: typeof TimelinePosition;
11
+ export declare const Internals: {
12
+ useUnsafeVideoConfig: () => import("./video-config").VideoConfig | null;
13
+ Timeline: typeof TimelinePosition;
14
+ CompositionManager: import("react").Context<CompositionManagerContext>;
15
+ RemotionRoot: import("react").FC<{
16
+ children: import("react").ReactNode;
17
+ numberOfAudioTags: number;
18
+ }>;
19
+ useVideo: () => {
20
+ height: number;
21
+ width: number;
22
+ fps: number;
23
+ durationInFrames: number;
24
+ defaultProps: unknown;
25
+ id: string;
26
+ folderName: string | null;
27
+ parentFolderName: string | null;
28
+ component: import("react").LazyExoticComponent<import("react").ComponentType<unknown>>;
29
+ nonce: number;
30
+ } | null;
31
+ getRoot: () => import("react").FC<{}> | null;
32
+ useMediaVolumeState: () => readonly [number, (u: number) => void];
33
+ useMediaMutedState: () => readonly [boolean, (u: import("react").SetStateAction<boolean>) => void];
34
+ useLazyComponent: <T>(compProps: CompProps<T>) => import("react").ExoticComponent<(import("react").PropsWithoutRef<T> & import("react").RefAttributes<import("react").Component<T, any, any>>) | import("react").PropsWithRef<T>> & {
35
+ readonly _result: import("react").ComponentType<T>;
36
+ };
37
+ truthy: typeof truthy;
38
+ SequenceContext: import("react").Context<import("./Sequence").SequenceContextType | null>;
39
+ useRemotionContexts: typeof useRemotionContexts;
40
+ RemotionContextProvider: (props: import("./wrap-remotion-context").RemotionContextProviderProps) => JSX.Element;
41
+ CSSUtils: typeof CSSUtils;
42
+ setupEnvVariables: () => void;
43
+ ENV_VARIABLES_ENV_NAME: "ENV_VARIABLES";
44
+ MediaVolumeContext: import("react").Context<MediaVolumeContextValue>;
45
+ SetMediaVolumeContext: import("react").Context<SetMediaVolumeContextValue>;
46
+ validateDurationInFrames: (durationInFrames: number, component: string) => void;
47
+ validateFps: (fps: number, location: string, isGif: boolean) => void;
48
+ validateDimension: (amount: number, nameOfProp: string, location: string) => void;
49
+ getRemotionEnvironment: () => RemotionEnvironment;
50
+ SharedAudioContext: import("react").Context<{
51
+ registerAudio: (aud: import("./audio").RemotionAudioProps, audioId: string) => {
52
+ id: number;
53
+ props: import("./audio").RemotionAudioProps;
54
+ el: import("react").RefObject<HTMLAudioElement>;
55
+ audioId: string;
56
+ };
57
+ unregisterAudio: (id: number) => void;
58
+ updateAudio: (options: {
59
+ id: number;
60
+ aud: import("./audio").RemotionAudioProps;
61
+ audioId: string;
62
+ }) => void;
63
+ playAllAudios: () => void;
64
+ numberOfAudioTags: number;
65
+ } | null>;
66
+ SharedAudioContextProvider: import("react").FC<{
67
+ numberOfAudioTags: number;
68
+ children: import("react").ReactNode;
69
+ }>;
70
+ invalidCompositionErrorMessage: string;
71
+ isCompositionIdValid: (id: string) => RegExpMatchArray | null;
72
+ getPreviewDomElement: () => HTMLElement | null;
73
+ compositionsRef: import("react").RefObject<{
74
+ getCompositions: () => TCompMetadata[];
75
+ }>;
76
+ DELAY_RENDER_CALLSTACK_TOKEN: string;
77
+ portalNode: () => HTMLElement;
78
+ waitForRoot: (fn: (comp: import("react").FC<{}>) => void) => () => void;
79
+ validateOffthreadVideoImageFormat: (input: unknown) => void;
80
+ CanUseRemotionHooksProvider: import("react").FC<{
81
+ children: import("react").ReactNode;
82
+ }>;
83
+ CanUseRemotionHooks: import("react").Context<boolean>;
84
+ enableLegacyRemotionConfig: () => void;
85
+ PrefetchProvider: import("react").FC<{
86
+ children: import("react").ReactNode;
87
+ }>;
88
+ DurationsContextProvider: import("react").FC<{
89
+ children: import("react").ReactNode;
90
+ }>;
91
+ IsPlayerContextProvider: import("react").FC<{
92
+ children?: import("react").ReactNode;
93
+ }>;
94
+ useIsPlayer: () => boolean;
95
+ useRemotionEnvironment: () => RemotionEnvironment;
96
+ };
97
+ export type { TComposition, Timeline, TCompMetadata, TSequence, TAsset, TimelineContextValue, SetTimelineContextValue, CompProps, CompositionManagerContext, MediaVolumeContextValue, SetMediaVolumeContextValue, RemotionEnvironment, };