remotion 3.3.45 → 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 (553) hide show
  1. package/dist/Sequence.js +1 -1
  2. package/dist/Still.d.ts +0 -1
  3. package/dist/audio/Audio.d.ts +2 -2
  4. package/dist/audio/AudioForDevelopment.d.ts +1 -1
  5. package/dist/audio/AudioForRendering.d.ts +1 -1
  6. package/dist/cjs/AbsoluteFill.d.ts +6 -0
  7. package/dist/cjs/AbsoluteFill.js +28 -0
  8. package/dist/cjs/CanUseRemotionHooks.d.ts +5 -0
  9. package/dist/cjs/CanUseRemotionHooks.js +10 -0
  10. package/dist/cjs/Clipper.d.ts +7 -0
  11. package/dist/cjs/Clipper.js +24 -0
  12. package/dist/cjs/Composition.d.ts +23 -0
  13. package/dist/cjs/Composition.js +113 -0
  14. package/dist/cjs/CompositionManager.d.ts +82 -0
  15. package/dist/cjs/CompositionManager.js +164 -0
  16. package/dist/cjs/Folder.d.ts +15 -0
  17. package/dist/cjs/Folder.js +33 -0
  18. package/dist/cjs/IFrame.d.ts +2 -0
  19. package/dist/cjs/IFrame.js +24 -0
  20. package/dist/cjs/Img.d.ts +2 -0
  21. package/dist/cjs/Img.js +52 -0
  22. package/dist/cjs/NativeLayers.d.ts +13 -0
  23. package/dist/cjs/NativeLayers.js +29 -0
  24. package/dist/cjs/Null.d.ts +2 -0
  25. package/dist/cjs/Null.js +25 -0
  26. package/dist/cjs/RemotionRoot.d.ts +5 -0
  27. package/dist/cjs/RemotionRoot.js +73 -0
  28. package/dist/cjs/Sequence.d.ts +29 -0
  29. package/dist/cjs/Sequence.js +131 -0
  30. package/dist/cjs/Still.d.ts +3 -0
  31. package/dist/cjs/Still.js +9 -0
  32. package/dist/cjs/absolute-src.d.ts +1 -0
  33. package/dist/cjs/absolute-src.js +7 -0
  34. package/dist/cjs/asset-types.d.ts +50 -0
  35. package/dist/cjs/asset-types.js +1 -0
  36. package/dist/cjs/audio/Audio.d.ts +8 -0
  37. package/dist/cjs/audio/Audio.js +52 -0
  38. package/dist/cjs/audio/AudioForDevelopment.d.ts +11 -0
  39. package/dist/cjs/audio/AudioForDevelopment.js +94 -0
  40. package/dist/cjs/audio/AudioForRendering.d.ts +10 -0
  41. package/dist/cjs/audio/AudioForRendering.js +111 -0
  42. package/dist/cjs/audio/index.d.ts +2 -0
  43. package/dist/cjs/audio/index.js +18 -0
  44. package/dist/cjs/audio/props.d.ts +12 -0
  45. package/dist/cjs/audio/props.js +2 -0
  46. package/dist/cjs/audio/shared-audio-tags.d.ts +37 -0
  47. package/dist/cjs/audio/shared-audio-tags.js +222 -0
  48. package/dist/cjs/audio/use-audio-frame.d.ts +6 -0
  49. package/dist/cjs/audio/use-audio-frame.js +23 -0
  50. package/dist/cjs/bezier.d.ts +1 -0
  51. package/dist/cjs/bezier.js +114 -0
  52. package/dist/cjs/cancel-render.d.ts +1 -0
  53. package/dist/cjs/cancel-render.js +43 -0
  54. package/dist/cjs/config/input-props.d.ts +1 -0
  55. package/dist/cjs/config/input-props.js +31 -0
  56. package/dist/cjs/config.d.ts +285 -0
  57. package/dist/cjs/config.js +21 -0
  58. package/dist/cjs/default-css.d.ts +3 -0
  59. package/dist/cjs/default-css.js +49 -0
  60. package/dist/cjs/delay-render.d.ts +14 -0
  61. package/dist/cjs/delay-render.js +77 -0
  62. package/dist/cjs/easing.d.ts +19 -0
  63. package/dist/cjs/easing.js +77 -0
  64. package/dist/cjs/freeze.d.ts +7 -0
  65. package/dist/cjs/freeze.js +34 -0
  66. package/dist/cjs/get-asset-file-name.d.ts +1 -0
  67. package/dist/cjs/get-asset-file-name.js +14 -0
  68. package/dist/cjs/get-environment.d.ts +3 -0
  69. package/dist/cjs/get-environment.js +34 -0
  70. package/dist/cjs/get-preview-dom-element.d.ts +1 -0
  71. package/dist/cjs/get-preview-dom-element.js +7 -0
  72. package/dist/cjs/get-static-files.d.ts +17 -0
  73. package/dist/cjs/get-static-files.js +31 -0
  74. package/dist/cjs/get-timeline-clip-name.d.ts +1 -0
  75. package/dist/cjs/get-timeline-clip-name.js +25 -0
  76. package/dist/cjs/index.d.ts +92 -0
  77. package/dist/cjs/index.js +73 -0
  78. package/dist/cjs/internals.d.ts +99 -0
  79. package/dist/cjs/internals.js +101 -0
  80. package/dist/cjs/interpolate-colors.d.ts +5 -0
  81. package/dist/cjs/interpolate-colors.js +401 -0
  82. package/dist/cjs/interpolate.d.ts +18 -0
  83. package/dist/cjs/interpolate.js +123 -0
  84. package/dist/cjs/is-approximately-the-same.d.ts +1 -0
  85. package/dist/cjs/is-approximately-the-same.js +8 -0
  86. package/dist/cjs/is-player.d.ts +3 -0
  87. package/dist/cjs/is-player.js +14 -0
  88. package/dist/cjs/loading-indicator.d.ts +2 -0
  89. package/dist/cjs/loading-indicator.js +35 -0
  90. package/dist/cjs/loop/index.d.ts +9 -0
  91. package/dist/cjs/loop/index.js +29 -0
  92. package/dist/cjs/multiple-versions-warning.d.ts +1 -0
  93. package/dist/cjs/multiple-versions-warning.js +32 -0
  94. package/dist/cjs/nonce.d.ts +7 -0
  95. package/dist/cjs/nonce.js +17 -0
  96. package/dist/cjs/play-and-handle-not-allowed-error.d.ts +2 -0
  97. package/dist/cjs/play-and-handle-not-allowed-error.js +44 -0
  98. package/dist/cjs/portal-node.d.ts +1 -0
  99. package/dist/cjs/portal-node.js +23 -0
  100. package/dist/cjs/prefetch-state.d.ts +8 -0
  101. package/dist/cjs/prefetch-state.js +27 -0
  102. package/dist/cjs/prefetch.d.ts +9 -0
  103. package/dist/cjs/prefetch.js +108 -0
  104. package/dist/cjs/random.d.ts +7 -0
  105. package/dist/cjs/random.js +42 -0
  106. package/dist/cjs/register-root.d.ts +4 -0
  107. package/dist/cjs/register-root.js +33 -0
  108. package/dist/cjs/series/flatten-children.d.ts +2 -0
  109. package/dist/cjs/series/flatten-children.js +19 -0
  110. package/dist/cjs/series/index.d.ts +13 -0
  111. package/dist/cjs/series/index.js +60 -0
  112. package/dist/cjs/setup-env-variables.d.ts +2 -0
  113. package/dist/cjs/setup-env-variables.js +36 -0
  114. package/dist/cjs/spring/index.d.ts +27 -0
  115. package/dist/cjs/spring/index.js +55 -0
  116. package/dist/cjs/spring/measure-spring.d.ts +8 -0
  117. package/dist/cjs/spring/measure-spring.js +64 -0
  118. package/dist/cjs/spring/spring-utils.d.ts +21 -0
  119. package/dist/cjs/spring/spring-utils.js +103 -0
  120. package/dist/cjs/static-file.d.ts +5 -0
  121. package/dist/cjs/static-file.js +33 -0
  122. package/dist/cjs/test/Img.test.d.ts +1 -0
  123. package/dist/cjs/test/Img.test.js +25 -0
  124. package/dist/cjs/test/absolute-src.test.d.ts +1 -0
  125. package/dist/cjs/test/absolute-src.test.js +18 -0
  126. package/dist/cjs/test/audio-for-rendering.test.d.ts +1 -0
  127. package/dist/cjs/test/audio-for-rendering.test.js +88 -0
  128. package/dist/cjs/test/audio.test.d.ts +1 -0
  129. package/dist/cjs/test/audio.test.js +76 -0
  130. package/dist/cjs/test/bezier.test.d.ts +1 -0
  131. package/dist/cjs/test/bezier.test.js +52 -0
  132. package/dist/cjs/test/composition-rules.test.d.ts +1 -0
  133. package/dist/cjs/test/composition-rules.test.js +30 -0
  134. package/dist/cjs/test/composition-validation.test.d.ts +1 -0
  135. package/dist/cjs/test/composition-validation.test.js +99 -0
  136. package/dist/cjs/test/easing.test.d.ts +1 -0
  137. package/dist/cjs/test/easing.test.js +191 -0
  138. package/dist/cjs/test/expect-to-throw.d.ts +1 -0
  139. package/dist/cjs/test/expect-to-throw.js +15 -0
  140. package/dist/cjs/test/freeze.test.d.ts +1 -0
  141. package/dist/cjs/test/freeze.test.js +65 -0
  142. package/dist/cjs/test/get-asset-file-name.test.d.ts +1 -0
  143. package/dist/cjs/test/get-asset-file-name.test.js +14 -0
  144. package/dist/cjs/test/get-current-time.test.d.ts +1 -0
  145. package/dist/cjs/test/get-current-time.test.js +74 -0
  146. package/dist/cjs/test/input-props.test.d.ts +1 -0
  147. package/dist/cjs/test/input-props.test.js +31 -0
  148. package/dist/cjs/test/interpolate.test.d.ts +1 -0
  149. package/dist/cjs/test/interpolate.test.js +138 -0
  150. package/dist/cjs/test/interpolateColors.test.d.ts +1 -0
  151. package/dist/cjs/test/interpolateColors.test.js +63 -0
  152. package/dist/cjs/test/loop-validation.test.d.ts +1 -0
  153. package/dist/cjs/test/loop-validation.test.js +93 -0
  154. package/dist/cjs/test/measure-spring.test.d.ts +1 -0
  155. package/dist/cjs/test/measure-spring.test.js +45 -0
  156. package/dist/cjs/test/media-validation.test.d.ts +1 -0
  157. package/dist/cjs/test/media-validation.test.js +47 -0
  158. package/dist/cjs/test/nested-sequences.test.d.ts +1 -0
  159. package/dist/cjs/test/nested-sequences.test.js +132 -0
  160. package/dist/cjs/test/not-all-props-in-media-tags.test.d.ts +1 -0
  161. package/dist/cjs/test/not-all-props-in-media-tags.test.js +33 -0
  162. package/dist/cjs/test/random.test.d.ts +1 -0
  163. package/dist/cjs/test/random.test.js +60 -0
  164. package/dist/cjs/test/ready-manager.test.d.ts +1 -0
  165. package/dist/cjs/test/ready-manager.test.js +29 -0
  166. package/dist/cjs/test/render-hook.d.ts +23 -0
  167. package/dist/cjs/test/render-hook.js +27 -0
  168. package/dist/cjs/test/sequence-from-initial-offset.test.d.ts +4 -0
  169. package/dist/cjs/test/sequence-from-initial-offset.test.js +35 -0
  170. package/dist/cjs/test/sequence-validation.test.d.ts +1 -0
  171. package/dist/cjs/test/sequence-validation.test.js +47 -0
  172. package/dist/cjs/test/series.test.d.ts +1 -0
  173. package/dist/cjs/test/series.test.js +115 -0
  174. package/dist/cjs/test/spring.test.d.ts +1 -0
  175. package/dist/cjs/test/spring.test.js +38 -0
  176. package/dist/cjs/test/truthy.test.d.ts +1 -0
  177. package/dist/cjs/test/truthy.test.js +24 -0
  178. package/dist/cjs/test/use-audio-frame.test.d.ts +1 -0
  179. package/dist/cjs/test/use-audio-frame.test.js +78 -0
  180. package/dist/cjs/test/use-media-in-timeline.test.d.ts +1 -0
  181. package/dist/cjs/test/use-media-in-timeline.test.js +74 -0
  182. package/dist/cjs/test/use-media-tag-volume.test.d.ts +1 -0
  183. package/dist/cjs/test/use-media-tag-volume.test.js +49 -0
  184. package/dist/cjs/test/use-sync-volume-with-media-tag.test.d.ts +1 -0
  185. package/dist/cjs/test/use-sync-volume-with-media-tag.test.js +55 -0
  186. package/dist/cjs/test/validate-start-from-props.test.d.ts +1 -0
  187. package/dist/cjs/test/validate-start-from-props.test.js +39 -0
  188. package/dist/cjs/test/video.test.d.ts +1 -0
  189. package/dist/cjs/test/video.test.js +80 -0
  190. package/dist/cjs/test/volume-prop.test.d.ts +1 -0
  191. package/dist/cjs/test/volume-prop.test.js +95 -0
  192. package/dist/cjs/test/wrap-sequence-context.d.ts +6 -0
  193. package/dist/cjs/test/wrap-sequence-context.js +41 -0
  194. package/dist/cjs/timeline-position-state.d.ts +29 -0
  195. package/dist/cjs/timeline-position-state.js +41 -0
  196. package/dist/cjs/truthy.d.ts +3 -0
  197. package/dist/cjs/truthy.js +7 -0
  198. package/dist/cjs/use-current-frame.d.ts +6 -0
  199. package/dist/cjs/use-current-frame.js +28 -0
  200. package/dist/cjs/use-lazy-component.d.ts +7 -0
  201. package/dist/cjs/use-lazy-component.js +49 -0
  202. package/dist/cjs/use-media-in-timeline.d.ts +10 -0
  203. package/dist/cjs/use-media-in-timeline.js +129 -0
  204. package/dist/cjs/use-media-playback.d.ts +10 -0
  205. package/dist/cjs/use-media-playback.js +77 -0
  206. package/dist/cjs/use-media-tag-volume.d.ts +2 -0
  207. package/dist/cjs/use-media-tag-volume.js +31 -0
  208. package/dist/cjs/use-sync-volume-with-media-tag.d.ts +10 -0
  209. package/dist/cjs/use-sync-volume-with-media-tag.js +21 -0
  210. package/dist/cjs/use-unsafe-video-config.d.ts +2 -0
  211. package/dist/cjs/use-unsafe-video-config.js +27 -0
  212. package/dist/cjs/use-video-config.d.ts +7 -0
  213. package/dist/cjs/use-video-config.js +29 -0
  214. package/dist/cjs/use-video.d.ts +13 -0
  215. package/dist/cjs/use-video.js +28 -0
  216. package/dist/cjs/validate-frame.d.ts +1 -0
  217. package/dist/cjs/validate-frame.js +24 -0
  218. package/dist/cjs/validate-media-props.d.ts +4 -0
  219. package/dist/cjs/validate-media-props.js +24 -0
  220. package/dist/cjs/validate-start-from-props.d.ts +1 -0
  221. package/dist/cjs/validate-start-from-props.js +31 -0
  222. package/dist/cjs/validation/validate-composition-id.d.ts +3 -0
  223. package/dist/cjs/validation/validate-composition-id.js +13 -0
  224. package/dist/cjs/validation/validate-dimensions.d.ts +1 -0
  225. package/dist/cjs/validation/validate-dimensions.js +21 -0
  226. package/dist/cjs/validation/validate-duration-in-frames.d.ts +1 -0
  227. package/dist/cjs/validation/validate-duration-in-frames.js +15 -0
  228. package/dist/cjs/validation/validate-folder-name.d.ts +3 -0
  229. package/dist/cjs/validation/validate-folder-name.js +19 -0
  230. package/dist/cjs/validation/validate-fps.d.ts +1 -0
  231. package/dist/cjs/validation/validate-fps.js +21 -0
  232. package/dist/cjs/validation/validate-offthreadvideo-image-format.d.ts +1 -0
  233. package/dist/cjs/validation/validate-offthreadvideo-image-format.js +15 -0
  234. package/dist/cjs/validation/validation-spring-duration.d.ts +1 -0
  235. package/dist/cjs/validation/validation-spring-duration.js +21 -0
  236. package/dist/cjs/version.d.ts +1 -0
  237. package/dist/cjs/version.js +5 -0
  238. package/dist/cjs/video/OffthreadVideo.d.ts +3 -0
  239. package/dist/cjs/video/OffthreadVideo.js +33 -0
  240. package/dist/cjs/video/OffthreadVideoForRendering.d.ts +3 -0
  241. package/dist/cjs/video/OffthreadVideoForRendering.js +104 -0
  242. package/dist/cjs/video/Video.d.ts +8 -0
  243. package/dist/cjs/video/Video.js +50 -0
  244. package/dist/cjs/video/VideoForDevelopment.d.ts +11 -0
  245. package/dist/cjs/video/VideoForDevelopment.js +113 -0
  246. package/dist/cjs/video/VideoForRendering.d.ts +10 -0
  247. package/dist/cjs/video/VideoForRendering.js +203 -0
  248. package/dist/cjs/video/duration-state.d.ts +17 -0
  249. package/dist/cjs/video/duration-state.js +34 -0
  250. package/dist/cjs/video/get-current-time.d.ts +13 -0
  251. package/dist/cjs/video/get-current-time.js +31 -0
  252. package/dist/cjs/video/index.d.ts +3 -0
  253. package/dist/cjs/video/index.js +7 -0
  254. package/dist/cjs/video/props.d.ts +25 -0
  255. package/dist/cjs/video/props.js +2 -0
  256. package/dist/cjs/video/video-fragment.d.ts +12 -0
  257. package/dist/cjs/video/video-fragment.js +60 -0
  258. package/dist/cjs/video-config.d.ts +8 -0
  259. package/dist/cjs/video-config.js +2 -0
  260. package/dist/cjs/volume-position-state.d.ts +19 -0
  261. package/dist/cjs/volume-position-state.js +32 -0
  262. package/dist/cjs/volume-prop.d.ts +7 -0
  263. package/dist/cjs/volume-prop.js +24 -0
  264. package/dist/cjs/warn-about-non-seekable-media.d.ts +1 -0
  265. package/dist/cjs/warn-about-non-seekable-media.js +34 -0
  266. package/dist/cjs/wrap-remotion-context.d.ts +18 -0
  267. package/dist/cjs/wrap-remotion-context.js +73 -0
  268. package/dist/esm/AbsoluteFill.d.ts +6 -0
  269. package/dist/esm/AbsoluteFill.js +25 -0
  270. package/dist/esm/CanUseRemotionHooks.d.ts +5 -0
  271. package/dist/esm/CanUseRemotionHooks.js +6 -0
  272. package/dist/esm/Clipper.d.ts +7 -0
  273. package/dist/esm/Clipper.js +20 -0
  274. package/dist/esm/Composition.d.ts +23 -0
  275. package/dist/esm/Composition.js +108 -0
  276. package/dist/esm/CompositionManager.d.ts +82 -0
  277. package/dist/esm/CompositionManager.js +137 -0
  278. package/dist/esm/Folder.d.ts +15 -0
  279. package/dist/esm/Folder.js +29 -0
  280. package/dist/esm/IFrame.d.ts +2 -0
  281. package/dist/esm/IFrame.js +21 -0
  282. package/dist/esm/Img.d.ts +2 -0
  283. package/dist/esm/Img.js +49 -0
  284. package/dist/esm/NativeLayers.d.ts +13 -0
  285. package/dist/esm/NativeLayers.js +25 -0
  286. package/dist/esm/Null.d.ts +2 -0
  287. package/dist/esm/Null.js +21 -0
  288. package/dist/esm/RemotionRoot.d.ts +5 -0
  289. package/dist/esm/RemotionRoot.js +69 -0
  290. package/dist/esm/Sequence.d.ts +29 -0
  291. package/dist/esm/Sequence.js +128 -0
  292. package/dist/esm/Still.d.ts +3 -0
  293. package/dist/esm/Still.js +5 -0
  294. package/dist/esm/absolute-src.d.ts +1 -0
  295. package/dist/esm/absolute-src.js +3 -0
  296. package/dist/esm/asset-types.d.ts +50 -0
  297. package/dist/esm/asset-types.js +1 -0
  298. package/dist/esm/audio/Audio.d.ts +8 -0
  299. package/dist/esm/audio/Audio.js +49 -0
  300. package/dist/esm/audio/AudioForDevelopment.d.ts +11 -0
  301. package/dist/esm/audio/AudioForDevelopment.js +91 -0
  302. package/dist/esm/audio/AudioForRendering.d.ts +10 -0
  303. package/dist/esm/audio/AudioForRendering.js +108 -0
  304. package/dist/esm/audio/index.d.ts +2 -0
  305. package/dist/esm/audio/index.js +2 -0
  306. package/dist/esm/audio/props.d.ts +12 -0
  307. package/dist/esm/audio/props.js +1 -0
  308. package/dist/esm/audio/shared-audio-tags.d.ts +37 -0
  309. package/dist/esm/audio/shared-audio-tags.js +194 -0
  310. package/dist/esm/audio/use-audio-frame.d.ts +6 -0
  311. package/dist/esm/audio/use-audio-frame.js +18 -0
  312. package/dist/esm/bezier.d.ts +1 -0
  313. package/dist/esm/bezier.js +110 -0
  314. package/dist/esm/cancel-render.d.ts +1 -0
  315. package/dist/esm/cancel-render.js +39 -0
  316. package/dist/esm/config/input-props.d.ts +1 -0
  317. package/dist/esm/config/input-props.js +27 -0
  318. package/dist/esm/config.d.ts +285 -0
  319. package/dist/esm/config.js +17 -0
  320. package/dist/esm/default-css.d.ts +3 -0
  321. package/dist/esm/default-css.js +44 -0
  322. package/dist/esm/delay-render.d.ts +14 -0
  323. package/dist/esm/delay-render.js +72 -0
  324. package/dist/esm/easing.d.ts +19 -0
  325. package/dist/esm/easing.js +73 -0
  326. package/dist/esm/freeze.d.ts +7 -0
  327. package/dist/esm/freeze.js +30 -0
  328. package/dist/esm/get-asset-file-name.d.ts +1 -0
  329. package/dist/esm/get-asset-file-name.js +10 -0
  330. package/dist/esm/get-environment.d.ts +3 -0
  331. package/dist/esm/get-environment.js +29 -0
  332. package/dist/esm/get-preview-dom-element.d.ts +1 -0
  333. package/dist/esm/get-preview-dom-element.js +3 -0
  334. package/dist/esm/get-static-files.d.ts +17 -0
  335. package/dist/esm/get-static-files.js +27 -0
  336. package/dist/esm/get-timeline-clip-name.d.ts +1 -0
  337. package/dist/esm/get-timeline-clip-name.js +21 -0
  338. package/dist/esm/index.d.ts +92 -0
  339. package/dist/esm/index.js +41 -0
  340. package/dist/esm/internals.d.ts +99 -0
  341. package/dist/esm/internals.js +75 -0
  342. package/dist/esm/interpolate-colors.d.ts +5 -0
  343. package/dist/esm/interpolate-colors.js +397 -0
  344. package/dist/esm/interpolate.d.ts +18 -0
  345. package/dist/esm/interpolate.js +119 -0
  346. package/dist/esm/is-approximately-the-same.d.ts +1 -0
  347. package/dist/esm/is-approximately-the-same.js +4 -0
  348. package/dist/esm/is-player.d.ts +3 -0
  349. package/dist/esm/is-player.js +9 -0
  350. package/dist/esm/loading-indicator.d.ts +2 -0
  351. package/dist/esm/loading-indicator.js +31 -0
  352. package/dist/esm/loop/index.d.ts +9 -0
  353. package/dist/esm/loop/index.js +25 -0
  354. package/dist/esm/multiple-versions-warning.d.ts +1 -0
  355. package/dist/esm/multiple-versions-warning.js +28 -0
  356. package/dist/esm/nonce.d.ts +7 -0
  357. package/dist/esm/nonce.js +13 -0
  358. package/dist/esm/play-and-handle-not-allowed-error.d.ts +2 -0
  359. package/dist/esm/play-and-handle-not-allowed-error.js +40 -0
  360. package/dist/esm/portal-node.d.ts +1 -0
  361. package/dist/esm/portal-node.js +19 -0
  362. package/dist/esm/prefetch-state.d.ts +8 -0
  363. package/dist/esm/prefetch-state.js +22 -0
  364. package/dist/esm/prefetch.d.ts +9 -0
  365. package/dist/esm/prefetch.js +103 -0
  366. package/dist/esm/random.d.ts +7 -0
  367. package/dist/esm/random.js +38 -0
  368. package/dist/esm/register-root.d.ts +4 -0
  369. package/dist/esm/register-root.js +27 -0
  370. package/dist/esm/series/flatten-children.d.ts +2 -0
  371. package/dist/esm/series/flatten-children.js +12 -0
  372. package/dist/esm/series/index.d.ts +13 -0
  373. package/dist/esm/series/index.js +57 -0
  374. package/dist/esm/setup-env-variables.d.ts +2 -0
  375. package/dist/esm/setup-env-variables.js +32 -0
  376. package/dist/esm/spring/index.d.ts +27 -0
  377. package/dist/esm/spring/index.js +50 -0
  378. package/dist/esm/spring/measure-spring.d.ts +8 -0
  379. package/dist/esm/spring/measure-spring.js +60 -0
  380. package/dist/esm/spring/spring-utils.d.ts +21 -0
  381. package/dist/esm/spring/spring-utils.js +99 -0
  382. package/dist/esm/static-file.d.ts +5 -0
  383. package/dist/esm/static-file.js +29 -0
  384. package/dist/esm/test/Img.test.d.ts +1 -0
  385. package/dist/esm/test/Img.test.js +20 -0
  386. package/dist/esm/test/absolute-src.test.d.ts +1 -0
  387. package/dist/esm/test/absolute-src.test.js +16 -0
  388. package/dist/esm/test/audio-for-rendering.test.d.ts +1 -0
  389. package/dist/esm/test/audio-for-rendering.test.js +83 -0
  390. package/dist/esm/test/audio.test.d.ts +1 -0
  391. package/dist/esm/test/audio.test.js +51 -0
  392. package/dist/esm/test/bezier.test.d.ts +1 -0
  393. package/dist/esm/test/bezier.test.js +50 -0
  394. package/dist/esm/test/composition-rules.test.d.ts +1 -0
  395. package/dist/esm/test/composition-rules.test.js +28 -0
  396. package/dist/esm/test/composition-validation.test.d.ts +1 -0
  397. package/dist/esm/test/composition-validation.test.js +97 -0
  398. package/dist/esm/test/easing.test.d.ts +1 -0
  399. package/dist/esm/test/easing.test.js +189 -0
  400. package/dist/esm/test/expect-to-throw.d.ts +1 -0
  401. package/dist/esm/test/expect-to-throw.js +11 -0
  402. package/dist/esm/test/freeze.test.d.ts +1 -0
  403. package/dist/esm/test/freeze.test.js +63 -0
  404. package/dist/esm/test/get-asset-file-name.test.d.ts +1 -0
  405. package/dist/esm/test/get-asset-file-name.test.js +12 -0
  406. package/dist/esm/test/get-current-time.test.d.ts +1 -0
  407. package/dist/esm/test/get-current-time.test.js +72 -0
  408. package/dist/esm/test/input-props.test.d.ts +1 -0
  409. package/dist/esm/test/input-props.test.js +29 -0
  410. package/dist/esm/test/interpolate.test.d.ts +1 -0
  411. package/dist/esm/test/interpolate.test.js +136 -0
  412. package/dist/esm/test/interpolateColors.test.d.ts +1 -0
  413. package/dist/esm/test/interpolateColors.test.js +61 -0
  414. package/dist/esm/test/loop-validation.test.d.ts +1 -0
  415. package/dist/esm/test/loop-validation.test.js +68 -0
  416. package/dist/esm/test/measure-spring.test.d.ts +1 -0
  417. package/dist/esm/test/measure-spring.test.js +43 -0
  418. package/dist/esm/test/media-validation.test.d.ts +1 -0
  419. package/dist/esm/test/media-validation.test.js +45 -0
  420. package/dist/esm/test/nested-sequences.test.d.ts +1 -0
  421. package/dist/esm/test/nested-sequences.test.js +130 -0
  422. package/dist/esm/test/not-all-props-in-media-tags.test.d.ts +1 -0
  423. package/dist/esm/test/not-all-props-in-media-tags.test.js +28 -0
  424. package/dist/esm/test/random.test.d.ts +1 -0
  425. package/dist/esm/test/random.test.js +58 -0
  426. package/dist/esm/test/ready-manager.test.d.ts +1 -0
  427. package/dist/esm/test/ready-manager.test.js +27 -0
  428. package/dist/esm/test/render-hook.d.ts +23 -0
  429. package/dist/esm/test/render-hook.js +20 -0
  430. package/dist/esm/test/sequence-from-initial-offset.test.d.ts +4 -0
  431. package/dist/esm/test/sequence-from-initial-offset.test.js +33 -0
  432. package/dist/esm/test/sequence-validation.test.d.ts +1 -0
  433. package/dist/esm/test/sequence-validation.test.js +45 -0
  434. package/dist/esm/test/series.test.d.ts +1 -0
  435. package/dist/esm/test/series.test.js +113 -0
  436. package/dist/esm/test/spring.test.d.ts +1 -0
  437. package/dist/esm/test/spring.test.js +36 -0
  438. package/dist/esm/test/truthy.test.d.ts +1 -0
  439. package/dist/esm/test/truthy.test.js +22 -0
  440. package/dist/esm/test/use-audio-frame.test.d.ts +1 -0
  441. package/dist/esm/test/use-audio-frame.test.js +53 -0
  442. package/dist/esm/test/use-media-in-timeline.test.d.ts +1 -0
  443. package/dist/esm/test/use-media-in-timeline.test.js +49 -0
  444. package/dist/esm/test/use-media-tag-volume.test.d.ts +1 -0
  445. package/dist/esm/test/use-media-tag-volume.test.js +44 -0
  446. package/dist/esm/test/use-sync-volume-with-media-tag.test.d.ts +1 -0
  447. package/dist/esm/test/use-sync-volume-with-media-tag.test.js +53 -0
  448. package/dist/esm/test/validate-start-from-props.test.d.ts +1 -0
  449. package/dist/esm/test/validate-start-from-props.test.js +37 -0
  450. package/dist/esm/test/video.test.d.ts +1 -0
  451. package/dist/esm/test/video.test.js +55 -0
  452. package/dist/esm/test/volume-prop.test.d.ts +1 -0
  453. package/dist/esm/test/volume-prop.test.js +93 -0
  454. package/dist/esm/test/wrap-sequence-context.d.ts +6 -0
  455. package/dist/esm/test/wrap-sequence-context.js +37 -0
  456. package/dist/esm/timeline-position-state.d.ts +29 -0
  457. package/dist/esm/timeline-position-state.js +35 -0
  458. package/dist/esm/truthy.d.ts +3 -0
  459. package/dist/esm/truthy.js +3 -0
  460. package/dist/esm/use-current-frame.d.ts +6 -0
  461. package/dist/esm/use-current-frame.js +24 -0
  462. package/dist/esm/use-lazy-component.d.ts +7 -0
  463. package/dist/esm/use-lazy-component.js +22 -0
  464. package/dist/esm/use-media-in-timeline.d.ts +10 -0
  465. package/dist/esm/use-media-in-timeline.js +125 -0
  466. package/dist/esm/use-media-playback.d.ts +10 -0
  467. package/dist/esm/use-media-playback.js +73 -0
  468. package/dist/esm/use-media-tag-volume.d.ts +2 -0
  469. package/dist/esm/use-media-tag-volume.js +27 -0
  470. package/dist/esm/use-sync-volume-with-media-tag.d.ts +10 -0
  471. package/dist/esm/use-sync-volume-with-media-tag.js +17 -0
  472. package/dist/esm/use-unsafe-video-config.d.ts +2 -0
  473. package/dist/esm/use-unsafe-video-config.js +23 -0
  474. package/dist/esm/use-video-config.d.ts +7 -0
  475. package/dist/esm/use-video-config.js +25 -0
  476. package/dist/esm/use-video.d.ts +13 -0
  477. package/dist/esm/use-video.js +24 -0
  478. package/dist/esm/validate-frame.d.ts +1 -0
  479. package/dist/esm/validate-frame.js +20 -0
  480. package/dist/esm/validate-media-props.d.ts +4 -0
  481. package/dist/esm/validate-media-props.js +20 -0
  482. package/dist/esm/validate-start-from-props.d.ts +1 -0
  483. package/dist/esm/validate-start-from-props.js +27 -0
  484. package/dist/esm/validation/validate-composition-id.d.ts +3 -0
  485. package/dist/esm/validation/validate-composition-id.js +8 -0
  486. package/dist/esm/validation/validate-dimensions.d.ts +1 -0
  487. package/dist/esm/validation/validate-dimensions.js +17 -0
  488. package/dist/esm/validation/validate-duration-in-frames.d.ts +1 -0
  489. package/dist/esm/validation/validate-duration-in-frames.js +11 -0
  490. package/dist/esm/validation/validate-folder-name.d.ts +3 -0
  491. package/dist/esm/validation/validate-folder-name.js +14 -0
  492. package/dist/esm/validation/validate-fps.d.ts +1 -0
  493. package/dist/esm/validation/validate-fps.js +17 -0
  494. package/dist/esm/validation/validate-offthreadvideo-image-format.d.ts +1 -0
  495. package/dist/esm/validation/validate-offthreadvideo-image-format.js +11 -0
  496. package/dist/esm/validation/validation-spring-duration.d.ts +1 -0
  497. package/dist/esm/validation/validation-spring-duration.js +17 -0
  498. package/dist/esm/version.d.ts +1 -0
  499. package/dist/esm/version.js +2 -0
  500. package/dist/esm/video/OffthreadVideo.d.ts +3 -0
  501. package/dist/esm/video/OffthreadVideo.js +29 -0
  502. package/dist/esm/video/OffthreadVideoForRendering.d.ts +3 -0
  503. package/dist/esm/video/OffthreadVideoForRendering.js +100 -0
  504. package/dist/esm/video/Video.d.ts +8 -0
  505. package/dist/esm/video/Video.js +47 -0
  506. package/dist/esm/video/VideoForDevelopment.d.ts +11 -0
  507. package/dist/esm/video/VideoForDevelopment.js +110 -0
  508. package/dist/esm/video/VideoForRendering.d.ts +10 -0
  509. package/dist/esm/video/VideoForRendering.js +200 -0
  510. package/dist/esm/video/duration-state.d.ts +17 -0
  511. package/dist/esm/video/duration-state.js +29 -0
  512. package/dist/esm/video/get-current-time.d.ts +13 -0
  513. package/dist/esm/video/get-current-time.js +26 -0
  514. package/dist/esm/video/index.d.ts +3 -0
  515. package/dist/esm/video/index.js +2 -0
  516. package/dist/esm/video/props.d.ts +25 -0
  517. package/dist/esm/video/props.js +1 -0
  518. package/dist/esm/video/video-fragment.d.ts +12 -0
  519. package/dist/esm/video/video-fragment.js +55 -0
  520. package/dist/esm/video-config.d.ts +8 -0
  521. package/dist/esm/video-config.js +1 -0
  522. package/dist/esm/volume-position-state.d.ts +19 -0
  523. package/dist/esm/volume-position-state.js +27 -0
  524. package/dist/esm/volume-prop.d.ts +7 -0
  525. package/dist/esm/volume-prop.js +20 -0
  526. package/dist/esm/warn-about-non-seekable-media.d.ts +1 -0
  527. package/dist/esm/warn-about-non-seekable-media.js +30 -0
  528. package/dist/esm/wrap-remotion-context.d.ts +18 -0
  529. package/dist/esm/wrap-remotion-context.js +45 -0
  530. package/dist/internals.d.ts +0 -1
  531. package/dist/series/index.js +5 -2
  532. package/dist/tsconfig-cjs.tsbuildinfo +1 -0
  533. package/dist/use-video.d.ts +0 -1
  534. package/dist/version.d.ts +1 -1
  535. package/dist/version.js +1 -1
  536. package/dist/video/Video.d.ts +1 -1
  537. package/dist/video/VideoForDevelopment.d.ts +1 -1
  538. package/dist/video/VideoForRendering.d.ts +1 -1
  539. package/package.json +23 -12
  540. package/tsconfig-cjs.json +11 -0
  541. package/tsconfig.json +3 -3
  542. package/dist/LayerMaster.d.ts +0 -8
  543. package/dist/LayerMaster.js +0 -39
  544. package/dist/Satori.d.ts +0 -5
  545. package/dist/Satori.js +0 -92
  546. package/dist/get-compositions-from-markup.d.ts +0 -3
  547. package/dist/get-compositions-from-markup.js +0 -19
  548. package/dist/layers.d.ts +0 -24
  549. package/dist/layers.js +0 -149
  550. package/dist/video/NativeVideo.d.ts +0 -5
  551. package/dist/video/NativeVideo.js +0 -33
  552. package/dist/video/NativeVideoForRendering.d.ts +0 -8
  553. package/dist/video/NativeVideoForRendering.js +0 -14
@@ -0,0 +1,2 @@
1
+ import type { RefObject } from 'react';
2
+ export declare const playAndHandleNotAllowedError: (mediaRef: RefObject<HTMLVideoElement | HTMLAudioElement>, mediaType: 'audio' | 'video') => void;
@@ -0,0 +1,40 @@
1
+ export const playAndHandleNotAllowedError = (mediaRef, mediaType) => {
2
+ const { current } = mediaRef;
3
+ if (!current) {
4
+ return;
5
+ }
6
+ const prom = current.play();
7
+ if (prom.catch) {
8
+ prom.catch((err) => {
9
+ if (!current) {
10
+ return;
11
+ }
12
+ // Pause was called after play in Chrome
13
+ if (err.message.includes('request was interrupted by a call to pause')) {
14
+ return;
15
+ }
16
+ // Pause was called after play in Safari
17
+ if (err.message.includes('The operation was aborted.')) {
18
+ return;
19
+ }
20
+ // Pause was called after play in Firefox
21
+ if (err.message.includes('The fetching process for the media resource was aborted by the user agent')) {
22
+ return;
23
+ }
24
+ // Got replaced by a different audio source in Chromium
25
+ if (err.message.includes('request was interrupted by a new load request')) {
26
+ return;
27
+ }
28
+ // Audio tag got unmounted
29
+ if (err.message.includes('because the media was removed from the document')) {
30
+ return;
31
+ }
32
+ console.log(`Could not play ${mediaType} due to following error: `, err);
33
+ if (!current.muted) {
34
+ console.log(`The video will be muted and we'll retry playing it.`, err);
35
+ current.muted = true;
36
+ current.play();
37
+ }
38
+ });
39
+ }
40
+ };
@@ -0,0 +1 @@
1
+ export declare const portalNode: () => HTMLElement;
@@ -0,0 +1,19 @@
1
+ let _portalNode = null;
2
+ export const portalNode = () => {
3
+ if (!_portalNode) {
4
+ if (typeof document === 'undefined') {
5
+ throw new Error('Tried to call an API that only works in the browser from outside the browser');
6
+ }
7
+ _portalNode = document.createElement('div');
8
+ _portalNode.style.position = 'absolute';
9
+ _portalNode.style.top = '0px';
10
+ _portalNode.style.left = '0px';
11
+ _portalNode.style.right = '0px';
12
+ _portalNode.style.bottom = '0px';
13
+ _portalNode.style.width = '100%';
14
+ _portalNode.style.height = '100%';
15
+ _portalNode.style.display = 'flex';
16
+ _portalNode.style.flexDirection = 'column';
17
+ }
18
+ return _portalNode;
19
+ };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ declare type Value = Record<string, string>;
3
+ export declare const PreloadContext: React.Context<Value>;
4
+ export declare const setPreloads: (updater: (p: Value) => Value) => void;
5
+ export declare const PrefetchProvider: React.FC<{
6
+ children: React.ReactNode;
7
+ }>;
8
+ export {};
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useEffect, useState } from 'react';
3
+ export const PreloadContext = createContext({});
4
+ let preloads = {};
5
+ let updaters = [];
6
+ export const setPreloads = (updater) => {
7
+ preloads = updater(preloads);
8
+ updaters.forEach((u) => u());
9
+ };
10
+ export const PrefetchProvider = ({ children }) => {
11
+ const [_preloads, _setPreloads] = useState(() => preloads);
12
+ useEffect(() => {
13
+ const updaterFunction = () => {
14
+ _setPreloads(preloads);
15
+ };
16
+ updaters.push(updaterFunction);
17
+ return () => {
18
+ updaters = updaters.filter((u) => u !== updaterFunction);
19
+ };
20
+ }, []);
21
+ return (_jsx(PreloadContext.Provider, { value: _preloads, children: children }));
22
+ };
@@ -0,0 +1,9 @@
1
+ export declare const usePreload: (src: string) => string;
2
+ declare type FetchAndPreload = {
3
+ free: () => void;
4
+ waitUntilDone: () => Promise<string>;
5
+ };
6
+ export declare const prefetch: (src: string, options?: {
7
+ method?: 'blob-url' | 'base64';
8
+ }) => FetchAndPreload;
9
+ export {};
@@ -0,0 +1,103 @@
1
+ import { useContext } from 'react';
2
+ import { getRemotionEnvironment } from './get-environment.js';
3
+ import { PreloadContext, setPreloads } from './prefetch-state.js';
4
+ export const usePreload = (src) => {
5
+ var _a;
6
+ const preloads = useContext(PreloadContext);
7
+ return (_a = preloads[src]) !== null && _a !== void 0 ? _a : src;
8
+ };
9
+ const blobToBase64 = function (blob) {
10
+ const reader = new FileReader();
11
+ return new Promise((resolve, reject) => {
12
+ reader.onload = function () {
13
+ const dataUrl = reader.result;
14
+ resolve(dataUrl);
15
+ };
16
+ reader.onerror = (err) => {
17
+ return reject(err);
18
+ };
19
+ reader.readAsDataURL(blob);
20
+ });
21
+ };
22
+ export const prefetch = (src, options) => {
23
+ var _a;
24
+ const method = (_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : 'blob-url';
25
+ if (getRemotionEnvironment() === 'rendering') {
26
+ return {
27
+ free: () => undefined,
28
+ waitUntilDone: () => Promise.resolve(src),
29
+ };
30
+ }
31
+ let canceled = false;
32
+ let objectUrl = null;
33
+ let resolve = () => undefined;
34
+ let reject = () => undefined;
35
+ const waitUntilDone = new Promise((res, rej) => {
36
+ resolve = res;
37
+ reject = rej;
38
+ });
39
+ const controller = new AbortController();
40
+ let canBeAborted = true;
41
+ fetch(src, {
42
+ signal: controller.signal,
43
+ })
44
+ .then((res) => {
45
+ canBeAborted = false;
46
+ if (canceled) {
47
+ return null;
48
+ }
49
+ if (!res.ok) {
50
+ throw new Error(`HTTP error, status = ${res.status}`);
51
+ }
52
+ return res.blob();
53
+ })
54
+ .then((buf) => {
55
+ if (!buf) {
56
+ return;
57
+ }
58
+ if (method === 'base64') {
59
+ return blobToBase64(buf);
60
+ }
61
+ return URL.createObjectURL(buf);
62
+ })
63
+ .then((url) => {
64
+ if (canceled) {
65
+ return;
66
+ }
67
+ objectUrl = url;
68
+ setPreloads((p) => ({
69
+ ...p,
70
+ [src]: objectUrl,
71
+ }));
72
+ resolve(objectUrl);
73
+ })
74
+ .catch((err) => {
75
+ reject(err);
76
+ });
77
+ return {
78
+ free: () => {
79
+ if (objectUrl) {
80
+ if (method === 'blob-url') {
81
+ URL.revokeObjectURL(objectUrl);
82
+ }
83
+ setPreloads((p) => {
84
+ const copy = { ...p };
85
+ delete copy[src];
86
+ return copy;
87
+ });
88
+ }
89
+ else {
90
+ canceled = true;
91
+ if (canBeAborted) {
92
+ try {
93
+ controller.abort();
94
+ }
95
+ catch (e) { }
96
+ }
97
+ }
98
+ },
99
+ waitUntilDone: () => {
100
+ return waitUntilDone;
101
+ },
102
+ };
103
+ };
@@ -0,0 +1,7 @@
1
+ export declare type RandomSeed = number | string | null;
2
+ /**
3
+ * A deterministic pseudo-random number generator.
4
+ * Pass in the same seed and get the same pseudorandom number.
5
+ * See: https://remotion.dev/docs/random
6
+ */
7
+ export declare const random: (seed: RandomSeed, dummy?: unknown) => number;
@@ -0,0 +1,38 @@
1
+ /* eslint-disable no-bitwise */
2
+ function mulberry32(a) {
3
+ let t = a + 0x6d2b79f5;
4
+ t = Math.imul(t ^ (t >>> 15), t | 1);
5
+ t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
6
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
7
+ }
8
+ function hashCode(str) {
9
+ let i = 0;
10
+ let chr = 0;
11
+ let hash = 0;
12
+ for (i = 0; i < str.length; i++) {
13
+ chr = str.charCodeAt(i);
14
+ hash = (hash << 5) - hash + chr;
15
+ hash |= 0; // Convert to 32bit integer
16
+ }
17
+ return hash;
18
+ }
19
+ /**
20
+ * A deterministic pseudo-random number generator.
21
+ * Pass in the same seed and get the same pseudorandom number.
22
+ * See: https://remotion.dev/docs/random
23
+ */
24
+ export const random = (seed, dummy) => {
25
+ if (dummy !== undefined) {
26
+ throw new TypeError('random() takes only one argument');
27
+ }
28
+ if (seed === null) {
29
+ return Math.random();
30
+ }
31
+ if (typeof seed === 'string') {
32
+ return mulberry32(hashCode(seed));
33
+ }
34
+ if (typeof seed === 'number') {
35
+ return mulberry32(seed * 10000000000);
36
+ }
37
+ throw new Error('random() argument must be a number or a string');
38
+ };
@@ -0,0 +1,4 @@
1
+ import type React from 'react';
2
+ export declare const registerRoot: (comp: React.FC) => void;
3
+ export declare const getRoot: () => React.FC<{}> | null;
4
+ export declare const waitForRoot: (fn: (comp: React.FC) => void) => (() => void);
@@ -0,0 +1,27 @@
1
+ let Root = null;
2
+ let listeners = [];
3
+ export const registerRoot = (comp) => {
4
+ if (!comp) {
5
+ throw new Error(`You must pass a React component to registerRoot(), but ${JSON.stringify(comp)} was passed.`);
6
+ }
7
+ if (Root) {
8
+ throw new Error('registerRoot() was called more than once.');
9
+ }
10
+ Root = comp;
11
+ listeners.forEach((l) => {
12
+ l(comp);
13
+ });
14
+ };
15
+ export const getRoot = () => {
16
+ return Root;
17
+ };
18
+ export const waitForRoot = (fn) => {
19
+ if (Root) {
20
+ fn(Root);
21
+ return () => undefined;
22
+ }
23
+ listeners.push(fn);
24
+ return () => {
25
+ listeners = listeners.filter((l) => l !== fn);
26
+ };
27
+ };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const flattenChildren: (children: React.ReactNode) => (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal)[];
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export const flattenChildren = (children) => {
3
+ const childrenArray = React.Children.toArray(children);
4
+ return childrenArray.reduce((flatChildren, child) => {
5
+ if (child.type === React.Fragment) {
6
+ return flatChildren.concat(flattenChildren(child.props
7
+ .children));
8
+ }
9
+ flatChildren.push(child);
10
+ return flatChildren;
11
+ }, []);
12
+ };
@@ -0,0 +1,13 @@
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ import type { LayoutAndStyle, SequenceProps } from '../Sequence.js';
3
+ declare type SeriesSequenceProps = PropsWithChildren<{
4
+ durationInFrames: number;
5
+ offset?: number;
6
+ } & Pick<SequenceProps, 'layout' | 'name'> & LayoutAndStyle>;
7
+ declare const SeriesSequence: import("react").ForwardRefExoticComponent<SeriesSequenceProps & import("react").RefAttributes<HTMLDivElement>>;
8
+ declare const Series: FC<{
9
+ children: React.ReactNode;
10
+ }> & {
11
+ Sequence: typeof SeriesSequence;
12
+ };
13
+ export { Series };
@@ -0,0 +1,57 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { Children, forwardRef, useMemo } from 'react';
3
+ import { Sequence } from '../Sequence.js';
4
+ import { validateDurationInFrames } from '../validation/validate-duration-in-frames.js';
5
+ import { flattenChildren } from './flatten-children.js';
6
+ const SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
7
+ // Discard ref
8
+ // eslint-disable-next-line react/jsx-no-useless-fragment
9
+ return _jsx(_Fragment, { children: children });
10
+ };
11
+ const SeriesSequence = forwardRef(SeriesSequenceRefForwardingFunction);
12
+ const Series = ({ children }) => {
13
+ const childrenValue = useMemo(() => {
14
+ let startFrame = 0;
15
+ const flattenedChildren = flattenChildren(children);
16
+ return Children.map(flattenedChildren, (child, i) => {
17
+ var _a;
18
+ const castedChild = child;
19
+ if (typeof castedChild === 'string') {
20
+ // Don't throw if it's just some accidential whitespace
21
+ if (castedChild.trim() === '') {
22
+ return null;
23
+ }
24
+ throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as it's children, but you passed a string "${castedChild}"`);
25
+ }
26
+ if (castedChild.type !== SeriesSequence) {
27
+ throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as it's children, but got ${castedChild} instead`);
28
+ }
29
+ const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
30
+ if (!castedChild || !castedChild.props.children) {
31
+ throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
32
+ }
33
+ const durationInFramesProp = castedChild.props.durationInFrames;
34
+ const { durationInFrames, children: _children, ...passedProps } = castedChild.props;
35
+ if (i !== flattenedChildren.length - 1 || durationInFramesProp !== Infinity) {
36
+ validateDurationInFrames(durationInFramesProp, `of a <Series.Sequence /> component`);
37
+ }
38
+ const offset = (_a = castedChild.props.offset) !== null && _a !== void 0 ? _a : 0;
39
+ if (Number.isNaN(offset)) {
40
+ throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
41
+ }
42
+ if (!Number.isFinite(offset)) {
43
+ throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
44
+ }
45
+ if (offset % 1 !== 0) {
46
+ throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
47
+ }
48
+ const currentStartFrame = startFrame + offset;
49
+ startFrame += durationInFramesProp + offset;
50
+ return (_jsx(Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, ref: castedChild.ref, children: child }));
51
+ });
52
+ }, [children]);
53
+ /* eslint-disable react/jsx-no-useless-fragment */
54
+ return _jsx(_Fragment, { children: childrenValue });
55
+ };
56
+ Series.Sequence = SeriesSequence;
57
+ export { Series };
@@ -0,0 +1,2 @@
1
+ export declare const ENV_VARIABLES_ENV_NAME: "ENV_VARIABLES";
2
+ export declare const setupEnvVariables: () => void;
@@ -0,0 +1,32 @@
1
+ import { getRemotionEnvironment } from './get-environment.js';
2
+ export const ENV_VARIABLES_ENV_NAME = 'ENV_VARIABLES';
3
+ const getEnvVariables = () => {
4
+ if (getRemotionEnvironment() === 'rendering') {
5
+ const param = window.remotion_envVariables;
6
+ if (!param) {
7
+ return {};
8
+ }
9
+ return { ...JSON.parse(param), NODE_ENV: process.env.NODE_ENV };
10
+ }
11
+ if (getRemotionEnvironment() === 'preview') {
12
+ // Webpack will convert this to an object at compile time.
13
+ // Don't convert this syntax to a computed property.
14
+ return {
15
+ ...process.env.ENV_VARIABLES,
16
+ NODE_ENV: process.env.NODE_ENV,
17
+ };
18
+ }
19
+ throw new Error('Can only call getEnvVariables() if environment is `rendering` or `preview`');
20
+ };
21
+ export const setupEnvVariables = () => {
22
+ const env = getEnvVariables();
23
+ if (!window.process) {
24
+ window.process = {};
25
+ }
26
+ if (!window.process.env) {
27
+ window.process.env = {};
28
+ }
29
+ Object.keys(env).forEach((key) => {
30
+ window.process.env[key] = env[key];
31
+ });
32
+ };
@@ -0,0 +1,27 @@
1
+ import type { SpringConfig } from './spring-utils.js';
2
+ /**
3
+ * Calculates a position based on physical parameters, start and end value, and time.
4
+ * @link https://www.remotion.dev/docs/spring
5
+ * @param {number} frame The current time value. Most of the time you want to pass in the return value of useCurrentFrame.
6
+ * @param {number} fps The framerate at which the animation runs. Pass in the value obtained by `useVideoConfig()`.
7
+ * @param {?Object} config optional object that allows you to customize the physical properties of the animation.
8
+ * @param {number} [config.mass=1] The weight of the spring. If you reduce the mass, the animation becomes faster!
9
+ * @param {number} [config.damping=10] How hard the animation decelerates.
10
+ * @param {number} [config.stiffness=100] Affects bounciness of the animation.
11
+ * @param {boolean} [config.overshootClamping=false] Whether to prevent the animation going beyond the target value.
12
+ * @param {?number} [config.from] The initial value of the animation. Default `0`
13
+ * @param {?number} [config.to] The end value of the animation. Default `1`
14
+ * @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
15
+ * @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
16
+ */
17
+ export declare function spring({ frame, fps, config, from, to, durationInFrames, durationRestThreshold, }: {
18
+ frame: number;
19
+ fps: number;
20
+ config?: Partial<SpringConfig>;
21
+ from?: number;
22
+ to?: number;
23
+ durationInFrames?: number;
24
+ durationRestThreshold?: number;
25
+ }): number;
26
+ export { measureSpring } from './measure-spring.js';
27
+ export { SpringConfig } from './spring-utils.js';
@@ -0,0 +1,50 @@
1
+ import { validateFrame } from '../validate-frame.js';
2
+ import { validateFps } from '../validation/validate-fps.js';
3
+ import { validateSpringDuration } from '../validation/validation-spring-duration.js';
4
+ import { measureSpring } from './measure-spring.js';
5
+ import { springCalculation } from './spring-utils.js';
6
+ /**
7
+ * Calculates a position based on physical parameters, start and end value, and time.
8
+ * @link https://www.remotion.dev/docs/spring
9
+ * @param {number} frame The current time value. Most of the time you want to pass in the return value of useCurrentFrame.
10
+ * @param {number} fps The framerate at which the animation runs. Pass in the value obtained by `useVideoConfig()`.
11
+ * @param {?Object} config optional object that allows you to customize the physical properties of the animation.
12
+ * @param {number} [config.mass=1] The weight of the spring. If you reduce the mass, the animation becomes faster!
13
+ * @param {number} [config.damping=10] How hard the animation decelerates.
14
+ * @param {number} [config.stiffness=100] Affects bounciness of the animation.
15
+ * @param {boolean} [config.overshootClamping=false] Whether to prevent the animation going beyond the target value.
16
+ * @param {?number} [config.from] The initial value of the animation. Default `0`
17
+ * @param {?number} [config.to] The end value of the animation. Default `1`
18
+ * @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
19
+ * @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
20
+ */
21
+ export function spring({ frame, fps, config = {}, from = 0, to = 1, durationInFrames, durationRestThreshold, }) {
22
+ validateSpringDuration(durationInFrames);
23
+ validateFrame(frame, Infinity);
24
+ validateFps(fps, 'to spring()', false);
25
+ const durationRatio = durationInFrames === undefined
26
+ ? 1
27
+ : durationInFrames /
28
+ measureSpring({
29
+ fps,
30
+ config,
31
+ from,
32
+ to,
33
+ threshold: durationRestThreshold,
34
+ });
35
+ const spr = springCalculation({
36
+ fps,
37
+ frame: frame / durationRatio,
38
+ config,
39
+ from,
40
+ to,
41
+ });
42
+ if (!config.overshootClamping) {
43
+ return spr.current;
44
+ }
45
+ if (to >= from) {
46
+ return Math.min(spr.current, to);
47
+ }
48
+ return Math.max(spr.current, to);
49
+ }
50
+ export { measureSpring } from './measure-spring.js';
@@ -0,0 +1,8 @@
1
+ import type { SpringConfig } from './spring-utils.js';
2
+ export declare function measureSpring({ fps, config, threshold, from, to, }: {
3
+ fps: number;
4
+ config?: Partial<SpringConfig>;
5
+ threshold?: number;
6
+ from?: number;
7
+ to?: number;
8
+ }): number;
@@ -0,0 +1,60 @@
1
+ import { validateFps } from '../validation/validate-fps.js';
2
+ import { springCalculation } from './spring-utils.js';
3
+ export function measureSpring({ fps, config = {}, threshold = 0.005, from = 0, to = 1, }) {
4
+ if (typeof threshold !== 'number') {
5
+ throw new TypeError(`threshold must be a number, got ${threshold} of type ${typeof threshold}`);
6
+ }
7
+ if (threshold === 0) {
8
+ return Infinity;
9
+ }
10
+ if (threshold === 1) {
11
+ return 0;
12
+ }
13
+ if (isNaN(threshold)) {
14
+ throw new TypeError('Threshold is NaN');
15
+ }
16
+ if (!Number.isFinite(threshold)) {
17
+ throw new TypeError('Threshold is not finite');
18
+ }
19
+ if (threshold < 0) {
20
+ throw new TypeError('Threshold is below 0');
21
+ }
22
+ validateFps(fps, 'to the measureSpring() function', false);
23
+ const range = Math.abs(from - to);
24
+ let frame = 0;
25
+ let finishedFrame = 0;
26
+ const calc = () => {
27
+ return springCalculation({
28
+ fps,
29
+ frame,
30
+ config,
31
+ from,
32
+ to,
33
+ });
34
+ };
35
+ let animation = calc();
36
+ const calcDifference = () => {
37
+ return (Math.abs(animation.current - animation.toValue) /
38
+ (range === 0 ? 1 : range));
39
+ };
40
+ let difference = calcDifference();
41
+ while (difference >= threshold) {
42
+ frame++;
43
+ animation = calc();
44
+ difference = calcDifference();
45
+ }
46
+ // Since spring is bouncy, just because it's under the threshold we
47
+ // cannot be sure it's done. We need to animate further until it stays in the
48
+ // threshold for, say, 20 frames.
49
+ finishedFrame = frame;
50
+ for (let i = 0; i < 20; i++) {
51
+ frame++;
52
+ animation = calc();
53
+ difference = calcDifference();
54
+ if (difference >= threshold) {
55
+ i = 0;
56
+ finishedFrame = frame + 1;
57
+ }
58
+ }
59
+ return finishedFrame;
60
+ }
@@ -0,0 +1,21 @@
1
+ declare type AnimationNode = {
2
+ lastTimestamp: number;
3
+ toValue: number;
4
+ current: number;
5
+ velocity: number;
6
+ prevPosition?: number;
7
+ };
8
+ export declare type SpringConfig = {
9
+ damping: number;
10
+ mass: number;
11
+ stiffness: number;
12
+ overshootClamping: boolean;
13
+ };
14
+ export declare function springCalculation({ from, to, frame, fps, config, }: {
15
+ from?: number;
16
+ to?: number;
17
+ frame: number;
18
+ fps: number;
19
+ config?: Partial<SpringConfig>;
20
+ }): AnimationNode;
21
+ export {};