remotion 3.3.53 → 3.3.55

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 (331) hide show
  1. package/dist/cjs/AbsoluteFill.d.ts +2 -2
  2. package/dist/cjs/AbsoluteFill.js +2 -2
  3. package/dist/cjs/Composition.d.ts +4 -0
  4. package/dist/cjs/Composition.js +4 -0
  5. package/dist/cjs/Folder.d.ts +4 -0
  6. package/dist/cjs/Folder.js +4 -0
  7. package/dist/cjs/IFrame.d.ts +4 -0
  8. package/dist/cjs/IFrame.js +4 -0
  9. package/dist/cjs/Img.d.ts +4 -0
  10. package/dist/cjs/Img.js +4 -0
  11. package/dist/cjs/Sequence.d.ts +2 -10
  12. package/dist/cjs/Sequence.js +6 -6
  13. package/dist/cjs/SequenceContext.d.ts +9 -0
  14. package/dist/cjs/SequenceContext.js +5 -0
  15. package/dist/cjs/Still.d.ts +4 -0
  16. package/dist/cjs/Still.js +4 -0
  17. package/dist/cjs/audio/Audio.d.ts +4 -0
  18. package/dist/cjs/audio/Audio.js +6 -2
  19. package/dist/cjs/audio/AudioForDevelopment.js +2 -2
  20. package/dist/cjs/audio/AudioForRendering.js +2 -2
  21. package/dist/cjs/audio/use-audio-frame.js +2 -2
  22. package/dist/cjs/cancel-render.d.ts +4 -0
  23. package/dist/cjs/cancel-render.js +4 -0
  24. package/dist/cjs/delay-render.d.ts +4 -4
  25. package/dist/cjs/delay-render.js +4 -4
  26. package/dist/cjs/easing.d.ts +4 -0
  27. package/dist/cjs/easing.js +4 -0
  28. package/dist/cjs/freeze.d.ts +4 -0
  29. package/dist/cjs/freeze.js +6 -2
  30. package/dist/cjs/get-static-files.d.ts +4 -0
  31. package/dist/cjs/get-static-files.js +4 -0
  32. package/dist/cjs/index.d.ts +16 -8
  33. package/dist/cjs/index.js +18 -10
  34. package/dist/cjs/internals.d.ts +5 -5
  35. package/dist/cjs/internals.js +4 -4
  36. package/dist/cjs/interpolate-colors.d.ts +4 -0
  37. package/dist/cjs/interpolate-colors.js +4 -0
  38. package/dist/cjs/interpolate.js +4 -0
  39. package/dist/cjs/loop/index.d.ts +4 -0
  40. package/dist/cjs/loop/index.js +4 -0
  41. package/dist/cjs/prefetch.d.ts +4 -0
  42. package/dist/cjs/prefetch.js +4 -0
  43. package/dist/cjs/random.d.ts +2 -3
  44. package/dist/cjs/random.js +2 -3
  45. package/dist/cjs/register-root.d.ts +4 -0
  46. package/dist/cjs/register-root.js +4 -0
  47. package/dist/cjs/series/index.d.ts +4 -0
  48. package/dist/cjs/series/index.js +4 -0
  49. package/dist/cjs/spring/index.d.ts +2 -2
  50. package/dist/cjs/spring/index.js +2 -2
  51. package/dist/cjs/spring/measure-spring.d.ts +4 -0
  52. package/dist/cjs/spring/measure-spring.js +4 -0
  53. package/dist/cjs/static-file.d.ts +2 -2
  54. package/dist/cjs/static-file.js +2 -2
  55. package/dist/cjs/use-current-frame.d.ts +2 -3
  56. package/dist/cjs/use-current-frame.js +4 -5
  57. package/dist/cjs/use-media-in-timeline.js +2 -2
  58. package/dist/cjs/use-unsafe-video-config.js +2 -2
  59. package/dist/cjs/use-video-config.d.ts +4 -3
  60. package/dist/cjs/use-video-config.js +4 -3
  61. package/dist/cjs/validate-media-props.d.ts +2 -2
  62. package/dist/cjs/version.d.ts +1 -1
  63. package/dist/cjs/version.js +1 -1
  64. package/dist/cjs/video/OffthreadVideo.d.ts +4 -0
  65. package/dist/cjs/video/OffthreadVideo.js +4 -0
  66. package/dist/cjs/video/OffthreadVideoForRendering.js +2 -2
  67. package/dist/cjs/video/Video.d.ts +4 -0
  68. package/dist/cjs/video/Video.js +6 -2
  69. package/dist/cjs/video/VideoForDevelopment.js +2 -2
  70. package/dist/cjs/video/VideoForRendering.js +2 -2
  71. package/dist/cjs/wrap-remotion-context.d.ts +1 -1
  72. package/dist/cjs/wrap-remotion-context.js +3 -3
  73. package/dist/esm/AbsoluteFill.js +2 -2
  74. package/dist/esm/Composition.js +4 -0
  75. package/dist/esm/Folder.js +4 -0
  76. package/dist/esm/IFrame.js +4 -0
  77. package/dist/esm/Img.js +4 -0
  78. package/dist/esm/Sequence.js +5 -5
  79. package/dist/esm/SequenceContext.js +2 -0
  80. package/dist/esm/Still.js +4 -0
  81. package/dist/esm/audio/Audio.js +5 -1
  82. package/dist/esm/audio/AudioForDevelopment.js +1 -1
  83. package/dist/esm/audio/AudioForRendering.js +1 -1
  84. package/dist/esm/audio/use-audio-frame.js +1 -1
  85. package/dist/esm/cancel-render.js +4 -0
  86. package/dist/esm/delay-render.js +4 -4
  87. package/dist/esm/easing.js +4 -0
  88. package/dist/esm/freeze.js +5 -1
  89. package/dist/esm/get-static-files.js +4 -0
  90. package/dist/esm/index.js +15 -7
  91. package/dist/esm/index.mjs +4070 -0
  92. package/dist/esm/internals.js +2 -2
  93. package/dist/esm/interpolate-colors.js +4 -0
  94. package/dist/esm/interpolate.js +4 -0
  95. package/dist/esm/loop/index.js +4 -0
  96. package/dist/esm/prefetch.js +4 -0
  97. package/dist/esm/random.js +2 -3
  98. package/dist/esm/register-root.js +4 -0
  99. package/dist/esm/series/index.js +4 -0
  100. package/dist/esm/spring/index.js +2 -2
  101. package/dist/esm/spring/measure-spring.js +4 -0
  102. package/dist/esm/static-file.js +2 -2
  103. package/dist/esm/test/audio.test.js +1 -1
  104. package/dist/esm/test/composition-validation.test.js +1 -1
  105. package/dist/esm/test/loop-validation.test.js +1 -1
  106. package/dist/esm/test/measure-spring.test.js +1 -1
  107. package/dist/esm/test/series.test.js +1 -1
  108. package/dist/esm/test/spring.test.js +1 -1
  109. package/dist/esm/test/use-audio-frame.test.js +1 -1
  110. package/dist/esm/test/video.test.js +1 -1
  111. package/dist/esm/use-current-frame.js +3 -4
  112. package/dist/esm/use-media-in-timeline.js +1 -1
  113. package/dist/esm/use-unsafe-video-config.js +1 -1
  114. package/dist/esm/use-video-config.js +4 -3
  115. package/dist/esm/version.js +1 -1
  116. package/dist/esm/version.mjs +4 -0
  117. package/dist/esm/video/OffthreadVideo.js +4 -0
  118. package/dist/esm/video/OffthreadVideoForRendering.js +1 -1
  119. package/dist/esm/video/Video.js +5 -1
  120. package/dist/esm/video/VideoForDevelopment.js +1 -1
  121. package/dist/esm/video/VideoForRendering.js +1 -1
  122. package/dist/esm/wrap-remotion-context.js +2 -2
  123. package/package.json +11 -9
  124. package/version.js +2 -0
  125. package/.prettierrc.js +0 -14
  126. package/dist/cjs/test/Img.test.d.ts +0 -1
  127. package/dist/cjs/test/Img.test.js +0 -25
  128. package/dist/cjs/test/absolute-src.test.d.ts +0 -1
  129. package/dist/cjs/test/absolute-src.test.js +0 -18
  130. package/dist/cjs/test/audio-for-rendering.test.d.ts +0 -1
  131. package/dist/cjs/test/audio-for-rendering.test.js +0 -88
  132. package/dist/cjs/test/audio.test.d.ts +0 -1
  133. package/dist/cjs/test/audio.test.js +0 -76
  134. package/dist/cjs/test/bezier.test.d.ts +0 -1
  135. package/dist/cjs/test/bezier.test.js +0 -52
  136. package/dist/cjs/test/composition-rules.test.d.ts +0 -1
  137. package/dist/cjs/test/composition-rules.test.js +0 -30
  138. package/dist/cjs/test/composition-validation.test.d.ts +0 -1
  139. package/dist/cjs/test/composition-validation.test.js +0 -99
  140. package/dist/cjs/test/easing.test.d.ts +0 -1
  141. package/dist/cjs/test/easing.test.js +0 -191
  142. package/dist/cjs/test/expect-to-throw.d.ts +0 -1
  143. package/dist/cjs/test/expect-to-throw.js +0 -15
  144. package/dist/cjs/test/freeze.test.d.ts +0 -1
  145. package/dist/cjs/test/freeze.test.js +0 -65
  146. package/dist/cjs/test/get-asset-file-name.test.d.ts +0 -1
  147. package/dist/cjs/test/get-asset-file-name.test.js +0 -14
  148. package/dist/cjs/test/get-current-time.test.d.ts +0 -1
  149. package/dist/cjs/test/get-current-time.test.js +0 -74
  150. package/dist/cjs/test/input-props.test.d.ts +0 -1
  151. package/dist/cjs/test/input-props.test.js +0 -31
  152. package/dist/cjs/test/interpolate.test.d.ts +0 -1
  153. package/dist/cjs/test/interpolate.test.js +0 -138
  154. package/dist/cjs/test/interpolateColors.test.d.ts +0 -1
  155. package/dist/cjs/test/interpolateColors.test.js +0 -63
  156. package/dist/cjs/test/loop-validation.test.d.ts +0 -1
  157. package/dist/cjs/test/loop-validation.test.js +0 -93
  158. package/dist/cjs/test/measure-spring.test.d.ts +0 -1
  159. package/dist/cjs/test/measure-spring.test.js +0 -45
  160. package/dist/cjs/test/media-validation.test.d.ts +0 -1
  161. package/dist/cjs/test/media-validation.test.js +0 -47
  162. package/dist/cjs/test/nested-sequences.test.d.ts +0 -1
  163. package/dist/cjs/test/nested-sequences.test.js +0 -132
  164. package/dist/cjs/test/not-all-props-in-media-tags.test.d.ts +0 -1
  165. package/dist/cjs/test/not-all-props-in-media-tags.test.js +0 -33
  166. package/dist/cjs/test/random.test.d.ts +0 -1
  167. package/dist/cjs/test/random.test.js +0 -60
  168. package/dist/cjs/test/ready-manager.test.d.ts +0 -1
  169. package/dist/cjs/test/ready-manager.test.js +0 -29
  170. package/dist/cjs/test/render-hook.d.ts +0 -23
  171. package/dist/cjs/test/render-hook.js +0 -27
  172. package/dist/cjs/test/sequence-from-initial-offset.test.d.ts +0 -4
  173. package/dist/cjs/test/sequence-from-initial-offset.test.js +0 -35
  174. package/dist/cjs/test/sequence-validation.test.d.ts +0 -1
  175. package/dist/cjs/test/sequence-validation.test.js +0 -47
  176. package/dist/cjs/test/series.test.d.ts +0 -1
  177. package/dist/cjs/test/series.test.js +0 -115
  178. package/dist/cjs/test/spring.test.d.ts +0 -1
  179. package/dist/cjs/test/spring.test.js +0 -38
  180. package/dist/cjs/test/truthy.test.d.ts +0 -1
  181. package/dist/cjs/test/truthy.test.js +0 -24
  182. package/dist/cjs/test/use-audio-frame.test.d.ts +0 -1
  183. package/dist/cjs/test/use-audio-frame.test.js +0 -78
  184. package/dist/cjs/test/use-media-in-timeline.test.d.ts +0 -1
  185. package/dist/cjs/test/use-media-in-timeline.test.js +0 -74
  186. package/dist/cjs/test/use-media-tag-volume.test.d.ts +0 -1
  187. package/dist/cjs/test/use-media-tag-volume.test.js +0 -49
  188. package/dist/cjs/test/use-sync-volume-with-media-tag.test.d.ts +0 -1
  189. package/dist/cjs/test/use-sync-volume-with-media-tag.test.js +0 -55
  190. package/dist/cjs/test/validate-start-from-props.test.d.ts +0 -1
  191. package/dist/cjs/test/validate-start-from-props.test.js +0 -39
  192. package/dist/cjs/test/video.test.d.ts +0 -1
  193. package/dist/cjs/test/video.test.js +0 -80
  194. package/dist/cjs/test/volume-prop.test.d.ts +0 -1
  195. package/dist/cjs/test/volume-prop.test.js +0 -95
  196. package/dist/cjs/test/wrap-sequence-context.d.ts +0 -6
  197. package/dist/cjs/test/wrap-sequence-context.js +0 -41
  198. package/dist/esm/AbsoluteFill.d.ts +0 -6
  199. package/dist/esm/CanUseRemotionHooks.d.ts +0 -5
  200. package/dist/esm/Clipper.d.ts +0 -7
  201. package/dist/esm/Composition.d.ts +0 -23
  202. package/dist/esm/CompositionManager.d.ts +0 -82
  203. package/dist/esm/Folder.d.ts +0 -15
  204. package/dist/esm/IFrame.d.ts +0 -2
  205. package/dist/esm/Img.d.ts +0 -2
  206. package/dist/esm/NativeLayers.d.ts +0 -13
  207. package/dist/esm/Null.d.ts +0 -2
  208. package/dist/esm/RemotionRoot.d.ts +0 -5
  209. package/dist/esm/Sequence.d.ts +0 -29
  210. package/dist/esm/Still.d.ts +0 -3
  211. package/dist/esm/absolute-src.d.ts +0 -1
  212. package/dist/esm/asset-types.d.ts +0 -50
  213. package/dist/esm/audio/Audio.d.ts +0 -8
  214. package/dist/esm/audio/AudioForDevelopment.d.ts +0 -11
  215. package/dist/esm/audio/AudioForRendering.d.ts +0 -10
  216. package/dist/esm/audio/index.d.ts +0 -2
  217. package/dist/esm/audio/props.d.ts +0 -12
  218. package/dist/esm/audio/shared-audio-tags.d.ts +0 -37
  219. package/dist/esm/audio/use-audio-frame.d.ts +0 -6
  220. package/dist/esm/bezier.d.ts +0 -1
  221. package/dist/esm/cancel-render.d.ts +0 -1
  222. package/dist/esm/config/input-props.d.ts +0 -1
  223. package/dist/esm/config.d.ts +0 -285
  224. package/dist/esm/default-css.d.ts +0 -3
  225. package/dist/esm/delay-render.d.ts +0 -14
  226. package/dist/esm/easing.d.ts +0 -19
  227. package/dist/esm/freeze.d.ts +0 -7
  228. package/dist/esm/get-asset-file-name.d.ts +0 -1
  229. package/dist/esm/get-environment.d.ts +0 -3
  230. package/dist/esm/get-preview-dom-element.d.ts +0 -1
  231. package/dist/esm/get-static-files.d.ts +0 -17
  232. package/dist/esm/get-timeline-clip-name.d.ts +0 -1
  233. package/dist/esm/index.d.ts +0 -92
  234. package/dist/esm/internals.d.ts +0 -99
  235. package/dist/esm/interpolate-colors.d.ts +0 -5
  236. package/dist/esm/interpolate.d.ts +0 -18
  237. package/dist/esm/is-approximately-the-same.d.ts +0 -1
  238. package/dist/esm/is-player.d.ts +0 -3
  239. package/dist/esm/loading-indicator.d.ts +0 -2
  240. package/dist/esm/loop/index.d.ts +0 -9
  241. package/dist/esm/multiple-versions-warning.d.ts +0 -1
  242. package/dist/esm/nonce.d.ts +0 -7
  243. package/dist/esm/play-and-handle-not-allowed-error.d.ts +0 -2
  244. package/dist/esm/portal-node.d.ts +0 -1
  245. package/dist/esm/prefetch-state.d.ts +0 -8
  246. package/dist/esm/prefetch.d.ts +0 -9
  247. package/dist/esm/random.d.ts +0 -7
  248. package/dist/esm/register-root.d.ts +0 -4
  249. package/dist/esm/series/flatten-children.d.ts +0 -2
  250. package/dist/esm/series/index.d.ts +0 -13
  251. package/dist/esm/setup-env-variables.d.ts +0 -2
  252. package/dist/esm/spring/index.d.ts +0 -27
  253. package/dist/esm/spring/measure-spring.d.ts +0 -8
  254. package/dist/esm/spring/spring-utils.d.ts +0 -21
  255. package/dist/esm/static-file.d.ts +0 -5
  256. package/dist/esm/test/Img.test.d.ts +0 -1
  257. package/dist/esm/test/absolute-src.test.d.ts +0 -1
  258. package/dist/esm/test/audio-for-rendering.test.d.ts +0 -1
  259. package/dist/esm/test/audio.test.d.ts +0 -1
  260. package/dist/esm/test/bezier.test.d.ts +0 -1
  261. package/dist/esm/test/composition-rules.test.d.ts +0 -1
  262. package/dist/esm/test/composition-validation.test.d.ts +0 -1
  263. package/dist/esm/test/easing.test.d.ts +0 -1
  264. package/dist/esm/test/expect-to-throw.d.ts +0 -1
  265. package/dist/esm/test/freeze.test.d.ts +0 -1
  266. package/dist/esm/test/get-asset-file-name.test.d.ts +0 -1
  267. package/dist/esm/test/get-current-time.test.d.ts +0 -1
  268. package/dist/esm/test/input-props.test.d.ts +0 -1
  269. package/dist/esm/test/interpolate.test.d.ts +0 -1
  270. package/dist/esm/test/interpolateColors.test.d.ts +0 -1
  271. package/dist/esm/test/loop-validation.test.d.ts +0 -1
  272. package/dist/esm/test/measure-spring.test.d.ts +0 -1
  273. package/dist/esm/test/media-validation.test.d.ts +0 -1
  274. package/dist/esm/test/nested-sequences.test.d.ts +0 -1
  275. package/dist/esm/test/not-all-props-in-media-tags.test.d.ts +0 -1
  276. package/dist/esm/test/random.test.d.ts +0 -1
  277. package/dist/esm/test/ready-manager.test.d.ts +0 -1
  278. package/dist/esm/test/render-hook.d.ts +0 -23
  279. package/dist/esm/test/sequence-from-initial-offset.test.d.ts +0 -4
  280. package/dist/esm/test/sequence-validation.test.d.ts +0 -1
  281. package/dist/esm/test/series.test.d.ts +0 -1
  282. package/dist/esm/test/spring.test.d.ts +0 -1
  283. package/dist/esm/test/truthy.test.d.ts +0 -1
  284. package/dist/esm/test/use-audio-frame.test.d.ts +0 -1
  285. package/dist/esm/test/use-media-in-timeline.test.d.ts +0 -1
  286. package/dist/esm/test/use-media-tag-volume.test.d.ts +0 -1
  287. package/dist/esm/test/use-sync-volume-with-media-tag.test.d.ts +0 -1
  288. package/dist/esm/test/validate-start-from-props.test.d.ts +0 -1
  289. package/dist/esm/test/video.test.d.ts +0 -1
  290. package/dist/esm/test/volume-prop.test.d.ts +0 -1
  291. package/dist/esm/test/wrap-sequence-context.d.ts +0 -6
  292. package/dist/esm/timeline-position-state.d.ts +0 -29
  293. package/dist/esm/truthy.d.ts +0 -3
  294. package/dist/esm/use-current-frame.d.ts +0 -6
  295. package/dist/esm/use-lazy-component.d.ts +0 -7
  296. package/dist/esm/use-media-in-timeline.d.ts +0 -10
  297. package/dist/esm/use-media-playback.d.ts +0 -10
  298. package/dist/esm/use-media-tag-volume.d.ts +0 -2
  299. package/dist/esm/use-sync-volume-with-media-tag.d.ts +0 -10
  300. package/dist/esm/use-unsafe-video-config.d.ts +0 -2
  301. package/dist/esm/use-video-config.d.ts +0 -7
  302. package/dist/esm/use-video.d.ts +0 -13
  303. package/dist/esm/validate-frame.d.ts +0 -1
  304. package/dist/esm/validate-media-props.d.ts +0 -4
  305. package/dist/esm/validate-start-from-props.d.ts +0 -1
  306. package/dist/esm/validation/validate-composition-id.d.ts +0 -3
  307. package/dist/esm/validation/validate-dimensions.d.ts +0 -1
  308. package/dist/esm/validation/validate-duration-in-frames.d.ts +0 -1
  309. package/dist/esm/validation/validate-folder-name.d.ts +0 -3
  310. package/dist/esm/validation/validate-fps.d.ts +0 -1
  311. package/dist/esm/validation/validate-offthreadvideo-image-format.d.ts +0 -1
  312. package/dist/esm/validation/validation-spring-duration.d.ts +0 -1
  313. package/dist/esm/version.d.ts +0 -1
  314. package/dist/esm/video/OffthreadVideo.d.ts +0 -3
  315. package/dist/esm/video/OffthreadVideoForRendering.d.ts +0 -3
  316. package/dist/esm/video/Video.d.ts +0 -8
  317. package/dist/esm/video/VideoForDevelopment.d.ts +0 -11
  318. package/dist/esm/video/VideoForRendering.d.ts +0 -10
  319. package/dist/esm/video/duration-state.d.ts +0 -17
  320. package/dist/esm/video/get-current-time.d.ts +0 -13
  321. package/dist/esm/video/index.d.ts +0 -3
  322. package/dist/esm/video/props.d.ts +0 -25
  323. package/dist/esm/video/video-fragment.d.ts +0 -12
  324. package/dist/esm/video-config.d.ts +0 -8
  325. package/dist/esm/volume-position-state.d.ts +0 -19
  326. package/dist/esm/volume-prop.d.ts +0 -7
  327. package/dist/esm/warn-about-non-seekable-media.d.ts +0 -1
  328. package/dist/esm/wrap-remotion-context.d.ts +0 -18
  329. package/dist/tsconfig-cjs.tsbuildinfo +0 -1
  330. package/tsconfig-cjs.json +0 -11
  331. package/tsconfig.json +0 -12
@@ -1,4 +1,4 @@
1
- import { enableLegacyRemotionConfig } from './config';
1
+ import { enableLegacyRemotionConfig } from './config.js';
2
2
  import { SharedAudioContext, SharedAudioContextProvider, } from './audio/shared-audio-tags.js';
3
3
  import { CanUseRemotionHooks, CanUseRemotionHooksProvider, } from './CanUseRemotionHooks.js';
4
4
  import { CompositionManager, compositionsRef } from './CompositionManager.js';
@@ -11,7 +11,7 @@ import { portalNode } from './portal-node.js';
11
11
  import { PrefetchProvider } from './prefetch-state.js';
12
12
  import { getRoot, waitForRoot } from './register-root.js';
13
13
  import { RemotionRoot } from './RemotionRoot.js';
14
- import { SequenceContext } from './Sequence.js';
14
+ import { SequenceContext } from './SequenceContext.js';
15
15
  import { ENV_VARIABLES_ENV_NAME, setupEnvVariables, } from './setup-env-variables.js';
16
16
  import * as TimelinePosition from './timeline-position-state.js';
17
17
  import { truthy } from './truthy.js';
@@ -375,6 +375,10 @@ const interpolateColorsRGB = (value, inputRange, colors) => {
375
375
  });
376
376
  return rgbaColor(r, g, b, a);
377
377
  };
378
+ /**
379
+ * @description This function allows you to map a range of values to colors using a concise syntax.
380
+ * @see [Documentation](https://www.remotion.dev/docs/interpolate-colors)
381
+ */
378
382
  export const interpolateColors = (input, inputRange, outputRange) => {
379
383
  if (typeof input === 'undefined') {
380
384
  throw new TypeError('input can not be undefined');
@@ -1,4 +1,8 @@
1
1
  // Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/nodes/AnimatedInterpolation.js
2
+ /**
3
+ * @description This function allows you to map a range of values to another with a conside syntax
4
+ * @see [Documentation](https://www.remotion.dev/docs/interpolate)
5
+ */
2
6
  function interpolateFunction(input, inputRange, outputRange, options) {
3
7
  const { extrapolateLeft, extrapolateRight, easing } = options;
4
8
  let result = input;
@@ -2,6 +2,10 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Sequence } from '../Sequence.js';
3
3
  import { useVideoConfig } from '../use-video-config.js';
4
4
  import { validateDurationInFrames } from '../validation/validate-duration-in-frames.js';
5
+ /**
6
+ * @description This component allows you to quickly lay out an animation so it repeats itself.
7
+ * @see [Documentation](https://www.remotion.dev/docs/loop)
8
+ */
5
9
  export const Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
6
10
  const { durationInFrames: compDuration } = useVideoConfig();
7
11
  validateDurationInFrames(durationInFrames, 'of the <Loop /> component');
@@ -19,6 +19,10 @@ const blobToBase64 = function (blob) {
19
19
  reader.readAsDataURL(blob);
20
20
  });
21
21
  };
22
+ /**
23
+ * @description When you call the preFetch() function, an asset will be fetched and kept in memory so it is ready when you want to play it in a <Player>.
24
+ * @see [Documentation](https://www.remotion.dev/docs/prefetch)
25
+ */
22
26
  export const prefetch = (src, options) => {
23
27
  var _a;
24
28
  const method = (_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : 'blob-url';
@@ -17,9 +17,8 @@ function hashCode(str) {
17
17
  return hash;
18
18
  }
19
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
20
+ * @description A deterministic pseudo-random number generator. Pass in the same seed and get the same pseudorandom number.
21
+ * @see [Documentation](https://remotion.dev/docs/random)
23
22
  */
24
23
  export const random = (seed, dummy) => {
25
24
  if (dummy !== undefined) {
@@ -1,5 +1,9 @@
1
1
  let Root = null;
2
2
  let listeners = [];
3
+ /**
4
+ * @description This function registers the root component of the Remotion project
5
+ * @see [Documentation](https://www.remotion.dev/docs/register-root)
6
+ */
3
7
  export const registerRoot = (comp) => {
4
8
  if (!comp) {
5
9
  throw new Error(`You must pass a React component to registerRoot(), but ${JSON.stringify(comp)} was passed.`);
@@ -9,6 +9,10 @@ const SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
9
9
  return _jsx(_Fragment, { children: children });
10
10
  };
11
11
  const SeriesSequence = forwardRef(SeriesSequenceRefForwardingFunction);
12
+ /**
13
+ * @description with this component, you can easily stitch together scenes that should play sequentially after another.
14
+ * @see [Documentation](https://www.remotion.dev/docs/series)
15
+ */
12
16
  const Series = ({ children }) => {
13
17
  const childrenValue = useMemo(() => {
14
18
  let startFrame = 0;
@@ -4,8 +4,8 @@ import { validateSpringDuration } from '../validation/validation-spring-duration
4
4
  import { measureSpring } from './measure-spring.js';
5
5
  import { springCalculation } from './spring-utils.js';
6
6
  /**
7
- * Calculates a position based on physical parameters, start and end value, and time.
8
- * @link https://www.remotion.dev/docs/spring
7
+ * @description Calculates a position based on physical parameters, start and end value, and time.
8
+ * @see [Documentation](https://www.remotion.dev/docs/spring)
9
9
  * @param {number} frame The current time value. Most of the time you want to pass in the return value of useCurrentFrame.
10
10
  * @param {number} fps The framerate at which the animation runs. Pass in the value obtained by `useVideoConfig()`.
11
11
  * @param {?Object} config optional object that allows you to customize the physical properties of the animation.
@@ -1,5 +1,9 @@
1
1
  import { validateFps } from '../validation/validate-fps.js';
2
2
  import { springCalculation } from './spring-utils.js';
3
+ /**
4
+ * @description The function returns how long it takes for a spring animation to settle
5
+ * @see [Documentation](https://www.remotion.dev/docs/measure-spring)
6
+ */
3
7
  export function measureSpring({ fps, config = {}, threshold = 0.005, from = 0, to = 1, }) {
4
8
  if (typeof threshold !== 'number') {
5
9
  throw new TypeError(`threshold must be a number, got ${threshold} of type ${typeof threshold}`);
@@ -11,8 +11,8 @@ const inner = (path) => {
11
11
  return `/${trimLeadingSlash(path)}`;
12
12
  };
13
13
  /**
14
- * Reference a file from the public/ folder.
15
- * If the file does not appear in the autocomplete, type the path manually.
14
+ * @description Reference a file from the public/ folder. If the file does not appear in the autocomplete, type the path manually.
15
+ * @see [Documentation](https://www.remotion.dev/docs/staticfile)
16
16
  */
17
17
  export const staticFile = (path) => {
18
18
  if (path.startsWith('http://') || path.startsWith('https://')) {
@@ -5,7 +5,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  import { render } from '@testing-library/react';
6
6
  import React, { useContext } from 'react';
7
7
  import { describe, expect, test } from 'vitest';
8
- import { Audio } from '../audio';
8
+ import { Audio } from '../audio/index.js';
9
9
  import { CanUseRemotionHooksProvider } from '../CanUseRemotionHooks.js';
10
10
  import { Internals } from '../internals.js';
11
11
  const Wrapper = ({ children }) => {
@@ -4,7 +4,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  */
5
5
  import { render } from '@testing-library/react';
6
6
  import { describe, expect, test } from 'vitest';
7
- import { Composition } from '..';
7
+ import { Composition } from '../Composition.js';
8
8
  import { RemotionRoot } from '../RemotionRoot.js';
9
9
  import { expectToThrow } from './expect-to-throw.js';
10
10
  const AnyComp = () => null;
@@ -7,7 +7,7 @@ import React, { useContext } from 'react';
7
7
  import { describe, expect, test } from 'vitest';
8
8
  import { CanUseRemotionHooksProvider } from '../CanUseRemotionHooks.js';
9
9
  import { CompositionManager } from '../CompositionManager.js';
10
- import { Loop } from '../loop';
10
+ import { Loop } from '../loop/index.js';
11
11
  import { RemotionRoot } from '../RemotionRoot.js';
12
12
  import { expectToThrow } from './expect-to-throw.js';
13
13
  const Wrapper = ({ children }) => {
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, test } from 'vitest';
2
- import { measureSpring, spring } from '../spring';
2
+ import { measureSpring, spring } from '../spring/index.js';
3
3
  import { expectToThrow } from './expect-to-throw.js';
4
4
  describe('Measure spring should work', () => {
5
5
  const duration = measureSpring({
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { renderToString } from 'react-dom/server';
3
3
  import { expect, test } from 'vitest';
4
4
  import { CanUseRemotionHooksProvider } from '../CanUseRemotionHooks.js';
5
- import { Series } from '../series';
5
+ import { Series } from '../series/index.js';
6
6
  import { TimelineContext } from '../timeline-position-state.js';
7
7
  import { useCurrentFrame } from '../use-current-frame.js';
8
8
  import { WrapSequenceContext } from './wrap-sequence-context.js';
@@ -1,6 +1,6 @@
1
1
  import { expect, test } from 'vitest';
2
2
  import { isApproximatelyTheSame } from '../is-approximately-the-same.js';
3
- import { spring } from '../spring';
3
+ import { spring } from '../spring/index.js';
4
4
  test('Basic spring to equal 0', () => {
5
5
  expect(spring({
6
6
  fps: 30,
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { afterAll, beforeAll, describe, expect, test, vitest } from 'vitest';
3
3
  import * as useAudioFrameModule from '../audio/use-audio-frame.js';
4
4
  import { useFrameForVolumeProp, useMediaStartsAt, } from '../audio/use-audio-frame.js';
5
- import { SequenceContext } from '../Sequence.js';
5
+ import { SequenceContext } from '../SequenceContext.js';
6
6
  import * as useFrameModule from '../use-current-frame.js';
7
7
  import { renderHook } from './render-hook.js';
8
8
  test.skip('Media starts at 0 if it is outside a sequence', () => {
@@ -7,7 +7,7 @@ import React, { useContext } from 'react';
7
7
  import { describe, expect, test } from 'vitest';
8
8
  import { CanUseRemotionHooksProvider } from '../CanUseRemotionHooks.js';
9
9
  import { Internals } from '../internals.js';
10
- import { Video } from '../video';
10
+ import { Video } from '../video/index.js';
11
11
  import { expectToThrow } from './expect-to-throw.js';
12
12
  const Wrapper = ({ children }) => {
13
13
  const compositions = useContext(Internals.CompositionManager);
@@ -1,11 +1,10 @@
1
1
  import { useContext } from 'react';
2
2
  import { CanUseRemotionHooks } from './CanUseRemotionHooks.js';
3
- import { SequenceContext } from './Sequence.js';
3
+ import { SequenceContext } from './SequenceContext.js';
4
4
  import { useTimelinePosition } from './timeline-position-state.js';
5
5
  /**
6
- * Get the current frame of the video.
7
- * Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
8
- * @link https://www.remotion.dev/docs/use-current-frame
6
+ * @description Get the current frame of the video. Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
7
+ * @see [Documentation](https://remotion.dev/docs/use-current-frame)
9
8
  */
10
9
  export const useCurrentFrame = () => {
11
10
  const canUseRemotionHooks = useContext(CanUseRemotionHooks);
@@ -5,7 +5,7 @@ import { getAssetDisplayName } from './get-asset-file-name.js';
5
5
  import { useRemotionEnvironment } from './get-environment.js';
6
6
  import { useNonce } from './nonce.js';
7
7
  import { playAndHandleNotAllowedError } from './play-and-handle-not-allowed-error.js';
8
- import { SequenceContext } from './Sequence.js';
8
+ import { SequenceContext } from './SequenceContext.js';
9
9
  import { TimelineContext, usePlayingState } from './timeline-position-state.js';
10
10
  import { useVideoConfig } from './use-video-config.js';
11
11
  import { evaluateVolume } from './volume-prop.js';
@@ -1,5 +1,5 @@
1
1
  import { useContext, useMemo } from 'react';
2
- import { SequenceContext } from './Sequence.js';
2
+ import { SequenceContext } from './SequenceContext.js';
3
3
  import { useVideo } from './use-video.js';
4
4
  export const useUnsafeVideoConfig = () => {
5
5
  var _a;
@@ -3,9 +3,10 @@ import { CanUseRemotionHooks } from './CanUseRemotionHooks.js';
3
3
  import { useIsPlayer } from './is-player.js';
4
4
  import { useUnsafeVideoConfig } from './use-unsafe-video-config.js';
5
5
  /**
6
- * Get some info about the context of the video that you are making.
7
- * Returns an object containing `fps`, `width`, `height` and `durationInFrames`, all of type `number`.
8
- * @link https://www.remotion.dev/docs/use-video-config
6
+ * /**
7
+ * @description Get some info about the context of the video that you are making.
8
+ * @see [Documentation](https://www.remotion.dev/docs/use-video-config)
9
+ * @returns Returns an object containing `fps`, `width`, `height` and `durationInFrames`, all of type `number`.
9
10
  */
10
11
  export const useVideoConfig = () => {
11
12
  const videoConfig = useUnsafeVideoConfig();
@@ -1,2 +1,2 @@
1
1
  // Automatically generated on publish
2
- export const VERSION = '3.3.53';
2
+ export const VERSION = '3.3.55';
@@ -0,0 +1,4 @@
1
+ // Automatically generated on publish
2
+ const VERSION = '3.3.55';
3
+
4
+ export { VERSION };
@@ -7,6 +7,10 @@ import { validateStartFromProps } from '../validate-start-from-props.js';
7
7
  import { validateOffthreadVideoImageFormat } from '../validation/validate-offthreadvideo-image-format.js';
8
8
  import { OffthreadVideoForRendering } from './OffthreadVideoForRendering.js';
9
9
  import { VideoForDevelopment } from './VideoForDevelopment.js';
10
+ /**
11
+ * @description This method imports and displays a video, similar to <Video />. During rendering, it extracts the exact frame from the video and displays it in an <img> tag
12
+ * @see [Documentation](https://www.remotion.dev/docs/offthreadvideo)
13
+ */
10
14
  export const OffthreadVideo = (props) => {
11
15
  const { startFrom, endAt, ...otherProps } = props;
12
16
  const environment = useRemotionEnvironment();
@@ -7,7 +7,7 @@ import { OFFTHREAD_VIDEO_CLASS_NAME } from '../default-css.js';
7
7
  import { Img } from '../Img.js';
8
8
  import { Internals } from '../internals.js';
9
9
  import { random } from '../random.js';
10
- import { SequenceContext } from '../Sequence.js';
10
+ import { SequenceContext } from '../SequenceContext.js';
11
11
  import { useTimelinePosition } from '../timeline-position-state.js';
12
12
  import { useCurrentFrame } from '../use-current-frame.js';
13
13
  import { useUnsafeVideoConfig } from '../use-unsafe-video-config.js';
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback, useContext } from 'react';
3
3
  import { useRemotionEnvironment } from '../get-environment.js';
4
- import { Loop } from '../loop';
4
+ import { Loop } from '../loop/index.js';
5
5
  import { Sequence } from '../Sequence.js';
6
6
  import { useVideoConfig } from '../use-video-config.js';
7
7
  import { validateMediaProps } from '../validate-media-props.js';
@@ -44,4 +44,8 @@ const VideoForwardingFunction = (props, ref) => {
44
44
  return (_jsx(VideoForDevelopment, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref, onDuration: onDuration }));
45
45
  };
46
46
  const forward = forwardRef;
47
+ /**
48
+ * @description allows you to include a video file in your Remotion project. It wraps the native HTMLVideoElement.
49
+ * @see [Documentation](https://www.remotion.dev/docs/video)
50
+ */
47
51
  export const Video = forward(VideoForwardingFunction);
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useContext, useEffect, useImperativeHandle, useRef, } from 'react';
3
3
  import { useFrameForVolumeProp } from '../audio/use-audio-frame.js';
4
4
  import { usePreload } from '../prefetch.js';
5
- import { SequenceContext } from '../Sequence.js';
5
+ import { SequenceContext } from '../SequenceContext.js';
6
6
  import { useMediaInTimeline } from '../use-media-in-timeline.js';
7
7
  import { DEFAULT_ACCEPTABLE_TIMESHIFT, useMediaPlayback, } from '../use-media-playback.js';
8
8
  import { useMediaTagVolume } from '../use-media-tag-volume.js';
@@ -7,7 +7,7 @@ import { continueRender, delayRender } from '../delay-render.js';
7
7
  import { useRemotionEnvironment } from '../get-environment.js';
8
8
  import { isApproximatelyTheSame } from '../is-approximately-the-same.js';
9
9
  import { random } from '../random.js';
10
- import { SequenceContext } from '../Sequence.js';
10
+ import { SequenceContext } from '../SequenceContext.js';
11
11
  import { useTimelinePosition } from '../timeline-position-state.js';
12
12
  import { useCurrentFrame } from '../use-current-frame.js';
13
13
  import { useUnsafeVideoConfig } from '../use-unsafe-video-config.js';
@@ -8,8 +8,8 @@ import { CompositionManager } from './CompositionManager.js';
8
8
  import { NativeLayersContext } from './NativeLayers.js';
9
9
  import { NonceContext } from './nonce.js';
10
10
  import { PreloadContext } from './prefetch-state.js';
11
- import { SequenceContext } from './Sequence.js';
12
- import { SetTimelineContext, TimelineContext } from './timeline-position-state.js';
11
+ import { SequenceContext } from './SequenceContext.js';
12
+ import { SetTimelineContext, TimelineContext, } from './timeline-position-state.js';
13
13
  export function useRemotionContexts() {
14
14
  const compositionManagerCtx = React.useContext(CompositionManager);
15
15
  const timelineContext = React.useContext(TimelineContext);
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "3.3.53",
3
+ "version": "3.3.55",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",
7
- "module": "dist/esm/index.js",
7
+ "module": "dist/esm/index.mjs",
8
8
  "scripts": {
9
9
  "prepublishOnly": "node ensure-correct-version.js && cp ../../README.md .",
10
10
  "lint": "eslint src --ext ts,tsx",
11
11
  "test": "vitest --run",
12
- "build": "tsc -d && tsc -d -p tsconfig-cjs.json",
12
+ "build": "rollup --config rollup-version.config.js && rollup --config rollup.config.js && tsc -d -p tsconfig-cjs.json",
13
13
  "watch": "tsc -w"
14
14
  },
15
15
  "repository": {
@@ -25,7 +25,8 @@
25
25
  "react-dom": ">=16.8.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@jonny/eslint-config": "3.0.266",
28
+ "@jonny/eslint-config": "3.0.273",
29
+ "@rollup/plugin-typescript": "^8.2.0",
29
30
  "@testing-library/react": "14.0.0",
30
31
  "@types/node": "^16.7.5",
31
32
  "@types/react": "18.0.26",
@@ -40,6 +41,7 @@
40
41
  "react": "^18.0.0",
41
42
  "react-dom": "^18.0.0",
42
43
  "rimraf": "^3.0.2",
44
+ "rollup": "^2.70.1",
43
45
  "typescript": "^4.7.0",
44
46
  "vitest": "0.24.3"
45
47
  },
@@ -57,14 +59,14 @@
57
59
  "./package.json": "./package.json",
58
60
  ".": {
59
61
  "types": "./dist/cjs/index.d.ts",
60
- "module": "./dist/esm/index.js",
61
- "import": "./dist/esm/index.js",
62
+ "module": "./dist/esm/index.mjs",
63
+ "import": "./dist/esm/index.mjs",
62
64
  "require": "./dist/cjs/index.js"
63
65
  },
64
66
  "./version": {
65
67
  "types": "./dist/cjs/version.d.ts",
66
- "module": "./dist/esm/version.js",
67
- "import": "./dist/esm/version.js",
68
+ "module": "./dist/esm/version.mjs",
69
+ "import": "./dist/esm/version.mjs",
68
70
  "require": "./dist/cjs/version.js"
69
71
  }
70
72
  },
@@ -75,5 +77,5 @@
75
77
  ]
76
78
  }
77
79
  },
78
- "gitHead": "b6d64c3ec91b55ac537765fda0b927c3a472b529"
80
+ "gitHead": "4cecccc293e9c906c693f55fac65df8f1cfd2338"
79
81
  }
package/version.js ADDED
@@ -0,0 +1,2 @@
1
+ // For backwards compatibility when you use `esm-wallaby`
2
+ module.exports = require('./dist/cjs/version');
package/.prettierrc.js DELETED
@@ -1,14 +0,0 @@
1
- module.exports = {
2
- singleQuote: true,
3
- bracketSpacing: false,
4
- useTabs: true,
5
- overrides: [
6
- {
7
- files: ['*.yml'],
8
- options: {
9
- singleQuote: false,
10
- },
11
- },
12
- ],
13
- plugins: [require.resolve('prettier-plugin-organize-imports')],
14
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,25 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const jsx_runtime_1 = require("react/jsx-runtime");
7
- /**
8
- * @vitest-environment jsdom
9
- */
10
- const react_1 = require("@testing-library/react");
11
- const react_2 = __importDefault(require("react"));
12
- const vitest_1 = require("vitest");
13
- const Img_js_1 = require("../Img.js");
14
- const ref = react_2.default.createRef();
15
- const testImgUrl = 'https://source.unsplash.com/random/50x50';
16
- (0, vitest_1.beforeEach)(() => {
17
- (0, react_1.render)((0, jsx_runtime_1.jsx)(Img_js_1.Img, { ref: ref, src: testImgUrl }));
18
- });
19
- (0, vitest_1.test)('Img component renders img tag', () => {
20
- var _a;
21
- (0, vitest_1.expect)((_a = ref.current) === null || _a === void 0 ? void 0 : _a.tagName).toBe('IMG');
22
- });
23
- (0, vitest_1.test)('Src attribute is forwarded to img tag', () => {
24
- (0, vitest_1.expect)(ref.current).toHaveProperty('src', testImgUrl);
25
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * @vitest-environment jsdom
5
- */
6
- const vitest_1 = require("vitest");
7
- const absolute_src_js_1 = require("../absolute-src.js");
8
- (0, vitest_1.describe)('Absolute src should behave as expected', () => {
9
- (0, vitest_1.test)('Get localhost:8080', () => {
10
- (0, vitest_1.expect)((0, absolute_src_js_1.getAbsoluteSrc)('http://localhost:8080')).toBe('http://localhost:8080/');
11
- });
12
- (0, vitest_1.test)('Get localhost/hi', () => {
13
- (0, vitest_1.expect)((0, absolute_src_js_1.getAbsoluteSrc)('/hi')).toBe('http://localhost:3000/hi');
14
- });
15
- (0, vitest_1.test)('Get data:base64', () => {
16
- (0, vitest_1.expect)((0, absolute_src_js_1.getAbsoluteSrc)('data:base64,image/png,abc')).toBe('data:base64,image/png,abc');
17
- });
18
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,88 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const jsx_runtime_1 = require("react/jsx-runtime");
7
- /**
8
- * @vitest-environment jsdom
9
- */
10
- const react_1 = require("@testing-library/react");
11
- const react_2 = __importDefault(require("react"));
12
- const vitest_1 = require("vitest");
13
- const AudioForRendering_js_1 = require("../audio/AudioForRendering.js");
14
- const CanUseRemotionHooks_js_1 = require("../CanUseRemotionHooks.js");
15
- const internals_js_1 = require("../internals.js");
16
- const expect_to_throw_js_1 = require("./expect-to-throw.js");
17
- let mockContext;
18
- (0, vitest_1.describe)('Register and unregister asset', () => {
19
- function createMockContext() {
20
- const registerAsset = vitest_1.vitest.fn();
21
- const unregisterAsset = vitest_1.vitest.fn();
22
- window.remotion_audioEnabled = true;
23
- const MockProvider = ({ children }) => {
24
- return ((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(internals_js_1.Internals.CompositionManager.Provider, { value:
25
- // eslint-disable-next-line react/jsx-no-constructed-context-values
26
- {
27
- registerAsset,
28
- unregisterAsset,
29
- }, children: children }) }));
30
- };
31
- return {
32
- MockProvider,
33
- registerAsset,
34
- unregisterAsset,
35
- };
36
- }
37
- (0, vitest_1.beforeEach)(() => {
38
- mockContext = createMockContext();
39
- });
40
- (0, vitest_1.test)('register and unregister asset', () => {
41
- const props = {
42
- src: 'test',
43
- muted: false,
44
- volume: 50,
45
- onDuration: vitest_1.vitest.fn(),
46
- };
47
- const { unmount } = (0, react_1.render)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(mockContext.MockProvider, { children: (0, jsx_runtime_1.jsx)(AudioForRendering_js_1.AudioForRendering, { ...props }) }) }));
48
- (0, vitest_1.expect)(mockContext.registerAsset).toHaveBeenCalled();
49
- unmount();
50
- (0, vitest_1.expect)(mockContext.unregisterAsset).toHaveBeenCalled();
51
- });
52
- (0, vitest_1.test)('no src passed', () => {
53
- const props = {
54
- src: undefined,
55
- muted: false,
56
- volume: 50,
57
- onDuration: vitest_1.vitest.fn(),
58
- };
59
- (0, expect_to_throw_js_1.expectToThrow)(() => {
60
- (0, react_1.render)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(mockContext.MockProvider, { children: (0, jsx_runtime_1.jsx)(AudioForRendering_js_1.AudioForRendering, { ...props }) }) }));
61
- }, /No src passed/);
62
- (0, vitest_1.expect)(mockContext.registerAsset).not.toHaveBeenCalled();
63
- (0, vitest_1.expect)(mockContext.unregisterAsset).not.toHaveBeenCalled();
64
- });
65
- });
66
- let mockUseEffect;
67
- (0, vitest_1.describe)('useEffect tests', () => {
68
- const useEffectSpy = vitest_1.vitest.spyOn(react_2.default, 'useEffect');
69
- mockUseEffect = vitest_1.vitest.fn();
70
- (0, vitest_1.beforeAll)(() => {
71
- useEffectSpy.mockImplementation(() => {
72
- mockUseEffect();
73
- });
74
- });
75
- (0, vitest_1.afterAll)(() => {
76
- useEffectSpy.mockRestore();
77
- });
78
- vitest_1.test.skip('has registered', () => {
79
- const props = {
80
- src: 'test',
81
- muted: false,
82
- volume: 50,
83
- onDuration: vitest_1.vitest.fn(),
84
- };
85
- (0, react_1.render)((0, jsx_runtime_1.jsxs)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: [(0, jsx_runtime_1.jsx)(AudioForRendering_js_1.AudioForRendering, { ...props }), ' '] }));
86
- (0, vitest_1.expect)(mockUseEffect).toHaveBeenCalled();
87
- });
88
- });
@@ -1 +0,0 @@
1
- export {};