remotion 4.0.0-webhook.26 → 4.0.0

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 (287) hide show
  1. package/LICENSE.md +8 -8
  2. package/README.md +7 -7
  3. package/dist/{AbsoluteFill.d.ts → cjs/AbsoluteFill.d.ts} +2 -2
  4. package/dist/{AbsoluteFill.js → cjs/AbsoluteFill.js} +2 -2
  5. package/dist/cjs/AssetManager.d.ts +11 -0
  6. package/dist/cjs/AssetManager.js +40 -0
  7. package/dist/{CanUseRemotionHooks.d.ts → cjs/CanUseRemotionHooks.d.ts} +0 -0
  8. package/dist/{CanUseRemotionHooks.js → cjs/CanUseRemotionHooks.js} +0 -0
  9. package/dist/cjs/Clipper.d.ts +7 -0
  10. package/dist/cjs/Clipper.js +24 -0
  11. package/dist/cjs/Composition.d.ts +56 -0
  12. package/dist/cjs/Composition.js +121 -0
  13. package/dist/cjs/CompositionManager.d.ts +74 -0
  14. package/dist/{CompositionManager.js → cjs/CompositionManager.js} +29 -66
  15. package/dist/cjs/CompositionManagerContext.d.ts +19 -0
  16. package/dist/cjs/CompositionManagerContext.js +16 -0
  17. package/dist/cjs/EditorProps.d.ts +15 -0
  18. package/dist/cjs/EditorProps.js +53 -0
  19. package/dist/{Folder.d.ts → cjs/Folder.d.ts} +6 -2
  20. package/dist/{Folder.js → cjs/Folder.js} +10 -6
  21. package/dist/{IFrame.d.ts → cjs/IFrame.d.ts} +4 -0
  22. package/dist/{IFrame.js → cjs/IFrame.js} +8 -4
  23. package/dist/cjs/Img.d.ts +9 -0
  24. package/dist/cjs/Img.js +100 -0
  25. package/dist/cjs/NativeLayers.d.ts +13 -0
  26. package/dist/cjs/NativeLayers.js +29 -0
  27. package/dist/cjs/Null.d.ts +2 -0
  28. package/dist/cjs/Null.js +25 -0
  29. package/dist/{RemotionRoot.d.ts → cjs/RemotionRoot.d.ts} +1 -0
  30. package/dist/cjs/RemotionRoot.js +74 -0
  31. package/dist/cjs/ResolveCompositionConfig.d.ts +24 -0
  32. package/dist/cjs/ResolveCompositionConfig.js +198 -0
  33. package/dist/cjs/Sequence.d.ts +22 -0
  34. package/dist/{Sequence.js → cjs/Sequence.js} +27 -29
  35. package/dist/cjs/SequenceContext.d.ts +9 -0
  36. package/dist/cjs/SequenceContext.js +5 -0
  37. package/dist/cjs/SequenceManager.d.ts +11 -0
  38. package/dist/cjs/SequenceManager.js +57 -0
  39. package/dist/cjs/Still.d.ts +8 -0
  40. package/dist/cjs/Still.js +22 -0
  41. package/dist/{absolute-src.d.ts → cjs/absolute-src.d.ts} +0 -0
  42. package/dist/{absolute-src.js → cjs/absolute-src.js} +0 -0
  43. package/dist/{asset-types.d.ts → cjs/asset-types.d.ts} +0 -0
  44. package/dist/{asset-types.js → cjs/asset-types.js} +0 -0
  45. package/dist/{audio → cjs/audio}/Audio.d.ts +10 -4
  46. package/dist/cjs/audio/Audio.js +58 -0
  47. package/dist/cjs/audio/AudioForDevelopment.d.ts +11 -0
  48. package/dist/cjs/audio/AudioForDevelopment.js +101 -0
  49. package/dist/cjs/audio/AudioForRendering.d.ts +10 -0
  50. package/dist/cjs/audio/AudioForRendering.js +111 -0
  51. package/dist/cjs/audio/index.d.ts +2 -0
  52. package/dist/{audio → cjs/audio}/index.js +2 -2
  53. package/dist/cjs/audio/props.d.ts +12 -0
  54. package/dist/{audio → cjs/audio}/props.js +0 -0
  55. package/dist/{audio → cjs/audio}/shared-audio-tags.d.ts +10 -4
  56. package/dist/{audio → cjs/audio}/shared-audio-tags.js +35 -13
  57. package/dist/{audio → cjs/audio}/use-audio-frame.d.ts +0 -0
  58. package/dist/{audio → cjs/audio}/use-audio-frame.js +4 -4
  59. package/dist/{bezier.d.ts → cjs/bezier.d.ts} +0 -0
  60. package/dist/{bezier.js → cjs/bezier.js} +0 -0
  61. package/dist/cjs/cancel-render.d.ts +5 -0
  62. package/dist/cjs/cancel-render.js +47 -0
  63. package/dist/{config → cjs/config}/input-props.d.ts +0 -0
  64. package/dist/{config → cjs/config}/input-props.js +3 -3
  65. package/dist/{default-css.d.ts → cjs/default-css.d.ts} +0 -0
  66. package/dist/{default-css.js → cjs/default-css.js} +0 -0
  67. package/dist/{delay-render.d.ts → cjs/delay-render.d.ts} +4 -4
  68. package/dist/{delay-render.js → cjs/delay-render.js} +12 -12
  69. package/dist/{easing.d.ts → cjs/easing.d.ts} +4 -0
  70. package/dist/{easing.js → cjs/easing.js} +6 -2
  71. package/dist/cjs/freeze.d.ts +11 -0
  72. package/dist/{freeze.js → cjs/freeze.js} +14 -6
  73. package/dist/{get-asset-file-name.d.ts → cjs/get-asset-file-name.d.ts} +0 -0
  74. package/dist/{get-asset-file-name.js → cjs/get-asset-file-name.js} +0 -0
  75. package/dist/cjs/get-environment.d.ts +3 -0
  76. package/dist/{get-environment.js → cjs/get-environment.js} +14 -2
  77. package/dist/cjs/get-preview-dom-element.d.ts +2 -0
  78. package/dist/cjs/get-preview-dom-element.js +8 -0
  79. package/dist/cjs/get-static-files.d.ts +21 -0
  80. package/dist/cjs/get-static-files.js +35 -0
  81. package/dist/{get-timeline-clip-name.d.ts → cjs/get-timeline-clip-name.d.ts} +0 -0
  82. package/dist/{get-timeline-clip-name.js → cjs/get-timeline-clip-name.js} +0 -0
  83. package/dist/cjs/index.d.ts +102 -0
  84. package/dist/cjs/index.js +105 -0
  85. package/dist/cjs/internals.d.ts +132 -0
  86. package/dist/cjs/internals.js +123 -0
  87. package/dist/{interpolate-colors.d.ts → cjs/interpolate-colors.d.ts} +5 -0
  88. package/dist/{interpolate-colors.js → cjs/interpolate-colors.js} +10 -10
  89. package/dist/{interpolate.d.ts → cjs/interpolate.d.ts} +11 -7
  90. package/dist/{interpolate.js → cjs/interpolate.js} +0 -0
  91. package/dist/{is-approximately-the-same.d.ts → cjs/is-approximately-the-same.d.ts} +0 -0
  92. package/dist/{is-approximately-the-same.js → cjs/is-approximately-the-same.js} +0 -0
  93. package/dist/cjs/is-player.d.ts +3 -0
  94. package/dist/cjs/is-player.js +14 -0
  95. package/dist/{loading-indicator.d.ts → cjs/loading-indicator.d.ts} +0 -0
  96. package/dist/{loading-indicator.js → cjs/loading-indicator.js} +4 -4
  97. package/dist/cjs/loop/index.d.ts +13 -0
  98. package/dist/cjs/loop/index.js +45 -0
  99. package/dist/{multiple-versions-warning.d.ts → cjs/multiple-versions-warning.d.ts} +0 -0
  100. package/dist/{multiple-versions-warning.js → cjs/multiple-versions-warning.js} +11 -6
  101. package/dist/{nonce.d.ts → cjs/nonce.d.ts} +1 -1
  102. package/dist/{nonce.js → cjs/nonce.js} +6 -0
  103. package/dist/{play-and-handle-not-allowed-error.d.ts → cjs/play-and-handle-not-allowed-error.d.ts} +0 -0
  104. package/dist/{play-and-handle-not-allowed-error.js → cjs/play-and-handle-not-allowed-error.js} +4 -0
  105. package/dist/{portal-node.d.ts → cjs/portal-node.d.ts} +0 -0
  106. package/dist/{portal-node.js → cjs/portal-node.js} +0 -0
  107. package/dist/cjs/prefetch-state.d.ts +8 -0
  108. package/dist/cjs/prefetch-state.js +27 -0
  109. package/dist/cjs/prefetch.d.ts +13 -0
  110. package/dist/{prefetch.js → cjs/prefetch.js} +43 -17
  111. package/dist/cjs/props-if-has-props.d.ts +10 -0
  112. package/dist/{video-config.js → cjs/props-if-has-props.js} +0 -0
  113. package/dist/cjs/random.d.ts +6 -0
  114. package/dist/{random.js → cjs/random.js} +3 -3
  115. package/dist/{register-root.d.ts → cjs/register-root.d.ts} +4 -0
  116. package/dist/{register-root.js → cjs/register-root.js} +4 -0
  117. package/dist/cjs/resolve-video-config.d.ts +8 -0
  118. package/dist/cjs/resolve-video-config.js +82 -0
  119. package/dist/cjs/series/flatten-children.d.ts +2 -0
  120. package/dist/{series → cjs/series}/flatten-children.js +0 -0
  121. package/dist/cjs/series/index.d.ts +17 -0
  122. package/dist/{series → cjs/series}/index.js +22 -9
  123. package/dist/cjs/setup-env-variables.d.ts +1 -0
  124. package/dist/{setup-env-variables.js → cjs/setup-env-variables.js} +7 -9
  125. package/dist/{spring → cjs/spring}/index.d.ts +10 -6
  126. package/dist/cjs/spring/index.js +75 -0
  127. package/dist/cjs/spring/measure-spring.d.ts +12 -0
  128. package/dist/{spring → cjs/spring}/measure-spring.js +8 -4
  129. package/dist/{spring → cjs/spring}/spring-utils.d.ts +2 -2
  130. package/dist/{spring → cjs/spring}/spring-utils.js +0 -0
  131. package/dist/cjs/static-file.d.ts +33 -0
  132. package/dist/cjs/static-file.js +87 -0
  133. package/dist/{timeline-position-state.d.ts → cjs/timeline-position-state.d.ts} +9 -7
  134. package/dist/cjs/timeline-position-state.js +67 -0
  135. package/dist/cjs/truthy.d.ts +3 -0
  136. package/dist/{truthy.js → cjs/truthy.js} +0 -0
  137. package/dist/cjs/use-current-frame.d.ts +5 -0
  138. package/dist/{use-current-frame.js → cjs/use-current-frame.js} +8 -9
  139. package/dist/cjs/use-lazy-component.d.ts +7 -0
  140. package/dist/{use-lazy-component.js → cjs/use-lazy-component.js} +0 -0
  141. package/dist/{use-media-in-timeline.d.ts → cjs/use-media-in-timeline.d.ts} +3 -2
  142. package/dist/{use-media-in-timeline.js → cjs/use-media-in-timeline.js} +29 -25
  143. package/dist/{use-media-playback.d.ts → cjs/use-media-playback.d.ts} +3 -1
  144. package/dist/cjs/use-media-playback.js +86 -0
  145. package/dist/{use-media-tag-volume.d.ts → cjs/use-media-tag-volume.d.ts} +0 -0
  146. package/dist/{use-media-tag-volume.js → cjs/use-media-tag-volume.js} +0 -0
  147. package/dist/{use-sync-volume-with-media-tag.d.ts → cjs/use-sync-volume-with-media-tag.d.ts} +2 -2
  148. package/dist/{use-sync-volume-with-media-tag.js → cjs/use-sync-volume-with-media-tag.js} +5 -4
  149. package/dist/{use-unsafe-video-config.d.ts → cjs/use-unsafe-video-config.d.ts} +1 -1
  150. package/dist/{use-unsafe-video-config.js → cjs/use-unsafe-video-config.js} +6 -5
  151. package/dist/cjs/use-video-config.d.ts +8 -0
  152. package/dist/cjs/use-video-config.js +34 -0
  153. package/dist/cjs/use-video.d.ts +7 -0
  154. package/dist/cjs/use-video.js +38 -0
  155. package/dist/cjs/validate-frame.d.ts +5 -0
  156. package/dist/cjs/validate-frame.js +24 -0
  157. package/dist/cjs/validate-media-props.d.ts +4 -0
  158. package/dist/{validate-media-props.js → cjs/validate-media-props.js} +0 -0
  159. package/dist/{validate-start-from-props.d.ts → cjs/validate-start-from-props.d.ts} +0 -0
  160. package/dist/{validate-start-from-props.js → cjs/validate-start-from-props.js} +0 -0
  161. package/dist/{validation → cjs/validation}/validate-composition-id.d.ts +0 -0
  162. package/dist/{validation → cjs/validation}/validate-composition-id.js +0 -0
  163. package/dist/cjs/validation/validate-default-props.d.ts +1 -0
  164. package/dist/cjs/validation/validate-default-props.js +15 -0
  165. package/dist/cjs/validation/validate-dimensions.d.ts +1 -0
  166. package/dist/{validation → cjs/validation}/validate-dimensions.js +2 -2
  167. package/dist/cjs/validation/validate-duration-in-frames.d.ts +4 -0
  168. package/dist/{validation → cjs/validation}/validate-duration-in-frames.js +10 -3
  169. package/dist/{validation → cjs/validation}/validate-folder-name.d.ts +0 -0
  170. package/dist/{validation → cjs/validation}/validate-folder-name.js +0 -0
  171. package/dist/cjs/validation/validate-fps.d.ts +1 -0
  172. package/dist/{validation → cjs/validation}/validate-fps.js +2 -2
  173. package/dist/{validation → cjs/validation}/validation-spring-duration.d.ts +0 -0
  174. package/dist/{validation → cjs/validation}/validation-spring-duration.js +0 -0
  175. package/dist/cjs/version.d.ts +1 -0
  176. package/dist/{version.js → cjs/version.js} +1 -1
  177. package/dist/cjs/video/OffthreadVideo.d.ts +7 -0
  178. package/dist/cjs/video/OffthreadVideo.js +40 -0
  179. package/dist/{video → cjs/video}/OffthreadVideoForRendering.d.ts +1 -1
  180. package/dist/cjs/video/OffthreadVideoForRendering.js +103 -0
  181. package/dist/cjs/video/Video.d.ts +12 -0
  182. package/dist/cjs/video/Video.js +55 -0
  183. package/dist/{video → cjs/video}/VideoForDevelopment.d.ts +5 -2
  184. package/dist/cjs/video/VideoForDevelopment.js +117 -0
  185. package/dist/cjs/video/VideoForRendering.d.ts +10 -0
  186. package/dist/cjs/video/VideoForRendering.js +208 -0
  187. package/dist/cjs/video/duration-state.d.ts +17 -0
  188. package/dist/cjs/video/duration-state.js +35 -0
  189. package/dist/{video → cjs/video}/get-current-time.d.ts +0 -0
  190. package/dist/{video → cjs/video}/get-current-time.js +12 -11
  191. package/dist/cjs/video/index.d.ts +3 -0
  192. package/dist/{video → cjs/video}/index.js +4 -4
  193. package/dist/cjs/video/props.d.ts +32 -0
  194. package/dist/cjs/video/props.js +2 -0
  195. package/dist/cjs/video/video-fragment.d.ts +12 -0
  196. package/dist/cjs/video/video-fragment.js +60 -0
  197. package/dist/cjs/video-config.d.ts +9 -0
  198. package/dist/{video/props.js → cjs/video-config.js} +0 -0
  199. package/dist/{volume-position-state.d.ts → cjs/volume-position-state.d.ts} +4 -4
  200. package/dist/{volume-position-state.js → cjs/volume-position-state.js} +0 -0
  201. package/dist/{volume-prop.d.ts → cjs/volume-prop.d.ts} +3 -2
  202. package/dist/{volume-prop.js → cjs/volume-prop.js} +4 -3
  203. package/dist/{warn-about-non-seekable-media.d.ts → cjs/warn-about-non-seekable-media.d.ts} +0 -0
  204. package/dist/{warn-about-non-seekable-media.js → cjs/warn-about-non-seekable-media.js} +2 -2
  205. package/dist/cjs/wrap-remotion-context.d.ts +31 -0
  206. package/dist/cjs/wrap-remotion-context.js +85 -0
  207. package/dist/esm/index.mjs +4643 -0
  208. package/dist/esm/version.mjs +4 -0
  209. package/package.json +80 -57
  210. package/version.js +2 -1
  211. package/.prettierrc.js +0 -14
  212. package/.turbo/turbo-build.log +0 -5
  213. package/dist/Composition.d.ts +0 -22
  214. package/dist/Composition.js +0 -98
  215. package/dist/CompositionManager.d.ts +0 -79
  216. package/dist/Img.d.ts +0 -2
  217. package/dist/Img.js +0 -51
  218. package/dist/RemotionRoot.js +0 -71
  219. package/dist/Sequence.d.ts +0 -29
  220. package/dist/Still.d.ts +0 -3
  221. package/dist/Still.js +0 -9
  222. package/dist/audio/Audio.js +0 -32
  223. package/dist/audio/AudioForDevelopment.d.ts +0 -8
  224. package/dist/audio/AudioForDevelopment.js +0 -71
  225. package/dist/audio/AudioForRendering.d.ts +0 -6
  226. package/dist/audio/AudioForRendering.js +0 -75
  227. package/dist/audio/index.d.ts +0 -2
  228. package/dist/audio/props.d.ts +0 -10
  229. package/dist/config.d.ts +0 -218
  230. package/dist/config.js +0 -21
  231. package/dist/freeze.d.ts +0 -7
  232. package/dist/get-environment.d.ts +0 -2
  233. package/dist/get-preview-dom-element.d.ts +0 -1
  234. package/dist/get-preview-dom-element.js +0 -7
  235. package/dist/index.d.ts +0 -72
  236. package/dist/index.js +0 -58
  237. package/dist/internals.d.ts +0 -88
  238. package/dist/internals.js +0 -93
  239. package/dist/loop/index.d.ts +0 -9
  240. package/dist/loop/index.js +0 -28
  241. package/dist/prefetch-state.d.ts +0 -13
  242. package/dist/prefetch-state.js +0 -26
  243. package/dist/prefetch.d.ts +0 -7
  244. package/dist/random.d.ts +0 -6
  245. package/dist/series/flatten-children.d.ts +0 -2
  246. package/dist/series/index.d.ts +0 -13
  247. package/dist/setup-env-variables.d.ts +0 -2
  248. package/dist/spring/index.js +0 -51
  249. package/dist/spring/measure-spring.d.ts +0 -8
  250. package/dist/static-file.d.ts +0 -1
  251. package/dist/static-file.js +0 -29
  252. package/dist/timeline-position-state.js +0 -41
  253. package/dist/truthy.d.ts +0 -3
  254. package/dist/use-current-frame.d.ts +0 -6
  255. package/dist/use-lazy-component.d.ts +0 -7
  256. package/dist/use-media-playback.js +0 -75
  257. package/dist/use-video-config.d.ts +0 -7
  258. package/dist/use-video-config.js +0 -26
  259. package/dist/use-video.d.ts +0 -13
  260. package/dist/use-video.js +0 -28
  261. package/dist/validate-media-props.d.ts +0 -4
  262. package/dist/validation/validate-dimensions.d.ts +0 -1
  263. package/dist/validation/validate-duration-in-frames.d.ts +0 -1
  264. package/dist/validation/validate-fps.d.ts +0 -1
  265. package/dist/validation/validate-offthreadvideo-image-format.d.ts +0 -1
  266. package/dist/validation/validate-offthreadvideo-image-format.js +0 -15
  267. package/dist/version.d.ts +0 -1
  268. package/dist/video/LoopedVideo.d.ts +0 -3
  269. package/dist/video/LoopedVideo.js +0 -16
  270. package/dist/video/OffthreadVideo.d.ts +0 -3
  271. package/dist/video/OffthreadVideo.js +0 -27
  272. package/dist/video/OffthreadVideoForRendering.js +0 -101
  273. package/dist/video/Video.d.ts +0 -6
  274. package/dist/video/Video.js +0 -29
  275. package/dist/video/VideoForDevelopment.js +0 -69
  276. package/dist/video/VideoForRendering.d.ts +0 -6
  277. package/dist/video/VideoForRendering.js +0 -168
  278. package/dist/video/duration-state.d.ts +0 -8
  279. package/dist/video/duration-state.js +0 -15
  280. package/dist/video/index.d.ts +0 -3
  281. package/dist/video/props.d.ts +0 -21
  282. package/dist/video-config.d.ts +0 -8
  283. package/dist/wrap-remotion-context.d.ts +0 -14
  284. package/dist/wrap-remotion-context.js +0 -65
  285. package/ensure-correct-version.js +0 -24
  286. package/tsconfig.json +0 -12
  287. package/version.d.ts +0 -1
@@ -3,17 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Series = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const Sequence_1 = require("../Sequence");
7
- const validate_duration_in_frames_1 = require("../validation/validate-duration-in-frames");
8
- const flatten_children_1 = require("./flatten-children");
9
- const SeriesSequence = ({ children }) => {
6
+ const Sequence_js_1 = require("../Sequence.js");
7
+ const validate_duration_in_frames_js_1 = require("../validation/validate-duration-in-frames.js");
8
+ const flatten_children_js_1 = require("./flatten-children.js");
9
+ const SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
10
+ // Discard ref
10
11
  // eslint-disable-next-line react/jsx-no-useless-fragment
11
12
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
12
13
  };
14
+ const SeriesSequence = (0, react_1.forwardRef)(SeriesSequenceRefForwardingFunction);
15
+ /**
16
+ * @description with this component, you can easily stitch together scenes that should play sequentially after another.
17
+ * @see [Documentation](https://www.remotion.dev/docs/series)
18
+ */
13
19
  const Series = ({ children }) => {
14
20
  const childrenValue = (0, react_1.useMemo)(() => {
15
21
  let startFrame = 0;
16
- return react_1.Children.map((0, flatten_children_1.flattenChildren)(children), (child, i) => {
22
+ const flattenedChildren = (0, flatten_children_js_1.flattenChildren)(children);
23
+ return react_1.Children.map(flattenedChildren, (child, i) => {
17
24
  var _a;
18
25
  const castedChild = child;
19
26
  if (typeof castedChild === 'string') {
@@ -27,12 +34,18 @@ const Series = ({ children }) => {
27
34
  throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as it's children, but got ${castedChild} instead`);
28
35
  }
29
36
  const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
30
- if (!castedChild || !castedChild.props.children) {
37
+ if (!(castedChild === null || castedChild === void 0 ? void 0 : castedChild.props.children)) {
31
38
  throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
32
39
  }
33
40
  const durationInFramesProp = castedChild.props.durationInFrames;
34
- const { durationInFrames, children: _children, ...passedProps } = castedChild.props;
35
- (0, validate_duration_in_frames_1.validateDurationInFrames)(durationInFramesProp, `of a <Series.Sequence /> component`);
41
+ const { durationInFrames, children: _children, from, ...passedProps } = castedChild.props; // `from` is not accepted and must be filtered out if used in JS
42
+ if (i !== flattenedChildren.length - 1 ||
43
+ durationInFramesProp !== Infinity) {
44
+ (0, validate_duration_in_frames_js_1.validateDurationInFrames)(durationInFramesProp, {
45
+ component: `of a <Series.Sequence /> component`,
46
+ allowFloats: true,
47
+ });
48
+ }
36
49
  const offset = (_a = castedChild.props.offset) !== null && _a !== void 0 ? _a : 0;
37
50
  if (Number.isNaN(offset)) {
38
51
  throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
@@ -45,7 +58,7 @@ const Series = ({ children }) => {
45
58
  }
46
59
  const currentStartFrame = startFrame + offset;
47
60
  startFrame += durationInFramesProp + offset;
48
- return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, children: child }));
61
+ return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, ref: castedChild.ref, children: child }));
49
62
  });
50
63
  }, [children]);
51
64
  /* eslint-disable react/jsx-no-useless-fragment */
@@ -0,0 +1 @@
1
+ export declare const setupEnvVariables: () => void;
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupEnvVariables = exports.ENV_VARIABLES_ENV_NAME = void 0;
4
- const get_environment_1 = require("./get-environment");
5
- exports.ENV_VARIABLES_ENV_NAME = 'ENV_VARIABLES';
3
+ exports.setupEnvVariables = void 0;
4
+ const get_environment_js_1 = require("./get-environment.js");
6
5
  const getEnvVariables = () => {
7
- if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
6
+ if ((0, get_environment_js_1.getRemotionEnvironment)() === 'rendering') {
8
7
  const param = window.remotion_envVariables;
9
8
  if (!param) {
10
9
  return {};
11
10
  }
12
11
  return { ...JSON.parse(param), NODE_ENV: process.env.NODE_ENV };
13
12
  }
14
- if ((0, get_environment_1.getRemotionEnvironment)() === 'preview') {
15
- // Webpack will convert this to an object at compile time.
16
- // Don't convert this syntax to a computed property.
13
+ if ((0, get_environment_js_1.getRemotionEnvironment)() === 'preview') {
14
+ // For the Preview, we already set the environment variables in index-html.ts.
15
+ // We just add NODE_ENV here.
17
16
  return {
18
- ...process.env.ENV_VARIABLES,
19
- NODE_ENV: process.env.NODE_ENV,
17
+ NODE_ENV: 'development',
20
18
  };
21
19
  }
22
20
  throw new Error('Can only call getEnvVariables() if environment is `rendering` or `preview`');
@@ -1,9 +1,10 @@
1
- import type { SpringConfig } from './spring-utils';
1
+ import type { SpringConfig } from './spring-utils.js';
2
2
  /**
3
- * Calculates a position based on physical parameters, start and end value, and time.
4
- * @link https://www.remotion.dev/docs/spring
3
+ * @description Calculates a position based on physical parameters, start and end value, and time.
4
+ * @see [Documentation](https://www.remotion.dev/docs/spring)
5
5
  * @param {number} frame The current time value. Most of the time you want to pass in the return value of useCurrentFrame.
6
6
  * @param {number} fps The framerate at which the animation runs. Pass in the value obtained by `useVideoConfig()`.
7
+ * @param {?boolean} reverse Whether the animation plays in reverse or not. Default `false`.
7
8
  * @param {?Object} config optional object that allows you to customize the physical properties of the animation.
8
9
  * @param {number} [config.mass=1] The weight of the spring. If you reduce the mass, the animation becomes faster!
9
10
  * @param {number} [config.damping=10] How hard the animation decelerates.
@@ -13,8 +14,9 @@ import type { SpringConfig } from './spring-utils';
13
14
  * @param {?number} [config.to] The end value of the animation. Default `1`
14
15
  * @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
15
16
  * @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
17
+ * @param {?number} [config.delay] Delay the animation for this amount of frames. Default `0`
16
18
  */
17
- export declare function spring({ frame, fps, config, from, to, durationInFrames, durationRestThreshold, }: {
19
+ export declare function spring({ frame: passedFrame, fps, config, from, to, durationInFrames: passedDurationInFrames, durationRestThreshold, delay, reverse, }: {
18
20
  frame: number;
19
21
  fps: number;
20
22
  config?: Partial<SpringConfig>;
@@ -22,6 +24,8 @@ export declare function spring({ frame, fps, config, from, to, durationInFrames,
22
24
  to?: number;
23
25
  durationInFrames?: number;
24
26
  durationRestThreshold?: number;
27
+ delay?: number;
28
+ reverse?: boolean;
25
29
  }): number;
26
- export { measureSpring } from './measure-spring';
27
- export { SpringConfig } from './spring-utils';
30
+ export { measureSpring } from './measure-spring.js';
31
+ export { SpringConfig } from './spring-utils.js';
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.measureSpring = exports.spring = void 0;
4
+ const validate_frame_js_1 = require("../validate-frame.js");
5
+ const validate_fps_js_1 = require("../validation/validate-fps.js");
6
+ const validation_spring_duration_js_1 = require("../validation/validation-spring-duration.js");
7
+ const measure_spring_js_1 = require("./measure-spring.js");
8
+ const spring_utils_js_1 = require("./spring-utils.js");
9
+ /**
10
+ * @description Calculates a position based on physical parameters, start and end value, and time.
11
+ * @see [Documentation](https://www.remotion.dev/docs/spring)
12
+ * @param {number} frame The current time value. Most of the time you want to pass in the return value of useCurrentFrame.
13
+ * @param {number} fps The framerate at which the animation runs. Pass in the value obtained by `useVideoConfig()`.
14
+ * @param {?boolean} reverse Whether the animation plays in reverse or not. Default `false`.
15
+ * @param {?Object} config optional object that allows you to customize the physical properties of the animation.
16
+ * @param {number} [config.mass=1] The weight of the spring. If you reduce the mass, the animation becomes faster!
17
+ * @param {number} [config.damping=10] How hard the animation decelerates.
18
+ * @param {number} [config.stiffness=100] Affects bounciness of the animation.
19
+ * @param {boolean} [config.overshootClamping=false] Whether to prevent the animation going beyond the target value.
20
+ * @param {?number} [config.from] The initial value of the animation. Default `0`
21
+ * @param {?number} [config.to] The end value of the animation. Default `1`
22
+ * @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
23
+ * @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
24
+ * @param {?number} [config.delay] Delay the animation for this amount of frames. Default `0`
25
+ */
26
+ function spring({ frame: passedFrame, fps, config = {}, from = 0, to = 1, durationInFrames: passedDurationInFrames, durationRestThreshold, delay = 0, reverse = false, }) {
27
+ (0, validation_spring_duration_js_1.validateSpringDuration)(passedDurationInFrames);
28
+ (0, validate_frame_js_1.validateFrame)({
29
+ frame: passedFrame,
30
+ durationInFrames: Infinity,
31
+ allowFloats: true,
32
+ });
33
+ (0, validate_fps_js_1.validateFps)(fps, 'to spring()', false);
34
+ const needsToCalculateNaturalDuration = reverse || typeof passedDurationInFrames !== 'undefined';
35
+ const naturalDuration = needsToCalculateNaturalDuration
36
+ ? (0, measure_spring_js_1.measureSpring)({
37
+ fps,
38
+ config,
39
+ from,
40
+ to,
41
+ threshold: durationRestThreshold,
42
+ })
43
+ : undefined;
44
+ const naturalDurationGetter = needsToCalculateNaturalDuration
45
+ ? {
46
+ get: () => naturalDuration,
47
+ }
48
+ : {
49
+ get: () => {
50
+ throw new Error('did not calculate natural duration, this is an error with Remotion. Please report');
51
+ },
52
+ };
53
+ const frame = (reverse
54
+ ? (passedDurationInFrames !== null && passedDurationInFrames !== void 0 ? passedDurationInFrames : naturalDurationGetter.get()) - passedFrame
55
+ : passedFrame) - (reverse ? -delay : delay);
56
+ const spr = (0, spring_utils_js_1.springCalculation)({
57
+ fps,
58
+ frame: passedDurationInFrames === undefined
59
+ ? frame
60
+ : frame / (passedDurationInFrames / naturalDurationGetter.get()),
61
+ config,
62
+ from,
63
+ to,
64
+ });
65
+ if (!config.overshootClamping) {
66
+ return spr.current;
67
+ }
68
+ if (to >= from) {
69
+ return Math.min(spr.current, to);
70
+ }
71
+ return Math.max(spr.current, to);
72
+ }
73
+ exports.spring = spring;
74
+ var measure_spring_js_2 = require("./measure-spring.js");
75
+ Object.defineProperty(exports, "measureSpring", { enumerable: true, get: function () { return measure_spring_js_2.measureSpring; } });
@@ -0,0 +1,12 @@
1
+ import type { SpringConfig } from './spring-utils.js';
2
+ /**
3
+ * @description The function returns how long it takes for a spring animation to settle
4
+ * @see [Documentation](https://www.remotion.dev/docs/measure-spring)
5
+ */
6
+ export declare function measureSpring({ fps, config, threshold, from, to, }: {
7
+ fps: number;
8
+ config?: Partial<SpringConfig>;
9
+ threshold?: number;
10
+ from?: number;
11
+ to?: number;
12
+ }): number;
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.measureSpring = void 0;
4
- const validate_fps_1 = require("../validation/validate-fps");
5
- const spring_utils_1 = require("./spring-utils");
4
+ const validate_fps_js_1 = require("../validation/validate-fps.js");
5
+ const spring_utils_js_1 = require("./spring-utils.js");
6
+ /**
7
+ * @description The function returns how long it takes for a spring animation to settle
8
+ * @see [Documentation](https://www.remotion.dev/docs/measure-spring)
9
+ */
6
10
  function measureSpring({ fps, config = {}, threshold = 0.005, from = 0, to = 1, }) {
7
11
  if (typeof threshold !== 'number') {
8
12
  throw new TypeError(`threshold must be a number, got ${threshold} of type ${typeof threshold}`);
@@ -22,12 +26,12 @@ function measureSpring({ fps, config = {}, threshold = 0.005, from = 0, to = 1,
22
26
  if (threshold < 0) {
23
27
  throw new TypeError('Threshold is below 0');
24
28
  }
25
- (0, validate_fps_1.validateFps)(fps, 'to the measureSpring() function', false);
29
+ (0, validate_fps_js_1.validateFps)(fps, 'to the measureSpring() function', false);
26
30
  const range = Math.abs(from - to);
27
31
  let frame = 0;
28
32
  let finishedFrame = 0;
29
33
  const calc = () => {
30
- return (0, spring_utils_1.springCalculation)({
34
+ return (0, spring_utils_js_1.springCalculation)({
31
35
  fps,
32
36
  frame,
33
37
  config,
@@ -1,11 +1,11 @@
1
- declare type AnimationNode = {
1
+ type AnimationNode = {
2
2
  lastTimestamp: number;
3
3
  toValue: number;
4
4
  current: number;
5
5
  velocity: number;
6
6
  prevPosition?: number;
7
7
  };
8
- export declare type SpringConfig = {
8
+ export type SpringConfig = {
9
9
  damping: number;
10
10
  mass: number;
11
11
  stiffness: number;
File without changes
@@ -0,0 +1,33 @@
1
+ declare const problematicCharacters: {
2
+ '%3A': string;
3
+ '%2F': string;
4
+ '%3F': string;
5
+ '%23': string;
6
+ '%5B': string;
7
+ '%5D': string;
8
+ '%40': string;
9
+ '%21': string;
10
+ '%24': string;
11
+ '%26': string;
12
+ '%27': string;
13
+ '%28': string;
14
+ '%29': string;
15
+ '%2A': string;
16
+ '%2B': string;
17
+ '%2C': string;
18
+ '%3B': string;
19
+ };
20
+ type HexCode = keyof typeof problematicCharacters;
21
+ export type HexInfo = {
22
+ containsHex: false;
23
+ } | {
24
+ containsHex: true;
25
+ hexCode: HexCode;
26
+ };
27
+ export declare const includesHexOfUnsafeChar: (path: string) => HexInfo;
28
+ /**
29
+ * @description Reference a file from the public/ folder. If the file does not appear in the autocomplete, type the path manually.
30
+ * @see [Documentation](https://www.remotion.dev/docs/staticfile)
31
+ */
32
+ export declare const staticFile: (path: string) => string;
33
+ export {};
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.staticFile = exports.includesHexOfUnsafeChar = void 0;
4
+ const problematicCharacters = {
5
+ '%3A': ':',
6
+ '%2F': '/',
7
+ '%3F': '?',
8
+ '%23': '#',
9
+ '%5B': '[',
10
+ '%5D': ']',
11
+ '%40': '@',
12
+ '%21': '!',
13
+ '%24': '$',
14
+ '%26': '&',
15
+ '%27': "'",
16
+ '%28': '(',
17
+ '%29': ')',
18
+ '%2A': '*',
19
+ '%2B': '+',
20
+ '%2C': ',',
21
+ '%3B': ';',
22
+ };
23
+ const didWarn = {};
24
+ const warnOnce = (message) => {
25
+ if (didWarn[message]) {
26
+ return;
27
+ }
28
+ console.warn(message);
29
+ didWarn[message] = true;
30
+ };
31
+ const includesHexOfUnsafeChar = (path) => {
32
+ for (const key of Object.keys(problematicCharacters)) {
33
+ if (path.includes(key)) {
34
+ return { containsHex: true, hexCode: key };
35
+ }
36
+ }
37
+ return { containsHex: false };
38
+ };
39
+ exports.includesHexOfUnsafeChar = includesHexOfUnsafeChar;
40
+ const trimLeadingSlash = (path) => {
41
+ if (path.startsWith('/')) {
42
+ return trimLeadingSlash(path.substring(1));
43
+ }
44
+ return path;
45
+ };
46
+ const inner = (path) => {
47
+ if (typeof window !== 'undefined' && window.remotion_staticBase) {
48
+ return `${window.remotion_staticBase}/${trimLeadingSlash(path)}`;
49
+ }
50
+ return `/${trimLeadingSlash(path)}`;
51
+ };
52
+ /**
53
+ * @description Reference a file from the public/ folder. If the file does not appear in the autocomplete, type the path manually.
54
+ * @see [Documentation](https://www.remotion.dev/docs/staticfile)
55
+ */
56
+ const staticFile = (path) => {
57
+ if (path.startsWith('http://') || path.startsWith('https://')) {
58
+ throw new TypeError(`staticFile() does not support remote URLs - got "${path}". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`);
59
+ }
60
+ if (path.startsWith('..') || path.startsWith('./')) {
61
+ throw new TypeError(`staticFile() does not support relative paths - got "${path}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);
62
+ }
63
+ if (path.startsWith('/Users') ||
64
+ path.startsWith('/home') ||
65
+ path.startsWith('/tmp') ||
66
+ path.startsWith('/etc') ||
67
+ path.startsWith('/opt') ||
68
+ path.startsWith('/var') ||
69
+ path.startsWith('C:') ||
70
+ path.startsWith('D:') ||
71
+ path.startsWith('E:')) {
72
+ throw new TypeError(`staticFile() does not support absolute paths - got "${path}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);
73
+ }
74
+ if (path.startsWith('public/')) {
75
+ throw new TypeError(`Do not include the public/ prefix when using staticFile() - got "${path}". See: https://remotion.dev/docs/staticfile-relative-paths`);
76
+ }
77
+ const includesHex = (0, exports.includesHexOfUnsafeChar)(path);
78
+ if (includesHex.containsHex) {
79
+ warnOnce(`WARNING: You seem to pass an already encoded path (path contains ${includesHex.hexCode}). Since Remotion 4.0, the encoding is done by staticFile() itself. You may want to remove a encodeURIComponent() wrapping.`);
80
+ }
81
+ const preparsed = inner(encodeURIComponent(path));
82
+ if (!preparsed.startsWith('/')) {
83
+ return `/${preparsed}`;
84
+ }
85
+ return preparsed;
86
+ };
87
+ exports.staticFile = staticFile;
@@ -1,10 +1,10 @@
1
1
  import type { MutableRefObject } from 'react';
2
- export declare type PlayableMediaTag = {
2
+ export type PlayableMediaTag = {
3
3
  play: () => void;
4
4
  id: string;
5
5
  };
6
- export declare type TimelineContextValue = {
7
- frame: number;
6
+ export type TimelineContextValue = {
7
+ frame: Record<string, number>;
8
8
  playing: boolean;
9
9
  rootId: string;
10
10
  playbackRate: number;
@@ -12,15 +12,17 @@ export declare type TimelineContextValue = {
12
12
  setPlaybackRate: (u: React.SetStateAction<number>) => void;
13
13
  audioAndVideoTags: MutableRefObject<PlayableMediaTag[]>;
14
14
  };
15
- export declare type SetTimelineContextValue = {
16
- setFrame: (u: React.SetStateAction<number>) => void;
15
+ export type SetTimelineContextValue = {
16
+ setFrame: (u: React.SetStateAction<Record<string, number>>) => void;
17
17
  setPlaying: (u: React.SetStateAction<boolean>) => void;
18
18
  };
19
19
  export declare const TimelineContext: import("react").Context<TimelineContextValue>;
20
20
  export declare const SetTimelineContext: import("react").Context<SetTimelineContextValue>;
21
+ export declare const persistCurrentFrame: (frame: number, composition: string) => void;
22
+ export declare const getFrameForComposition: (composition: string) => number;
21
23
  export declare const useTimelinePosition: () => number;
22
- export declare const useTimelineSetFrame: () => (u: React.SetStateAction<number>) => void;
23
- declare type PlayingReturnType = readonly [
24
+ export declare const useTimelineSetFrame: () => (u: React.SetStateAction<Record<string, number>>) => void;
25
+ type PlayingReturnType = readonly [
24
26
  boolean,
25
27
  (u: React.SetStateAction<boolean>) => void,
26
28
  MutableRefObject<boolean>
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usePlayingState = exports.useTimelineSetFrame = exports.useTimelinePosition = exports.getFrameForComposition = exports.persistCurrentFrame = exports.SetTimelineContext = exports.TimelineContext = void 0;
4
+ const react_1 = require("react");
5
+ const use_video_js_1 = require("./use-video.js");
6
+ exports.TimelineContext = (0, react_1.createContext)({
7
+ frame: {},
8
+ playing: false,
9
+ playbackRate: 1,
10
+ rootId: '',
11
+ imperativePlaying: {
12
+ current: false,
13
+ },
14
+ setPlaybackRate: () => {
15
+ throw new Error('default');
16
+ },
17
+ audioAndVideoTags: { current: [] },
18
+ });
19
+ exports.SetTimelineContext = (0, react_1.createContext)({
20
+ setFrame: () => {
21
+ throw new Error('default');
22
+ },
23
+ setPlaying: () => {
24
+ throw new Error('default');
25
+ },
26
+ });
27
+ const makeKey = (composition) => {
28
+ return `remotion.time.${composition}`;
29
+ };
30
+ const persistCurrentFrame = (frame, composition) => {
31
+ localStorage.setItem(makeKey(composition), String(frame));
32
+ };
33
+ exports.persistCurrentFrame = persistCurrentFrame;
34
+ const getFrameForComposition = (composition) => {
35
+ var _a, _b;
36
+ const frame = localStorage.getItem(makeKey(composition));
37
+ return frame
38
+ ? Number(frame)
39
+ : (_b = (typeof window === 'undefined' ? 0 : (_a = window.remotion_initialFrame) !== null && _a !== void 0 ? _a : 0)) !== null && _b !== void 0 ? _b : 0;
40
+ };
41
+ exports.getFrameForComposition = getFrameForComposition;
42
+ const useTimelinePosition = () => {
43
+ var _a, _b;
44
+ const videoConfig = (0, use_video_js_1.useVideo)();
45
+ const state = (0, react_1.useContext)(exports.TimelineContext);
46
+ if (!videoConfig) {
47
+ return typeof window === 'undefined'
48
+ ? 0
49
+ : (_a = window.remotion_initialFrame) !== null && _a !== void 0 ? _a : 0;
50
+ }
51
+ const unclamped = (_b = state.frame[videoConfig.id]) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && window.remotion_isPlayer
52
+ ? 0
53
+ : (0, exports.getFrameForComposition)(videoConfig.id));
54
+ return Math.min(videoConfig.durationInFrames - 1, unclamped);
55
+ };
56
+ exports.useTimelinePosition = useTimelinePosition;
57
+ const useTimelineSetFrame = () => {
58
+ const { setFrame } = (0, react_1.useContext)(exports.SetTimelineContext);
59
+ return setFrame;
60
+ };
61
+ exports.useTimelineSetFrame = useTimelineSetFrame;
62
+ const usePlayingState = () => {
63
+ const { playing, imperativePlaying } = (0, react_1.useContext)(exports.TimelineContext);
64
+ const { setPlaying } = (0, react_1.useContext)(exports.SetTimelineContext);
65
+ return (0, react_1.useMemo)(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
66
+ };
67
+ exports.usePlayingState = usePlayingState;
@@ -0,0 +1,3 @@
1
+ type Truthy<T> = T extends false | '' | 0 | null | undefined ? never : T;
2
+ export declare function truthy<T>(value: T): value is Truthy<T>;
3
+ export {};
File without changes
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @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.
3
+ * @see [Documentation](https://remotion.dev/docs/use-current-frame)
4
+ */
5
+ export declare const useCurrentFrame: () => number;
@@ -2,24 +2,23 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCurrentFrame = void 0;
4
4
  const react_1 = require("react");
5
- const CanUseRemotionHooks_1 = require("./CanUseRemotionHooks");
6
- const Sequence_1 = require("./Sequence");
7
- const timeline_position_state_1 = require("./timeline-position-state");
5
+ const CanUseRemotionHooks_js_1 = require("./CanUseRemotionHooks.js");
6
+ const SequenceContext_js_1 = require("./SequenceContext.js");
7
+ const timeline_position_state_js_1 = require("./timeline-position-state.js");
8
8
  /**
9
- * Get the current frame of the video.
10
- * Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
11
- * @link https://www.remotion.dev/docs/use-current-frame
9
+ * @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.
10
+ * @see [Documentation](https://remotion.dev/docs/use-current-frame)
12
11
  */
13
12
  const useCurrentFrame = () => {
14
- const canUseRemotionHooks = (0, react_1.useContext)(CanUseRemotionHooks_1.CanUseRemotionHooks);
13
+ const canUseRemotionHooks = (0, react_1.useContext)(CanUseRemotionHooks_js_1.CanUseRemotionHooks);
15
14
  if (!canUseRemotionHooks) {
16
15
  if (typeof window !== 'undefined' && window.remotion_isPlayer) {
17
16
  throw new Error(`useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples`);
18
17
  }
19
18
  throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
20
19
  }
21
- const frame = (0, timeline_position_state_1.useTimelinePosition)();
22
- const context = (0, react_1.useContext)(Sequence_1.SequenceContext);
20
+ const frame = (0, timeline_position_state_js_1.useTimelinePosition)();
21
+ const context = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
23
22
  const contextOffset = context
24
23
  ? context.cumulatedFrom + context.relativeFrom
25
24
  : 0;
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef, ComponentType, ExoticComponent } from 'react';
2
+ import type { CompProps } from './Composition.js';
3
+ type LazyExoticComponent<T extends ComponentType<any>> = ExoticComponent<ComponentPropsWithRef<T>> & {
4
+ readonly _result: T;
5
+ };
6
+ export declare const useLazyComponent: <Props>(compProps: CompProps<Props>) => LazyExoticComponent<ComponentType<Props>>;
7
+ export {};
@@ -1,9 +1,10 @@
1
1
  import type { RefObject } from 'react';
2
- import type { VolumeProp } from './volume-prop';
3
- export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src, mediaType, }: {
2
+ import type { VolumeProp } from './volume-prop.js';
3
+ export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, }: {
4
4
  volume: VolumeProp | undefined;
5
5
  mediaVolume: number;
6
6
  mediaRef: RefObject<HTMLAudioElement | HTMLVideoElement>;
7
7
  src: string | undefined;
8
8
  mediaType: 'audio' | 'video';
9
+ playbackRate: number;
9
10
  }) => void;