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.
- package/dist/Sequence.js +1 -1
- package/dist/Still.d.ts +0 -1
- package/dist/audio/Audio.d.ts +2 -2
- package/dist/audio/AudioForDevelopment.d.ts +1 -1
- package/dist/audio/AudioForRendering.d.ts +1 -1
- package/dist/cjs/AbsoluteFill.d.ts +6 -0
- package/dist/cjs/AbsoluteFill.js +28 -0
- package/dist/cjs/CanUseRemotionHooks.d.ts +5 -0
- package/dist/cjs/CanUseRemotionHooks.js +10 -0
- package/dist/cjs/Clipper.d.ts +7 -0
- package/dist/cjs/Clipper.js +24 -0
- package/dist/cjs/Composition.d.ts +23 -0
- package/dist/cjs/Composition.js +113 -0
- package/dist/cjs/CompositionManager.d.ts +82 -0
- package/dist/cjs/CompositionManager.js +164 -0
- package/dist/cjs/Folder.d.ts +15 -0
- package/dist/cjs/Folder.js +33 -0
- package/dist/cjs/IFrame.d.ts +2 -0
- package/dist/cjs/IFrame.js +24 -0
- package/dist/cjs/Img.d.ts +2 -0
- package/dist/cjs/Img.js +52 -0
- package/dist/cjs/NativeLayers.d.ts +13 -0
- package/dist/cjs/NativeLayers.js +29 -0
- package/dist/cjs/Null.d.ts +2 -0
- package/dist/cjs/Null.js +25 -0
- package/dist/cjs/RemotionRoot.d.ts +5 -0
- package/dist/cjs/RemotionRoot.js +73 -0
- package/dist/cjs/Sequence.d.ts +29 -0
- package/dist/cjs/Sequence.js +131 -0
- package/dist/cjs/Still.d.ts +3 -0
- package/dist/cjs/Still.js +9 -0
- package/dist/cjs/absolute-src.d.ts +1 -0
- package/dist/cjs/absolute-src.js +7 -0
- package/dist/cjs/asset-types.d.ts +50 -0
- package/dist/cjs/asset-types.js +1 -0
- package/dist/cjs/audio/Audio.d.ts +8 -0
- package/dist/cjs/audio/Audio.js +52 -0
- package/dist/cjs/audio/AudioForDevelopment.d.ts +11 -0
- package/dist/cjs/audio/AudioForDevelopment.js +94 -0
- package/dist/cjs/audio/AudioForRendering.d.ts +10 -0
- package/dist/cjs/audio/AudioForRendering.js +111 -0
- package/dist/cjs/audio/index.d.ts +2 -0
- package/dist/cjs/audio/index.js +18 -0
- package/dist/cjs/audio/props.d.ts +12 -0
- package/dist/cjs/audio/props.js +2 -0
- package/dist/cjs/audio/shared-audio-tags.d.ts +37 -0
- package/dist/cjs/audio/shared-audio-tags.js +222 -0
- package/dist/cjs/audio/use-audio-frame.d.ts +6 -0
- package/dist/cjs/audio/use-audio-frame.js +23 -0
- package/dist/cjs/bezier.d.ts +1 -0
- package/dist/cjs/bezier.js +114 -0
- package/dist/cjs/cancel-render.d.ts +1 -0
- package/dist/cjs/cancel-render.js +43 -0
- package/dist/cjs/config/input-props.d.ts +1 -0
- package/dist/cjs/config/input-props.js +31 -0
- package/dist/cjs/config.d.ts +285 -0
- package/dist/cjs/config.js +21 -0
- package/dist/cjs/default-css.d.ts +3 -0
- package/dist/cjs/default-css.js +49 -0
- package/dist/cjs/delay-render.d.ts +14 -0
- package/dist/cjs/delay-render.js +77 -0
- package/dist/cjs/easing.d.ts +19 -0
- package/dist/cjs/easing.js +77 -0
- package/dist/cjs/freeze.d.ts +7 -0
- package/dist/cjs/freeze.js +34 -0
- package/dist/cjs/get-asset-file-name.d.ts +1 -0
- package/dist/cjs/get-asset-file-name.js +14 -0
- package/dist/cjs/get-environment.d.ts +3 -0
- package/dist/cjs/get-environment.js +34 -0
- package/dist/cjs/get-preview-dom-element.d.ts +1 -0
- package/dist/cjs/get-preview-dom-element.js +7 -0
- package/dist/cjs/get-static-files.d.ts +17 -0
- package/dist/cjs/get-static-files.js +31 -0
- package/dist/cjs/get-timeline-clip-name.d.ts +1 -0
- package/dist/cjs/get-timeline-clip-name.js +25 -0
- package/dist/cjs/index.d.ts +92 -0
- package/dist/cjs/index.js +73 -0
- package/dist/cjs/internals.d.ts +99 -0
- package/dist/cjs/internals.js +101 -0
- package/dist/cjs/interpolate-colors.d.ts +5 -0
- package/dist/cjs/interpolate-colors.js +401 -0
- package/dist/cjs/interpolate.d.ts +18 -0
- package/dist/cjs/interpolate.js +123 -0
- package/dist/cjs/is-approximately-the-same.d.ts +1 -0
- package/dist/cjs/is-approximately-the-same.js +8 -0
- package/dist/cjs/is-player.d.ts +3 -0
- package/dist/cjs/is-player.js +14 -0
- package/dist/cjs/loading-indicator.d.ts +2 -0
- package/dist/cjs/loading-indicator.js +35 -0
- package/dist/cjs/loop/index.d.ts +9 -0
- package/dist/cjs/loop/index.js +29 -0
- package/dist/cjs/multiple-versions-warning.d.ts +1 -0
- package/dist/cjs/multiple-versions-warning.js +32 -0
- package/dist/cjs/nonce.d.ts +7 -0
- package/dist/cjs/nonce.js +17 -0
- package/dist/cjs/play-and-handle-not-allowed-error.d.ts +2 -0
- package/dist/cjs/play-and-handle-not-allowed-error.js +44 -0
- package/dist/cjs/portal-node.d.ts +1 -0
- package/dist/cjs/portal-node.js +23 -0
- package/dist/cjs/prefetch-state.d.ts +8 -0
- package/dist/cjs/prefetch-state.js +27 -0
- package/dist/cjs/prefetch.d.ts +9 -0
- package/dist/cjs/prefetch.js +108 -0
- package/dist/cjs/random.d.ts +7 -0
- package/dist/cjs/random.js +42 -0
- package/dist/cjs/register-root.d.ts +4 -0
- package/dist/cjs/register-root.js +33 -0
- package/dist/cjs/series/flatten-children.d.ts +2 -0
- package/dist/cjs/series/flatten-children.js +19 -0
- package/dist/cjs/series/index.d.ts +13 -0
- package/dist/cjs/series/index.js +60 -0
- package/dist/cjs/setup-env-variables.d.ts +2 -0
- package/dist/cjs/setup-env-variables.js +36 -0
- package/dist/cjs/spring/index.d.ts +27 -0
- package/dist/cjs/spring/index.js +55 -0
- package/dist/cjs/spring/measure-spring.d.ts +8 -0
- package/dist/cjs/spring/measure-spring.js +64 -0
- package/dist/cjs/spring/spring-utils.d.ts +21 -0
- package/dist/cjs/spring/spring-utils.js +103 -0
- package/dist/cjs/static-file.d.ts +5 -0
- package/dist/cjs/static-file.js +33 -0
- package/dist/cjs/test/Img.test.d.ts +1 -0
- package/dist/cjs/test/Img.test.js +25 -0
- package/dist/cjs/test/absolute-src.test.d.ts +1 -0
- package/dist/cjs/test/absolute-src.test.js +18 -0
- package/dist/cjs/test/audio-for-rendering.test.d.ts +1 -0
- package/dist/cjs/test/audio-for-rendering.test.js +88 -0
- package/dist/cjs/test/audio.test.d.ts +1 -0
- package/dist/cjs/test/audio.test.js +76 -0
- package/dist/cjs/test/bezier.test.d.ts +1 -0
- package/dist/cjs/test/bezier.test.js +52 -0
- package/dist/cjs/test/composition-rules.test.d.ts +1 -0
- package/dist/cjs/test/composition-rules.test.js +30 -0
- package/dist/cjs/test/composition-validation.test.d.ts +1 -0
- package/dist/cjs/test/composition-validation.test.js +99 -0
- package/dist/cjs/test/easing.test.d.ts +1 -0
- package/dist/cjs/test/easing.test.js +191 -0
- package/dist/cjs/test/expect-to-throw.d.ts +1 -0
- package/dist/cjs/test/expect-to-throw.js +15 -0
- package/dist/cjs/test/freeze.test.d.ts +1 -0
- package/dist/cjs/test/freeze.test.js +65 -0
- package/dist/cjs/test/get-asset-file-name.test.d.ts +1 -0
- package/dist/cjs/test/get-asset-file-name.test.js +14 -0
- package/dist/cjs/test/get-current-time.test.d.ts +1 -0
- package/dist/cjs/test/get-current-time.test.js +74 -0
- package/dist/cjs/test/input-props.test.d.ts +1 -0
- package/dist/cjs/test/input-props.test.js +31 -0
- package/dist/cjs/test/interpolate.test.d.ts +1 -0
- package/dist/cjs/test/interpolate.test.js +138 -0
- package/dist/cjs/test/interpolateColors.test.d.ts +1 -0
- package/dist/cjs/test/interpolateColors.test.js +63 -0
- package/dist/cjs/test/loop-validation.test.d.ts +1 -0
- package/dist/cjs/test/loop-validation.test.js +93 -0
- package/dist/cjs/test/measure-spring.test.d.ts +1 -0
- package/dist/cjs/test/measure-spring.test.js +45 -0
- package/dist/cjs/test/media-validation.test.d.ts +1 -0
- package/dist/cjs/test/media-validation.test.js +47 -0
- package/dist/cjs/test/nested-sequences.test.d.ts +1 -0
- package/dist/cjs/test/nested-sequences.test.js +132 -0
- package/dist/cjs/test/not-all-props-in-media-tags.test.d.ts +1 -0
- package/dist/cjs/test/not-all-props-in-media-tags.test.js +33 -0
- package/dist/cjs/test/random.test.d.ts +1 -0
- package/dist/cjs/test/random.test.js +60 -0
- package/dist/cjs/test/ready-manager.test.d.ts +1 -0
- package/dist/cjs/test/ready-manager.test.js +29 -0
- package/dist/cjs/test/render-hook.d.ts +23 -0
- package/dist/cjs/test/render-hook.js +27 -0
- package/dist/cjs/test/sequence-from-initial-offset.test.d.ts +4 -0
- package/dist/cjs/test/sequence-from-initial-offset.test.js +35 -0
- package/dist/cjs/test/sequence-validation.test.d.ts +1 -0
- package/dist/cjs/test/sequence-validation.test.js +47 -0
- package/dist/cjs/test/series.test.d.ts +1 -0
- package/dist/cjs/test/series.test.js +115 -0
- package/dist/cjs/test/spring.test.d.ts +1 -0
- package/dist/cjs/test/spring.test.js +38 -0
- package/dist/cjs/test/truthy.test.d.ts +1 -0
- package/dist/cjs/test/truthy.test.js +24 -0
- package/dist/cjs/test/use-audio-frame.test.d.ts +1 -0
- package/dist/cjs/test/use-audio-frame.test.js +78 -0
- package/dist/cjs/test/use-media-in-timeline.test.d.ts +1 -0
- package/dist/cjs/test/use-media-in-timeline.test.js +74 -0
- package/dist/cjs/test/use-media-tag-volume.test.d.ts +1 -0
- package/dist/cjs/test/use-media-tag-volume.test.js +49 -0
- package/dist/cjs/test/use-sync-volume-with-media-tag.test.d.ts +1 -0
- package/dist/cjs/test/use-sync-volume-with-media-tag.test.js +55 -0
- package/dist/cjs/test/validate-start-from-props.test.d.ts +1 -0
- package/dist/cjs/test/validate-start-from-props.test.js +39 -0
- package/dist/cjs/test/video.test.d.ts +1 -0
- package/dist/cjs/test/video.test.js +80 -0
- package/dist/cjs/test/volume-prop.test.d.ts +1 -0
- package/dist/cjs/test/volume-prop.test.js +95 -0
- package/dist/cjs/test/wrap-sequence-context.d.ts +6 -0
- package/dist/cjs/test/wrap-sequence-context.js +41 -0
- package/dist/cjs/timeline-position-state.d.ts +29 -0
- package/dist/cjs/timeline-position-state.js +41 -0
- package/dist/cjs/truthy.d.ts +3 -0
- package/dist/cjs/truthy.js +7 -0
- package/dist/cjs/use-current-frame.d.ts +6 -0
- package/dist/cjs/use-current-frame.js +28 -0
- package/dist/cjs/use-lazy-component.d.ts +7 -0
- package/dist/cjs/use-lazy-component.js +49 -0
- package/dist/cjs/use-media-in-timeline.d.ts +10 -0
- package/dist/cjs/use-media-in-timeline.js +129 -0
- package/dist/cjs/use-media-playback.d.ts +10 -0
- package/dist/cjs/use-media-playback.js +77 -0
- package/dist/cjs/use-media-tag-volume.d.ts +2 -0
- package/dist/cjs/use-media-tag-volume.js +31 -0
- package/dist/cjs/use-sync-volume-with-media-tag.d.ts +10 -0
- package/dist/cjs/use-sync-volume-with-media-tag.js +21 -0
- package/dist/cjs/use-unsafe-video-config.d.ts +2 -0
- package/dist/cjs/use-unsafe-video-config.js +27 -0
- package/dist/cjs/use-video-config.d.ts +7 -0
- package/dist/cjs/use-video-config.js +29 -0
- package/dist/cjs/use-video.d.ts +13 -0
- package/dist/cjs/use-video.js +28 -0
- package/dist/cjs/validate-frame.d.ts +1 -0
- package/dist/cjs/validate-frame.js +24 -0
- package/dist/cjs/validate-media-props.d.ts +4 -0
- package/dist/cjs/validate-media-props.js +24 -0
- package/dist/cjs/validate-start-from-props.d.ts +1 -0
- package/dist/cjs/validate-start-from-props.js +31 -0
- package/dist/cjs/validation/validate-composition-id.d.ts +3 -0
- package/dist/cjs/validation/validate-composition-id.js +13 -0
- package/dist/cjs/validation/validate-dimensions.d.ts +1 -0
- package/dist/cjs/validation/validate-dimensions.js +21 -0
- package/dist/cjs/validation/validate-duration-in-frames.d.ts +1 -0
- package/dist/cjs/validation/validate-duration-in-frames.js +15 -0
- package/dist/cjs/validation/validate-folder-name.d.ts +3 -0
- package/dist/cjs/validation/validate-folder-name.js +19 -0
- package/dist/cjs/validation/validate-fps.d.ts +1 -0
- package/dist/cjs/validation/validate-fps.js +21 -0
- package/dist/cjs/validation/validate-offthreadvideo-image-format.d.ts +1 -0
- package/dist/cjs/validation/validate-offthreadvideo-image-format.js +15 -0
- package/dist/cjs/validation/validation-spring-duration.d.ts +1 -0
- package/dist/cjs/validation/validation-spring-duration.js +21 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/video/OffthreadVideo.d.ts +3 -0
- package/dist/cjs/video/OffthreadVideo.js +33 -0
- package/dist/cjs/video/OffthreadVideoForRendering.d.ts +3 -0
- package/dist/cjs/video/OffthreadVideoForRendering.js +104 -0
- package/dist/cjs/video/Video.d.ts +8 -0
- package/dist/cjs/video/Video.js +50 -0
- package/dist/cjs/video/VideoForDevelopment.d.ts +11 -0
- package/dist/cjs/video/VideoForDevelopment.js +113 -0
- package/dist/cjs/video/VideoForRendering.d.ts +10 -0
- package/dist/cjs/video/VideoForRendering.js +203 -0
- package/dist/cjs/video/duration-state.d.ts +17 -0
- package/dist/cjs/video/duration-state.js +34 -0
- package/dist/cjs/video/get-current-time.d.ts +13 -0
- package/dist/cjs/video/get-current-time.js +31 -0
- package/dist/cjs/video/index.d.ts +3 -0
- package/dist/cjs/video/index.js +7 -0
- package/dist/cjs/video/props.d.ts +25 -0
- package/dist/cjs/video/props.js +2 -0
- package/dist/cjs/video/video-fragment.d.ts +12 -0
- package/dist/cjs/video/video-fragment.js +60 -0
- package/dist/cjs/video-config.d.ts +8 -0
- package/dist/cjs/video-config.js +2 -0
- package/dist/cjs/volume-position-state.d.ts +19 -0
- package/dist/cjs/volume-position-state.js +32 -0
- package/dist/cjs/volume-prop.d.ts +7 -0
- package/dist/cjs/volume-prop.js +24 -0
- package/dist/cjs/warn-about-non-seekable-media.d.ts +1 -0
- package/dist/cjs/warn-about-non-seekable-media.js +34 -0
- package/dist/cjs/wrap-remotion-context.d.ts +18 -0
- package/dist/cjs/wrap-remotion-context.js +73 -0
- package/dist/esm/AbsoluteFill.d.ts +6 -0
- package/dist/esm/AbsoluteFill.js +25 -0
- package/dist/esm/CanUseRemotionHooks.d.ts +5 -0
- package/dist/esm/CanUseRemotionHooks.js +6 -0
- package/dist/esm/Clipper.d.ts +7 -0
- package/dist/esm/Clipper.js +20 -0
- package/dist/esm/Composition.d.ts +23 -0
- package/dist/esm/Composition.js +108 -0
- package/dist/esm/CompositionManager.d.ts +82 -0
- package/dist/esm/CompositionManager.js +137 -0
- package/dist/esm/Folder.d.ts +15 -0
- package/dist/esm/Folder.js +29 -0
- package/dist/esm/IFrame.d.ts +2 -0
- package/dist/esm/IFrame.js +21 -0
- package/dist/esm/Img.d.ts +2 -0
- package/dist/esm/Img.js +49 -0
- package/dist/esm/NativeLayers.d.ts +13 -0
- package/dist/esm/NativeLayers.js +25 -0
- package/dist/esm/Null.d.ts +2 -0
- package/dist/esm/Null.js +21 -0
- package/dist/esm/RemotionRoot.d.ts +5 -0
- package/dist/esm/RemotionRoot.js +69 -0
- package/dist/esm/Sequence.d.ts +29 -0
- package/dist/esm/Sequence.js +128 -0
- package/dist/esm/Still.d.ts +3 -0
- package/dist/esm/Still.js +5 -0
- package/dist/esm/absolute-src.d.ts +1 -0
- package/dist/esm/absolute-src.js +3 -0
- package/dist/esm/asset-types.d.ts +50 -0
- package/dist/esm/asset-types.js +1 -0
- package/dist/esm/audio/Audio.d.ts +8 -0
- package/dist/esm/audio/Audio.js +49 -0
- package/dist/esm/audio/AudioForDevelopment.d.ts +11 -0
- package/dist/esm/audio/AudioForDevelopment.js +91 -0
- package/dist/esm/audio/AudioForRendering.d.ts +10 -0
- package/dist/esm/audio/AudioForRendering.js +108 -0
- package/dist/esm/audio/index.d.ts +2 -0
- package/dist/esm/audio/index.js +2 -0
- package/dist/esm/audio/props.d.ts +12 -0
- package/dist/esm/audio/props.js +1 -0
- package/dist/esm/audio/shared-audio-tags.d.ts +37 -0
- package/dist/esm/audio/shared-audio-tags.js +194 -0
- package/dist/esm/audio/use-audio-frame.d.ts +6 -0
- package/dist/esm/audio/use-audio-frame.js +18 -0
- package/dist/esm/bezier.d.ts +1 -0
- package/dist/esm/bezier.js +110 -0
- package/dist/esm/cancel-render.d.ts +1 -0
- package/dist/esm/cancel-render.js +39 -0
- package/dist/esm/config/input-props.d.ts +1 -0
- package/dist/esm/config/input-props.js +27 -0
- package/dist/esm/config.d.ts +285 -0
- package/dist/esm/config.js +17 -0
- package/dist/esm/default-css.d.ts +3 -0
- package/dist/esm/default-css.js +44 -0
- package/dist/esm/delay-render.d.ts +14 -0
- package/dist/esm/delay-render.js +72 -0
- package/dist/esm/easing.d.ts +19 -0
- package/dist/esm/easing.js +73 -0
- package/dist/esm/freeze.d.ts +7 -0
- package/dist/esm/freeze.js +30 -0
- package/dist/esm/get-asset-file-name.d.ts +1 -0
- package/dist/esm/get-asset-file-name.js +10 -0
- package/dist/esm/get-environment.d.ts +3 -0
- package/dist/esm/get-environment.js +29 -0
- package/dist/esm/get-preview-dom-element.d.ts +1 -0
- package/dist/esm/get-preview-dom-element.js +3 -0
- package/dist/esm/get-static-files.d.ts +17 -0
- package/dist/esm/get-static-files.js +27 -0
- package/dist/esm/get-timeline-clip-name.d.ts +1 -0
- package/dist/esm/get-timeline-clip-name.js +21 -0
- package/dist/esm/index.d.ts +92 -0
- package/dist/esm/index.js +41 -0
- package/dist/esm/internals.d.ts +99 -0
- package/dist/esm/internals.js +75 -0
- package/dist/esm/interpolate-colors.d.ts +5 -0
- package/dist/esm/interpolate-colors.js +397 -0
- package/dist/esm/interpolate.d.ts +18 -0
- package/dist/esm/interpolate.js +119 -0
- package/dist/esm/is-approximately-the-same.d.ts +1 -0
- package/dist/esm/is-approximately-the-same.js +4 -0
- package/dist/esm/is-player.d.ts +3 -0
- package/dist/esm/is-player.js +9 -0
- package/dist/esm/loading-indicator.d.ts +2 -0
- package/dist/esm/loading-indicator.js +31 -0
- package/dist/esm/loop/index.d.ts +9 -0
- package/dist/esm/loop/index.js +25 -0
- package/dist/esm/multiple-versions-warning.d.ts +1 -0
- package/dist/esm/multiple-versions-warning.js +28 -0
- package/dist/esm/nonce.d.ts +7 -0
- package/dist/esm/nonce.js +13 -0
- package/dist/esm/play-and-handle-not-allowed-error.d.ts +2 -0
- package/dist/esm/play-and-handle-not-allowed-error.js +40 -0
- package/dist/esm/portal-node.d.ts +1 -0
- package/dist/esm/portal-node.js +19 -0
- package/dist/esm/prefetch-state.d.ts +8 -0
- package/dist/esm/prefetch-state.js +22 -0
- package/dist/esm/prefetch.d.ts +9 -0
- package/dist/esm/prefetch.js +103 -0
- package/dist/esm/random.d.ts +7 -0
- package/dist/esm/random.js +38 -0
- package/dist/esm/register-root.d.ts +4 -0
- package/dist/esm/register-root.js +27 -0
- package/dist/esm/series/flatten-children.d.ts +2 -0
- package/dist/esm/series/flatten-children.js +12 -0
- package/dist/esm/series/index.d.ts +13 -0
- package/dist/esm/series/index.js +57 -0
- package/dist/esm/setup-env-variables.d.ts +2 -0
- package/dist/esm/setup-env-variables.js +32 -0
- package/dist/esm/spring/index.d.ts +27 -0
- package/dist/esm/spring/index.js +50 -0
- package/dist/esm/spring/measure-spring.d.ts +8 -0
- package/dist/esm/spring/measure-spring.js +60 -0
- package/dist/esm/spring/spring-utils.d.ts +21 -0
- package/dist/esm/spring/spring-utils.js +99 -0
- package/dist/esm/static-file.d.ts +5 -0
- package/dist/esm/static-file.js +29 -0
- package/dist/esm/test/Img.test.d.ts +1 -0
- package/dist/esm/test/Img.test.js +20 -0
- package/dist/esm/test/absolute-src.test.d.ts +1 -0
- package/dist/esm/test/absolute-src.test.js +16 -0
- package/dist/esm/test/audio-for-rendering.test.d.ts +1 -0
- package/dist/esm/test/audio-for-rendering.test.js +83 -0
- package/dist/esm/test/audio.test.d.ts +1 -0
- package/dist/esm/test/audio.test.js +51 -0
- package/dist/esm/test/bezier.test.d.ts +1 -0
- package/dist/esm/test/bezier.test.js +50 -0
- package/dist/esm/test/composition-rules.test.d.ts +1 -0
- package/dist/esm/test/composition-rules.test.js +28 -0
- package/dist/esm/test/composition-validation.test.d.ts +1 -0
- package/dist/esm/test/composition-validation.test.js +97 -0
- package/dist/esm/test/easing.test.d.ts +1 -0
- package/dist/esm/test/easing.test.js +189 -0
- package/dist/esm/test/expect-to-throw.d.ts +1 -0
- package/dist/esm/test/expect-to-throw.js +11 -0
- package/dist/esm/test/freeze.test.d.ts +1 -0
- package/dist/esm/test/freeze.test.js +63 -0
- package/dist/esm/test/get-asset-file-name.test.d.ts +1 -0
- package/dist/esm/test/get-asset-file-name.test.js +12 -0
- package/dist/esm/test/get-current-time.test.d.ts +1 -0
- package/dist/esm/test/get-current-time.test.js +72 -0
- package/dist/esm/test/input-props.test.d.ts +1 -0
- package/dist/esm/test/input-props.test.js +29 -0
- package/dist/esm/test/interpolate.test.d.ts +1 -0
- package/dist/esm/test/interpolate.test.js +136 -0
- package/dist/esm/test/interpolateColors.test.d.ts +1 -0
- package/dist/esm/test/interpolateColors.test.js +61 -0
- package/dist/esm/test/loop-validation.test.d.ts +1 -0
- package/dist/esm/test/loop-validation.test.js +68 -0
- package/dist/esm/test/measure-spring.test.d.ts +1 -0
- package/dist/esm/test/measure-spring.test.js +43 -0
- package/dist/esm/test/media-validation.test.d.ts +1 -0
- package/dist/esm/test/media-validation.test.js +45 -0
- package/dist/esm/test/nested-sequences.test.d.ts +1 -0
- package/dist/esm/test/nested-sequences.test.js +130 -0
- package/dist/esm/test/not-all-props-in-media-tags.test.d.ts +1 -0
- package/dist/esm/test/not-all-props-in-media-tags.test.js +28 -0
- package/dist/esm/test/random.test.d.ts +1 -0
- package/dist/esm/test/random.test.js +58 -0
- package/dist/esm/test/ready-manager.test.d.ts +1 -0
- package/dist/esm/test/ready-manager.test.js +27 -0
- package/dist/esm/test/render-hook.d.ts +23 -0
- package/dist/esm/test/render-hook.js +20 -0
- package/dist/esm/test/sequence-from-initial-offset.test.d.ts +4 -0
- package/dist/esm/test/sequence-from-initial-offset.test.js +33 -0
- package/dist/esm/test/sequence-validation.test.d.ts +1 -0
- package/dist/esm/test/sequence-validation.test.js +45 -0
- package/dist/esm/test/series.test.d.ts +1 -0
- package/dist/esm/test/series.test.js +113 -0
- package/dist/esm/test/spring.test.d.ts +1 -0
- package/dist/esm/test/spring.test.js +36 -0
- package/dist/esm/test/truthy.test.d.ts +1 -0
- package/dist/esm/test/truthy.test.js +22 -0
- package/dist/esm/test/use-audio-frame.test.d.ts +1 -0
- package/dist/esm/test/use-audio-frame.test.js +53 -0
- package/dist/esm/test/use-media-in-timeline.test.d.ts +1 -0
- package/dist/esm/test/use-media-in-timeline.test.js +49 -0
- package/dist/esm/test/use-media-tag-volume.test.d.ts +1 -0
- package/dist/esm/test/use-media-tag-volume.test.js +44 -0
- package/dist/esm/test/use-sync-volume-with-media-tag.test.d.ts +1 -0
- package/dist/esm/test/use-sync-volume-with-media-tag.test.js +53 -0
- package/dist/esm/test/validate-start-from-props.test.d.ts +1 -0
- package/dist/esm/test/validate-start-from-props.test.js +37 -0
- package/dist/esm/test/video.test.d.ts +1 -0
- package/dist/esm/test/video.test.js +55 -0
- package/dist/esm/test/volume-prop.test.d.ts +1 -0
- package/dist/esm/test/volume-prop.test.js +93 -0
- package/dist/esm/test/wrap-sequence-context.d.ts +6 -0
- package/dist/esm/test/wrap-sequence-context.js +37 -0
- package/dist/esm/timeline-position-state.d.ts +29 -0
- package/dist/esm/timeline-position-state.js +35 -0
- package/dist/esm/truthy.d.ts +3 -0
- package/dist/esm/truthy.js +3 -0
- package/dist/esm/use-current-frame.d.ts +6 -0
- package/dist/esm/use-current-frame.js +24 -0
- package/dist/esm/use-lazy-component.d.ts +7 -0
- package/dist/esm/use-lazy-component.js +22 -0
- package/dist/esm/use-media-in-timeline.d.ts +10 -0
- package/dist/esm/use-media-in-timeline.js +125 -0
- package/dist/esm/use-media-playback.d.ts +10 -0
- package/dist/esm/use-media-playback.js +73 -0
- package/dist/esm/use-media-tag-volume.d.ts +2 -0
- package/dist/esm/use-media-tag-volume.js +27 -0
- package/dist/esm/use-sync-volume-with-media-tag.d.ts +10 -0
- package/dist/esm/use-sync-volume-with-media-tag.js +17 -0
- package/dist/esm/use-unsafe-video-config.d.ts +2 -0
- package/dist/esm/use-unsafe-video-config.js +23 -0
- package/dist/esm/use-video-config.d.ts +7 -0
- package/dist/esm/use-video-config.js +25 -0
- package/dist/esm/use-video.d.ts +13 -0
- package/dist/esm/use-video.js +24 -0
- package/dist/esm/validate-frame.d.ts +1 -0
- package/dist/esm/validate-frame.js +20 -0
- package/dist/esm/validate-media-props.d.ts +4 -0
- package/dist/esm/validate-media-props.js +20 -0
- package/dist/esm/validate-start-from-props.d.ts +1 -0
- package/dist/esm/validate-start-from-props.js +27 -0
- package/dist/esm/validation/validate-composition-id.d.ts +3 -0
- package/dist/esm/validation/validate-composition-id.js +8 -0
- package/dist/esm/validation/validate-dimensions.d.ts +1 -0
- package/dist/esm/validation/validate-dimensions.js +17 -0
- package/dist/esm/validation/validate-duration-in-frames.d.ts +1 -0
- package/dist/esm/validation/validate-duration-in-frames.js +11 -0
- package/dist/esm/validation/validate-folder-name.d.ts +3 -0
- package/dist/esm/validation/validate-folder-name.js +14 -0
- package/dist/esm/validation/validate-fps.d.ts +1 -0
- package/dist/esm/validation/validate-fps.js +17 -0
- package/dist/esm/validation/validate-offthreadvideo-image-format.d.ts +1 -0
- package/dist/esm/validation/validate-offthreadvideo-image-format.js +11 -0
- package/dist/esm/validation/validation-spring-duration.d.ts +1 -0
- package/dist/esm/validation/validation-spring-duration.js +17 -0
- package/dist/esm/version.d.ts +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/video/OffthreadVideo.d.ts +3 -0
- package/dist/esm/video/OffthreadVideo.js +29 -0
- package/dist/esm/video/OffthreadVideoForRendering.d.ts +3 -0
- package/dist/esm/video/OffthreadVideoForRendering.js +100 -0
- package/dist/esm/video/Video.d.ts +8 -0
- package/dist/esm/video/Video.js +47 -0
- package/dist/esm/video/VideoForDevelopment.d.ts +11 -0
- package/dist/esm/video/VideoForDevelopment.js +110 -0
- package/dist/esm/video/VideoForRendering.d.ts +10 -0
- package/dist/esm/video/VideoForRendering.js +200 -0
- package/dist/esm/video/duration-state.d.ts +17 -0
- package/dist/esm/video/duration-state.js +29 -0
- package/dist/esm/video/get-current-time.d.ts +13 -0
- package/dist/esm/video/get-current-time.js +26 -0
- package/dist/esm/video/index.d.ts +3 -0
- package/dist/esm/video/index.js +2 -0
- package/dist/esm/video/props.d.ts +25 -0
- package/dist/esm/video/props.js +1 -0
- package/dist/esm/video/video-fragment.d.ts +12 -0
- package/dist/esm/video/video-fragment.js +55 -0
- package/dist/esm/video-config.d.ts +8 -0
- package/dist/esm/video-config.js +1 -0
- package/dist/esm/volume-position-state.d.ts +19 -0
- package/dist/esm/volume-position-state.js +27 -0
- package/dist/esm/volume-prop.d.ts +7 -0
- package/dist/esm/volume-prop.js +20 -0
- package/dist/esm/warn-about-non-seekable-media.d.ts +1 -0
- package/dist/esm/warn-about-non-seekable-media.js +30 -0
- package/dist/esm/wrap-remotion-context.d.ts +18 -0
- package/dist/esm/wrap-remotion-context.js +45 -0
- package/dist/internals.d.ts +0 -1
- package/dist/series/index.js +5 -2
- package/dist/tsconfig-cjs.tsbuildinfo +1 -0
- package/dist/use-video.d.ts +0 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/video/Video.d.ts +1 -1
- package/dist/video/VideoForDevelopment.d.ts +1 -1
- package/dist/video/VideoForRendering.d.ts +1 -1
- package/package.json +23 -12
- package/tsconfig-cjs.json +11 -0
- package/tsconfig.json +3 -3
- package/dist/LayerMaster.d.ts +0 -8
- package/dist/LayerMaster.js +0 -39
- package/dist/Satori.d.ts +0 -5
- package/dist/Satori.js +0 -92
- package/dist/get-compositions-from-markup.d.ts +0 -3
- package/dist/get-compositions-from-markup.js +0 -19
- package/dist/layers.d.ts +0 -24
- package/dist/layers.js +0 -149
- package/dist/video/NativeVideo.d.ts +0 -5
- package/dist/video/NativeVideo.js +0 -33
- package/dist/video/NativeVideoForRendering.d.ts +0 -8
- package/dist/video/NativeVideoForRendering.js +0 -14
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { Easing } from '../easing.js';
|
|
3
|
+
const numbersToTest = [-0.5, 0, 0.4, 0.5, 0.7, 1, 1.5];
|
|
4
|
+
describe('Easing step0', () => {
|
|
5
|
+
const step0 = (n) => {
|
|
6
|
+
return n > 0 ? 1 : 0;
|
|
7
|
+
};
|
|
8
|
+
const out = (n) => 1 - step0(1 - n);
|
|
9
|
+
const inOut = (n) => {
|
|
10
|
+
if (n >= 0.5) {
|
|
11
|
+
return 1 - step0((1 - n) * 2) / 2;
|
|
12
|
+
}
|
|
13
|
+
return step0(n * 2) / 2;
|
|
14
|
+
};
|
|
15
|
+
test('Easing In', () => {
|
|
16
|
+
const easingIn = Easing.in(Easing.step0);
|
|
17
|
+
numbersToTest.forEach((n) => expect(easingIn(n)).toBe(step0(n)));
|
|
18
|
+
});
|
|
19
|
+
test('Easing Out', () => {
|
|
20
|
+
const easingOut = Easing.out(Easing.step0);
|
|
21
|
+
numbersToTest.forEach((n) => expect(easingOut(n)).toBe(out(n)));
|
|
22
|
+
});
|
|
23
|
+
test('Easing In Out', () => {
|
|
24
|
+
const easingInOut = Easing.inOut(Easing.step0);
|
|
25
|
+
numbersToTest.forEach((n) => expect(easingInOut(n)).toBe(inOut(n)));
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
describe('Easing step1', () => {
|
|
29
|
+
const step1 = (n) => {
|
|
30
|
+
return n >= 1 ? 1 : 0;
|
|
31
|
+
};
|
|
32
|
+
const out = (n) => 1 - step1(1 - n);
|
|
33
|
+
const inOut = (n) => {
|
|
34
|
+
if (n >= 0.5) {
|
|
35
|
+
return 1 - step1((1 - n) * 2) / 2;
|
|
36
|
+
}
|
|
37
|
+
return step1(n * 2) / 2;
|
|
38
|
+
};
|
|
39
|
+
test('Easing In', () => {
|
|
40
|
+
const easingIn = Easing.in(Easing.step1);
|
|
41
|
+
numbersToTest.forEach((n) => expect(easingIn(n)).toBe(step1(n)));
|
|
42
|
+
});
|
|
43
|
+
test('Easing Out', () => {
|
|
44
|
+
const easingOut = Easing.out(Easing.step1);
|
|
45
|
+
numbersToTest.forEach((n) => expect(easingOut(n)).toBe(out(n)));
|
|
46
|
+
});
|
|
47
|
+
test('Easing In Out', () => {
|
|
48
|
+
const easingInOut = Easing.inOut(Easing.step1);
|
|
49
|
+
numbersToTest.forEach((n) => expect(easingInOut(n)).toBe(inOut(n)));
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe('Easing linear', () => {
|
|
53
|
+
test('Easing In', () => {
|
|
54
|
+
const easingIn = Easing.in(Easing.linear);
|
|
55
|
+
numbersToTest.forEach((n) => expect(easingIn(n)).toBe(n));
|
|
56
|
+
});
|
|
57
|
+
test('Easing In Out', () => {
|
|
58
|
+
const easingOut = Easing.out(Easing.linear);
|
|
59
|
+
numbersToTest.forEach((n) => expect(easingOut(n)).toBe(n));
|
|
60
|
+
});
|
|
61
|
+
test('Easing Out', () => {
|
|
62
|
+
const easingInOut = Easing.inOut(Easing.linear);
|
|
63
|
+
numbersToTest.forEach((n) => expect(easingInOut(n)).toBe(n));
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
describe('Easing Quadratic', () => {
|
|
67
|
+
const quad = (n) => n * n;
|
|
68
|
+
const out = (n) => 1 - quad(1 - n);
|
|
69
|
+
const inOut = (n) => {
|
|
70
|
+
if (n >= 0.5) {
|
|
71
|
+
return 1 - quad((1 - n) * 2) / 2;
|
|
72
|
+
}
|
|
73
|
+
return quad(n * 2) / 2;
|
|
74
|
+
};
|
|
75
|
+
test('Easing In', () => {
|
|
76
|
+
const easingIn = Easing.in(Easing.quad);
|
|
77
|
+
numbersToTest.forEach((n) => expect(easingIn(n)).toBe(quad(n)));
|
|
78
|
+
});
|
|
79
|
+
test('Easing In Out', () => {
|
|
80
|
+
const easingOut = Easing.out(Easing.quad);
|
|
81
|
+
numbersToTest.forEach((n) => expect(easingOut(n)).toBe(out(n)));
|
|
82
|
+
});
|
|
83
|
+
test('Easing Out', () => {
|
|
84
|
+
const easingInOut = Easing.inOut(Easing.quad);
|
|
85
|
+
numbersToTest.forEach((n) => expect(easingInOut(n)).toBe(inOut(n)));
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
describe('Easing Cubic', () => {
|
|
89
|
+
const cubic = (n) => n * n * n;
|
|
90
|
+
const out = (n) => 1 - cubic(1 - n);
|
|
91
|
+
const inOut = (n) => {
|
|
92
|
+
if (n >= 0.5) {
|
|
93
|
+
return 1 - cubic((1 - n) * 2) / 2;
|
|
94
|
+
}
|
|
95
|
+
return cubic(n * 2) / 2;
|
|
96
|
+
};
|
|
97
|
+
test('Easing In', () => {
|
|
98
|
+
const easingIn = Easing.in(Easing.cubic);
|
|
99
|
+
numbersToTest.forEach((n) => expect(easingIn(n)).toBe(cubic(n)));
|
|
100
|
+
});
|
|
101
|
+
test('Easing In Out', () => {
|
|
102
|
+
const easingOut = Easing.out(Easing.cubic);
|
|
103
|
+
numbersToTest.forEach((n) => expect(easingOut(n)).toBe(out(n)));
|
|
104
|
+
});
|
|
105
|
+
test('Easing Out', () => {
|
|
106
|
+
const easingInOut = Easing.inOut(Easing.cubic);
|
|
107
|
+
numbersToTest.forEach((n) => expect(easingInOut(n)).toBe(inOut(n)));
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
describe('Easing Circle', () => {
|
|
111
|
+
const circle = (n) => 1 - Math.sqrt(1 - n * n);
|
|
112
|
+
const out = (n) => 1 - circle(1 - n);
|
|
113
|
+
const inOut = (n) => {
|
|
114
|
+
if (n >= 0.5) {
|
|
115
|
+
return 1 - circle((1 - n) * 2) / 2;
|
|
116
|
+
}
|
|
117
|
+
return circle(n * 2) / 2;
|
|
118
|
+
};
|
|
119
|
+
test('Easing In', () => {
|
|
120
|
+
const easingIn = Easing.in(Easing.circle);
|
|
121
|
+
numbersToTest.forEach((n) => expect(easingIn(n)).toBe(circle(n)));
|
|
122
|
+
});
|
|
123
|
+
test('Easing In Out', () => {
|
|
124
|
+
const easingOut = Easing.out(Easing.circle);
|
|
125
|
+
numbersToTest.forEach((n) => expect(easingOut(n)).toBe(out(n)));
|
|
126
|
+
});
|
|
127
|
+
test('Easing Out', () => {
|
|
128
|
+
const easingInOut = Easing.inOut(Easing.circle);
|
|
129
|
+
numbersToTest.forEach((n) => expect(easingInOut(n)).toBe(inOut(n)));
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
describe('Easing Exp', () => {
|
|
133
|
+
const exp = (n) => 2 ** (10 * (n - 1));
|
|
134
|
+
const out = (n) => 1 - exp(1 - n);
|
|
135
|
+
const inOut = (n) => {
|
|
136
|
+
if (n >= 0.5) {
|
|
137
|
+
return 1 - exp((1 - n) * 2) / 2;
|
|
138
|
+
}
|
|
139
|
+
return exp(n * 2) / 2;
|
|
140
|
+
};
|
|
141
|
+
test('Easing In', () => {
|
|
142
|
+
const easingIn = Easing.in(Easing.exp);
|
|
143
|
+
numbersToTest.forEach((n) => expect(easingIn(n)).toBe(exp(n)));
|
|
144
|
+
});
|
|
145
|
+
test('Easing In Out', () => {
|
|
146
|
+
const easingOut = Easing.out(Easing.exp);
|
|
147
|
+
numbersToTest.forEach((n) => expect(easingOut(n)).toBe(out(n)));
|
|
148
|
+
});
|
|
149
|
+
test('Easing Out', () => {
|
|
150
|
+
const easingInOut = Easing.inOut(Easing.exp);
|
|
151
|
+
numbersToTest.forEach((n) => expect(easingInOut(n)).toBe(inOut(n)));
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
describe('Easing Bounce', () => {
|
|
155
|
+
const bounce = (n) => {
|
|
156
|
+
if (n < 1 / 2.75) {
|
|
157
|
+
return 7.5625 * n * n;
|
|
158
|
+
}
|
|
159
|
+
if (n < 2 / 2.75) {
|
|
160
|
+
const t2_ = n - 1.5 / 2.75;
|
|
161
|
+
return 7.5625 * t2_ * t2_ + 0.75;
|
|
162
|
+
}
|
|
163
|
+
if (n < 2.5 / 2.75) {
|
|
164
|
+
const t2_ = n - 2.25 / 2.75;
|
|
165
|
+
return 7.5625 * t2_ * t2_ + 0.9375;
|
|
166
|
+
}
|
|
167
|
+
const t2 = n - 2.625 / 2.75;
|
|
168
|
+
return 7.5625 * t2 * t2 + 0.984375;
|
|
169
|
+
};
|
|
170
|
+
const out = (n) => 1 - bounce(1 - n);
|
|
171
|
+
const inOut = (n) => {
|
|
172
|
+
if (n >= 0.5) {
|
|
173
|
+
return 1 - bounce((1 - n) * 2) / 2;
|
|
174
|
+
}
|
|
175
|
+
return bounce(n * 2) / 2;
|
|
176
|
+
};
|
|
177
|
+
test('Easing In', () => {
|
|
178
|
+
const easingIn = Easing.in(Easing.bounce);
|
|
179
|
+
numbersToTest.forEach((n) => expect(easingIn(n)).toBe(bounce(n)));
|
|
180
|
+
});
|
|
181
|
+
test('Easing In Out', () => {
|
|
182
|
+
const easingOut = Easing.out(Easing.bounce);
|
|
183
|
+
numbersToTest.forEach((n) => expect(easingOut(n)).toBe(out(n)));
|
|
184
|
+
});
|
|
185
|
+
test('Easing Out', () => {
|
|
186
|
+
const easingInOut = Easing.inOut(Easing.bounce);
|
|
187
|
+
numbersToTest.forEach((n) => expect(easingInOut(n)).toBe(inOut(n)));
|
|
188
|
+
});
|
|
189
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const expectToThrow: (func: Function, err: RegExp) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { expect, vitest } from 'vitest';
|
|
2
|
+
export const expectToThrow = (func, err) => {
|
|
3
|
+
// Even though the error is caught, it still gets printed to the console
|
|
4
|
+
// so we mock that out to avoid the wall of red text.
|
|
5
|
+
vitest.spyOn(console, 'error');
|
|
6
|
+
// @ts-expect-error
|
|
7
|
+
console.error.mockImplementation(() => undefined);
|
|
8
|
+
expect(func).toThrow(err);
|
|
9
|
+
// @ts-expect-error
|
|
10
|
+
console.error.mockRestore();
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @vitest-environment jsdom
|
|
4
|
+
*/
|
|
5
|
+
import { render } from '@testing-library/react';
|
|
6
|
+
import { describe, expect, test } from 'vitest';
|
|
7
|
+
import { CanUseRemotionHooksProvider } from '../CanUseRemotionHooks.js';
|
|
8
|
+
import { Freeze } from '../freeze.js';
|
|
9
|
+
import { Sequence } from '../Sequence.js';
|
|
10
|
+
import { TimelineContext } from '../timeline-position-state.js';
|
|
11
|
+
import { useCurrentFrame } from '../use-current-frame.js';
|
|
12
|
+
import { expectToThrow } from './expect-to-throw.js';
|
|
13
|
+
import { WrapSequenceContext } from './wrap-sequence-context.js';
|
|
14
|
+
describe('Prop validation', () => {
|
|
15
|
+
test('It should throw if Freeze has string as frame prop value', () => {
|
|
16
|
+
expectToThrow(
|
|
17
|
+
// @ts-expect-error
|
|
18
|
+
() => render(_jsx(Freeze, { frame: '0' })), /The 'frame' prop of <Freeze \/> must be a number, but is of type string/);
|
|
19
|
+
});
|
|
20
|
+
test('It should throw if Freeze has undefined as frame prop value', () => {
|
|
21
|
+
expectToThrow(
|
|
22
|
+
// @ts-expect-error
|
|
23
|
+
() => render(_jsx(Freeze, {})), /The <Freeze \/> component requires a 'frame' prop, but none was passed./);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
const timelineCtxValue = (frame) => ({
|
|
27
|
+
rootId: '',
|
|
28
|
+
frame,
|
|
29
|
+
playing: false,
|
|
30
|
+
imperativePlaying: {
|
|
31
|
+
current: false,
|
|
32
|
+
},
|
|
33
|
+
playbackRate: 1,
|
|
34
|
+
setPlaybackRate: () => {
|
|
35
|
+
throw new Error('playback rate');
|
|
36
|
+
},
|
|
37
|
+
audioAndVideoTags: { current: [] },
|
|
38
|
+
});
|
|
39
|
+
const renderForFrame = (frame, markup) => {
|
|
40
|
+
return render(_jsx(CanUseRemotionHooksProvider, { children: _jsx(TimelineContext.Provider, { value: timelineCtxValue(frame), children: markup }) }));
|
|
41
|
+
};
|
|
42
|
+
const Basic = () => {
|
|
43
|
+
return (_jsx(Freeze, { frame: 300, children: _jsx(TestComponent, {}) }));
|
|
44
|
+
};
|
|
45
|
+
const WithSequence = () => {
|
|
46
|
+
const SequenceFrom = 200;
|
|
47
|
+
const FreezeFrame = 100;
|
|
48
|
+
return (_jsx(WrapSequenceContext, { children: _jsx(Sequence, { from: SequenceFrom, layout: "none", children: _jsx(Freeze, { frame: FreezeFrame, children: _jsx(TestComponent, {}) }) }) }));
|
|
49
|
+
};
|
|
50
|
+
const TestComponent = () => {
|
|
51
|
+
const frame = useCurrentFrame();
|
|
52
|
+
return _jsx("div", { children: frame });
|
|
53
|
+
};
|
|
54
|
+
describe('Integration tests', () => {
|
|
55
|
+
test('Basic test', () => {
|
|
56
|
+
const { container } = renderForFrame(0, _jsx(Basic, {}));
|
|
57
|
+
expect(container.innerHTML).toBe('<div>300</div>');
|
|
58
|
+
});
|
|
59
|
+
test('Should ignore a Sequence', () => {
|
|
60
|
+
const { container } = renderForFrame(300, _jsx(WithSequence, {}));
|
|
61
|
+
expect(container.innerHTML).toBe('<div>100</div>');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { getAssetDisplayName } from '../get-asset-file-name.js';
|
|
3
|
+
describe('get asset file name test', () => {
|
|
4
|
+
const testStrings = [
|
|
5
|
+
['assets/images/sample.png', 'sample.png'],
|
|
6
|
+
['assets\\images\\sample.png', 'sample.png'],
|
|
7
|
+
['sample.png', 'sample.png'],
|
|
8
|
+
];
|
|
9
|
+
testStrings.forEach((entry) => test(`test for ${entry[0]}`, () => {
|
|
10
|
+
expect(getAssetDisplayName(entry[0])).toEqual(entry[1]);
|
|
11
|
+
}));
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { getMediaTime } from '../video/get-current-time.js';
|
|
3
|
+
describe('correctly calculate media time of video element', () => {
|
|
4
|
+
const mp4Precision = 0.04;
|
|
5
|
+
const webmPrecision = 0.02;
|
|
6
|
+
describe('src mp4', () => {
|
|
7
|
+
test('mp4 - Should correctly calculate the media time of a video element', () => {
|
|
8
|
+
expect(getMediaTime({
|
|
9
|
+
fps: 30,
|
|
10
|
+
frame: 30,
|
|
11
|
+
playbackRate: 1,
|
|
12
|
+
src: 'video.mp4',
|
|
13
|
+
startFrom: 0,
|
|
14
|
+
mediaType: 'video',
|
|
15
|
+
})).toBeCloseTo(1, mp4Precision);
|
|
16
|
+
});
|
|
17
|
+
test('mp4 - Should correctly calculate the media time of a video element with faster framerate', () => {
|
|
18
|
+
expect(getMediaTime({
|
|
19
|
+
fps: 30,
|
|
20
|
+
frame: 30,
|
|
21
|
+
playbackRate: 2,
|
|
22
|
+
src: 'video.mp4',
|
|
23
|
+
startFrom: 0,
|
|
24
|
+
mediaType: 'video',
|
|
25
|
+
})).toBeCloseTo(2, mp4Precision);
|
|
26
|
+
});
|
|
27
|
+
test('mp4 - Should correctly calculate the media time of a video element with faster framerate and a startFrom', () => {
|
|
28
|
+
// If playbackrate is 2, but the video only starts after 1 second, at 2sec, the video position should be 3sec
|
|
29
|
+
expect(getMediaTime({
|
|
30
|
+
fps: 30,
|
|
31
|
+
frame: 60,
|
|
32
|
+
playbackRate: 2,
|
|
33
|
+
src: 'video.mp4',
|
|
34
|
+
startFrom: 30,
|
|
35
|
+
mediaType: 'video',
|
|
36
|
+
})).toBeCloseTo(3, mp4Precision);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe('src webm', () => {
|
|
40
|
+
test('webm - Should correctly calculate the media time of a video element', () => {
|
|
41
|
+
expect(getMediaTime({
|
|
42
|
+
fps: 30,
|
|
43
|
+
frame: 30,
|
|
44
|
+
playbackRate: 1,
|
|
45
|
+
src: 'video.webm',
|
|
46
|
+
startFrom: 0,
|
|
47
|
+
mediaType: 'video',
|
|
48
|
+
})).toBeCloseTo(1, webmPrecision);
|
|
49
|
+
});
|
|
50
|
+
test('webm - Should correctly calculate the media time of a video element with faster framerate', () => {
|
|
51
|
+
expect(getMediaTime({
|
|
52
|
+
fps: 30,
|
|
53
|
+
frame: 30,
|
|
54
|
+
playbackRate: 2,
|
|
55
|
+
src: 'video.webm',
|
|
56
|
+
startFrom: 0,
|
|
57
|
+
mediaType: 'video',
|
|
58
|
+
})).toBeCloseTo(2, webmPrecision);
|
|
59
|
+
});
|
|
60
|
+
test('webm - Should correctly calculate the media time of a video element with faster framerate and a startFrom', () => {
|
|
61
|
+
// If playbackrate is 2, but the video only starts after 1 second, at 2sec, the video position should be 3sec
|
|
62
|
+
expect(getMediaTime({
|
|
63
|
+
fps: 30,
|
|
64
|
+
frame: 60,
|
|
65
|
+
playbackRate: 2,
|
|
66
|
+
src: 'video.webm',
|
|
67
|
+
startFrom: 30,
|
|
68
|
+
mediaType: 'video',
|
|
69
|
+
})).toBeCloseTo(3, webmPrecision);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vitest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
import { afterAll, beforeEach, describe, expect, test, vitest } from 'vitest';
|
|
5
|
+
import { getInputProps } from '../config/input-props.js';
|
|
6
|
+
describe('input props', () => {
|
|
7
|
+
const OLD_ENV = process.env;
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
vitest.resetModules(); // Most important - it clears the cache
|
|
10
|
+
process.env = { ...OLD_ENV }; // Make a copy
|
|
11
|
+
});
|
|
12
|
+
afterAll(() => {
|
|
13
|
+
process.env = OLD_ENV; // Restore old environment
|
|
14
|
+
});
|
|
15
|
+
test('input props in non production env', () => {
|
|
16
|
+
process.env.NODE_ENV = 'development';
|
|
17
|
+
const inputProps = {
|
|
18
|
+
firstProperty: 'firstProperty',
|
|
19
|
+
secondProperty: 'secondProperty',
|
|
20
|
+
};
|
|
21
|
+
window.remotion_inputProps = JSON.stringify(JSON.stringify(inputProps));
|
|
22
|
+
expect(getInputProps()).toEqual(JSON.stringify(inputProps));
|
|
23
|
+
});
|
|
24
|
+
test('input props in production env', () => {
|
|
25
|
+
process.env.NODE_ENV = 'production';
|
|
26
|
+
window.remotion_inputProps = JSON.stringify({});
|
|
27
|
+
expect(getInputProps()).toEqual({});
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { Easing } from '../easing.js';
|
|
3
|
+
import { interpolate } from '../interpolate.js';
|
|
4
|
+
import { expectToThrow } from './expect-to-throw.js';
|
|
5
|
+
describe('Basic interpolations', () => {
|
|
6
|
+
test('Input and output range strictly monotonically increasing', () => {
|
|
7
|
+
expect(interpolate(1, [0, 1], [0, 2])).toEqual(2);
|
|
8
|
+
});
|
|
9
|
+
test('Input range strictly monotonically increasing, Output range non-increasing', () => {
|
|
10
|
+
expect(interpolate(1, [0, 1], [2, 2])).toEqual(2);
|
|
11
|
+
});
|
|
12
|
+
test('Interpolate with 4 values, output non-increasing', () => {
|
|
13
|
+
expect(interpolate(Math.PI, [0, 1, 4, 9], [0, 2, 1000, -1000])).toEqual(714.4364894275378);
|
|
14
|
+
});
|
|
15
|
+
test('Interpolate Infinity: output range increasing', () => {
|
|
16
|
+
expect(interpolate(Infinity, [0, 1], [0, 2])).toEqual(Infinity);
|
|
17
|
+
});
|
|
18
|
+
test('Interpolate Infinity: output range decreasing', () => {
|
|
19
|
+
expect(interpolate(Infinity, [0, 1], [1, 0])).toEqual(-Infinity);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
test('Must be the same length', () => {
|
|
23
|
+
expectToThrow(() => {
|
|
24
|
+
interpolate(1, [0, 2], [0, 1, 2]);
|
|
25
|
+
}, /inputRange \(2\) and outputRange \(3\) must have the same length/);
|
|
26
|
+
});
|
|
27
|
+
test('Must pass at least 2 elements for input range', () => {
|
|
28
|
+
expectToThrow(() => {
|
|
29
|
+
interpolate(1, [0], [9]);
|
|
30
|
+
}, /inputRange must have at least 2 elements/);
|
|
31
|
+
});
|
|
32
|
+
test('Input range must be strictly monotonically non-decreasing', () => {
|
|
33
|
+
expectToThrow(() => {
|
|
34
|
+
interpolate(1, [0, 1, 0.5], [0, 2, 0.2]);
|
|
35
|
+
}, /inputRange must be strictly monotonically non-decreasing/);
|
|
36
|
+
expectToThrow(() => {
|
|
37
|
+
interpolate(0.75, [0, 1, 1], [0, 2, 0]);
|
|
38
|
+
}, /inputRange must be strictly monotonically non-decreasing/);
|
|
39
|
+
});
|
|
40
|
+
test('Output range can be non-monotonic', () => {
|
|
41
|
+
expect(interpolate(0.75, [0, 0.5, 1], [0, 2, 0])).toEqual(1);
|
|
42
|
+
});
|
|
43
|
+
test('Output range monotonically decreasing', () => {
|
|
44
|
+
expect(interpolate(0.75, [0, 0.5, 1], [0, 2, 2])).toEqual(2);
|
|
45
|
+
});
|
|
46
|
+
test('Cannot have Infinity in input range', () => {
|
|
47
|
+
expectToThrow(() => {
|
|
48
|
+
interpolate(1, [-Infinity, 0], [0, 2]);
|
|
49
|
+
}, /inputRange must contain only finite numbers, but got \[-Infinity,0\]/);
|
|
50
|
+
});
|
|
51
|
+
test('Cannot have Infinity in output Range', () => {
|
|
52
|
+
expectToThrow(() => interpolate(1, [0, 1], [Infinity, 2]), /outputRange must contain only finite numbers, but got \[Infinity,2\]/);
|
|
53
|
+
});
|
|
54
|
+
test('Should throw if passing 2x infinity input range', () => {
|
|
55
|
+
expectToThrow(() => interpolate(1, [Infinity, Infinity], [0, 2]), /inputRange must contain only finite numbers, but got \[Infinity,Infinity\]/);
|
|
56
|
+
});
|
|
57
|
+
test('Should throw if passing 2x infinity output range', () => {
|
|
58
|
+
expectToThrow(() => interpolate(1, [0, 1], [-Infinity, Infinity]), /outputRange must contain only finite numbers, but got \[-Infinity,Infinity\]/);
|
|
59
|
+
});
|
|
60
|
+
test('Should throw on Infinity as third argument', () => {
|
|
61
|
+
expectToThrow(() => interpolate(1, [0, 1, Infinity], [0, 2, 3]), /inputRange must contain only finite numbers, but got \[0,1,Infinity\]/);
|
|
62
|
+
});
|
|
63
|
+
test('Should throw on Infinity as third argument', () => {
|
|
64
|
+
expectToThrow(() => interpolate(1, [0, 1, Infinity], [0, 2, 3]), /inputRange must contain only finite numbers, but got \[0,1,Infinity\]/);
|
|
65
|
+
});
|
|
66
|
+
test('Easing test', () => {
|
|
67
|
+
expect(interpolate(0.5, [0, 1], [0, 1], {
|
|
68
|
+
easing: Easing.sin,
|
|
69
|
+
})).toEqual(1 - Math.cos((0.5 * Math.PI) / 2));
|
|
70
|
+
});
|
|
71
|
+
test('Extrapolation left test', () => {
|
|
72
|
+
const testValues = ['extend', undefined];
|
|
73
|
+
testValues.forEach((entry) => {
|
|
74
|
+
expect(interpolate(-3, [0, 1, 2], [0, 0.5, 1], {
|
|
75
|
+
extrapolateRight: entry,
|
|
76
|
+
})).toEqual(-1.5);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
test('Extrapolation right test', () => {
|
|
80
|
+
const testValues = ['extend', undefined];
|
|
81
|
+
testValues.forEach((entry) => {
|
|
82
|
+
expect(interpolate(3, [0, 1, 2], [0, 0.5, 1], {
|
|
83
|
+
extrapolateRight: entry,
|
|
84
|
+
})).toEqual(1.5);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
test('Extrapolation identity', () => {
|
|
88
|
+
const testValues = [
|
|
89
|
+
[1000, { extrapolateRight: 'identity' }],
|
|
90
|
+
[-1000, { extrapolateLeft: 'identity' }],
|
|
91
|
+
];
|
|
92
|
+
testValues.forEach((entry) => {
|
|
93
|
+
expect(interpolate(entry[0], [0, 1, 2], [0, 2, 4], entry[1])).toBe(entry[0]);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
test('Clamp right test', () => {
|
|
97
|
+
expect(interpolate(2000, [0, 1, 1000], [0, 1, -1000], {
|
|
98
|
+
extrapolateRight: 'clamp',
|
|
99
|
+
})).toEqual(-1000);
|
|
100
|
+
});
|
|
101
|
+
test('Clamp left test', () => {
|
|
102
|
+
expect(interpolate(-2000, [0, 1, 1000], [Math.PI, 1, -1000], {
|
|
103
|
+
extrapolateLeft: 'clamp',
|
|
104
|
+
})).toEqual(Math.PI);
|
|
105
|
+
});
|
|
106
|
+
test('Zig-zag test', () => {
|
|
107
|
+
const testValues = [
|
|
108
|
+
[3.5, -500],
|
|
109
|
+
[4, -1000],
|
|
110
|
+
[6, 3000],
|
|
111
|
+
[-0.1, -1100],
|
|
112
|
+
];
|
|
113
|
+
testValues.forEach((entry) => {
|
|
114
|
+
expect(interpolate(entry[0], [1, 2, 3, 4, 5], [0, 1000, 0, -1000, 1000])).toBe(entry[1]);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
test('Handle bad types', () => {
|
|
118
|
+
// @ts-expect-error
|
|
119
|
+
expect(() => interpolate(undefined, [0, 1], [1, 0])).toThrowError(/input can not be undefined/);
|
|
120
|
+
// @ts-expect-error
|
|
121
|
+
expect(() => interpolate(1, undefined, [1, 0])).toThrowError(/inputRange can not be undefined/);
|
|
122
|
+
// @ts-expect-error
|
|
123
|
+
expect(() => interpolate(1, [1, 0], undefined)).toThrowError(/outputRange can not be undefined/);
|
|
124
|
+
// @ts-expect-error
|
|
125
|
+
expect(() => interpolate(1)).toThrowError(/inputRange can not be undefined/);
|
|
126
|
+
// @ts-expect-error
|
|
127
|
+
expect(() => interpolate('1', [0, 1], [1, 0])).toThrowError(/Cannot interpolate an input which is not a number/);
|
|
128
|
+
// @ts-expect-error
|
|
129
|
+
expect(() => interpolate(1, 'string', 'string')).toThrowError(/inputRange must contain only numbers/);
|
|
130
|
+
// @ts-expect-error
|
|
131
|
+
expect(() => interpolate(1, [1, 2, 3], 'str')).toThrowError(/outputRange must contain only numbers/);
|
|
132
|
+
// @ts-expect-error
|
|
133
|
+
expect(() => interpolate(1, undefined, 'string')).toThrowError(/inputRange can not be undefined/);
|
|
134
|
+
// @ts-expect-error
|
|
135
|
+
expect(() => interpolate([1, 2], undefined, 'string')).toThrowError(/inputRange can not be undefined/);
|
|
136
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { interpolateColors } from '../interpolate-colors.js';
|
|
3
|
+
import { expectToThrow } from './expect-to-throw.js';
|
|
4
|
+
test('Throws if color string is not right', () => {
|
|
5
|
+
expectToThrow(() => {
|
|
6
|
+
interpolateColors(1, [0, 1], ['#fabgdf', '#ffaabb']);
|
|
7
|
+
}, /invalid color string #fabgdf provided/);
|
|
8
|
+
});
|
|
9
|
+
describe('Throws error for undefined parameters', () => {
|
|
10
|
+
test('Undefined input', () => {
|
|
11
|
+
expectToThrow(() => {
|
|
12
|
+
// @ts-expect-error
|
|
13
|
+
interpolateColors(undefined, ['#aaa', '#bbb'], ['#fff', '#000']);
|
|
14
|
+
}, /input can not be undefined/);
|
|
15
|
+
});
|
|
16
|
+
test('Undefined inputRange', () => {
|
|
17
|
+
expectToThrow(() => {
|
|
18
|
+
// @ts-expect-error
|
|
19
|
+
interpolateColors(1, undefined, ['#fff', '#000']);
|
|
20
|
+
}, /inputRange can not be undefined/);
|
|
21
|
+
});
|
|
22
|
+
test('Undefined outputRange', () => {
|
|
23
|
+
expectToThrow(() => {
|
|
24
|
+
// @ts-expect-error
|
|
25
|
+
interpolateColors(1, ['#fff', '#000'], undefined);
|
|
26
|
+
}, /outputRange can not be undefined/);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
test('inputRange and outputRange must be of same length', () => {
|
|
30
|
+
expectToThrow(() => {
|
|
31
|
+
interpolateColors(1, [1, 2, 3], ['#ffffff', '#aaaaaa']);
|
|
32
|
+
}, /inputRange \(3 values provided\) and outputRange \(2 values provided\) must have the same length/);
|
|
33
|
+
});
|
|
34
|
+
test('Basic interpolate Colors', () => {
|
|
35
|
+
expect(interpolateColors(1, [0, 1], ['#ffaadd', '#fabfdf'])).toBe('rgba(250, 191, 223, 1)');
|
|
36
|
+
});
|
|
37
|
+
test('Clamp Right', () => {
|
|
38
|
+
expect(interpolateColors(2, [0, 1], ['#ffaadd', '#fabfdf'])).toBe('rgba(250, 191, 223, 1)');
|
|
39
|
+
});
|
|
40
|
+
test('Clamp Left', () => {
|
|
41
|
+
expect(interpolateColors(-1, [0, 1], ['#ffaadd', '#fabfdf'])).toBe('rgba(255, 170, 221, 1)');
|
|
42
|
+
});
|
|
43
|
+
test('Color shorthands', () => {
|
|
44
|
+
expect(interpolateColors(1, [0, 1], ['#fad', '#fabfdf'])).toBe('rgba(250, 191, 223, 1)');
|
|
45
|
+
});
|
|
46
|
+
test('Color names', () => {
|
|
47
|
+
expect(interpolateColors(1, [0, 1], ['red', 'blue'])).toBe('rgba(0, 0, 255, 1)');
|
|
48
|
+
});
|
|
49
|
+
test('Mix transparency', () => {
|
|
50
|
+
expect(interpolateColors(0.5, [0, 1], ['transparent', 'blue'])).toBe('rgba(0, 0, 128, 0.5)');
|
|
51
|
+
});
|
|
52
|
+
test('HSV', () => {
|
|
53
|
+
expect(interpolateColors(0.5, [0, 1], ['hsla(120, 100%, 25%, 0)', 'blue'])).toBe('rgba(0, 64, 128, 0.5)');
|
|
54
|
+
expect(interpolateColors(0.5, [0, 1], ['hsl(120, 50%, 50%)', 'blue'])).toBe('rgba(32, 96, 160, 1)');
|
|
55
|
+
});
|
|
56
|
+
describe('RGB', () => {
|
|
57
|
+
test('standard rgb interpolation', () => expect(interpolateColors(0.5, [0, 1], ['rgb(0,0,0)', 'rgb(255,255,255)'])).toBe('rgba(128, 128, 128, 1)'));
|
|
58
|
+
test('rgb clamping', () => {
|
|
59
|
+
expect(interpolateColors(0.5, [0, 1], ['rgb(-1,0,0)', 'rgb(256,255,255)'])).toBe('rgba(128, 128, 128, 1)');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @vitest-environment jsdom
|
|
4
|
+
*/
|
|
5
|
+
import { render } from '@testing-library/react';
|
|
6
|
+
import React, { useContext } from 'react';
|
|
7
|
+
import { describe, expect, test } from 'vitest';
|
|
8
|
+
import { CanUseRemotionHooksProvider } from '../CanUseRemotionHooks.js';
|
|
9
|
+
import { CompositionManager } from '../CompositionManager.js';
|
|
10
|
+
import { Loop } from '../loop';
|
|
11
|
+
import { RemotionRoot } from '../RemotionRoot.js';
|
|
12
|
+
import { expectToThrow } from './expect-to-throw.js';
|
|
13
|
+
const Wrapper = ({ children }) => {
|
|
14
|
+
const compositions = useContext(CompositionManager);
|
|
15
|
+
return (_jsx(CanUseRemotionHooksProvider, { children: _jsx(RemotionRoot, { numberOfAudioTags: 0, children: _jsx(CompositionManager.Provider
|
|
16
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
17
|
+
, {
|
|
18
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
19
|
+
value: {
|
|
20
|
+
...compositions,
|
|
21
|
+
compositions: [
|
|
22
|
+
{
|
|
23
|
+
height: 1080,
|
|
24
|
+
width: 1080,
|
|
25
|
+
fps: 30,
|
|
26
|
+
durationInFrames: 30,
|
|
27
|
+
id: 'markup',
|
|
28
|
+
nonce: 0,
|
|
29
|
+
component: React.lazy(() => Promise.resolve({
|
|
30
|
+
default: (() => null),
|
|
31
|
+
})),
|
|
32
|
+
defaultProps: undefined,
|
|
33
|
+
folderName: null,
|
|
34
|
+
parentFolderName: null,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
currentComposition: 'markup',
|
|
38
|
+
}, children: children }) }) }));
|
|
39
|
+
};
|
|
40
|
+
describe('Loop-validation render should throw with invalid props', () => {
|
|
41
|
+
describe('Throw with invalid durationInFrames prop', () => {
|
|
42
|
+
test('It should throw if Loop has non-number durationInFrames', () => {
|
|
43
|
+
expectToThrow(() => render(_jsx(Wrapper, { children: _jsx(Loop, { durationInFrames: '1', children: "hi" }) })), /The "durationInFrames" prop of the <Loop \/> component must be a number, but you passed a value of type string/);
|
|
44
|
+
});
|
|
45
|
+
test('It should throw if Loop has non-integer durationInFrames', () => {
|
|
46
|
+
expectToThrow(() => render(_jsx(Wrapper, { children: _jsx(Loop, { durationInFrames: 1.1, children: "hi" }) })), /The "durationInFrames" prop of the <Loop \/> component must be an integer, but got 1.1./);
|
|
47
|
+
});
|
|
48
|
+
test('It should throw if Loop has a negative duration', () => {
|
|
49
|
+
expectToThrow(() => render(_jsx(Wrapper, { children: _jsx(Loop, { durationInFrames: -1, children: "hi" }) })), /The "durationInFrames" prop of the <Loop \/> component must be positive, but got -1./);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe('Throw with invalid times prop', () => {
|
|
53
|
+
test('It should throw if Loop has non-number times', () => {
|
|
54
|
+
expectToThrow(() => render(_jsx(Wrapper, { children: _jsx(Loop, { durationInFrames: 50, times: "1", children: "hi" }) })), /You passed to "times" an argument of type string, but it must be a number./);
|
|
55
|
+
});
|
|
56
|
+
test('It should throw if Loop has non-integer times', () => {
|
|
57
|
+
expectToThrow(() => render(_jsx(Wrapper, { children: _jsx(Loop, { durationInFrames: 50, times: 1.1, children: "hi" }) })), /The "times" prop of a loop must be an integer, but got 1.1./);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
describe('Should NOT throw with valid props', () => {
|
|
62
|
+
test('It should allow null as children', () => {
|
|
63
|
+
expect(() => render(_jsx(Wrapper, { children: _jsx(Loop, { durationInFrames: 50, children: null }) }))).not.toThrow();
|
|
64
|
+
});
|
|
65
|
+
test('It should allow undefined as children', () => {
|
|
66
|
+
expect(() => render(_jsx(Wrapper, { children: _jsx(Loop, { durationInFrames: 50, children: undefined }) }))).not.toThrow();
|
|
67
|
+
});
|
|
68
|
+
});
|