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,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const server_1 = require("react-dom/server");
|
|
5
|
+
const vitest_1 = require("vitest");
|
|
6
|
+
const CanUseRemotionHooks_js_1 = require("../CanUseRemotionHooks.js");
|
|
7
|
+
const series_1 = require("../series");
|
|
8
|
+
const timeline_position_state_js_1 = require("../timeline-position-state.js");
|
|
9
|
+
const use_current_frame_js_1 = require("../use-current-frame.js");
|
|
10
|
+
const wrap_sequence_context_js_1 = require("./wrap-sequence-context.js");
|
|
11
|
+
const First = () => {
|
|
12
|
+
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
13
|
+
return (0, jsx_runtime_1.jsx)("div", { children: 'first ' + frame });
|
|
14
|
+
};
|
|
15
|
+
const Second = () => {
|
|
16
|
+
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
17
|
+
return (0, jsx_runtime_1.jsx)("div", { children: 'second ' + frame });
|
|
18
|
+
};
|
|
19
|
+
const Third = () => {
|
|
20
|
+
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
21
|
+
return (0, jsx_runtime_1.jsx)("div", { children: 'third ' + frame });
|
|
22
|
+
};
|
|
23
|
+
const renderForFrame = (frame, markup) => {
|
|
24
|
+
return (0, server_1.renderToString)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.TimelineContext.Provider, { value: {
|
|
25
|
+
rootId: '',
|
|
26
|
+
frame,
|
|
27
|
+
playing: false,
|
|
28
|
+
imperativePlaying: {
|
|
29
|
+
current: false,
|
|
30
|
+
},
|
|
31
|
+
playbackRate: 1,
|
|
32
|
+
setPlaybackRate: () => {
|
|
33
|
+
throw new Error('playback rate');
|
|
34
|
+
},
|
|
35
|
+
audioAndVideoTags: { current: [] },
|
|
36
|
+
}, children: markup }) }));
|
|
37
|
+
};
|
|
38
|
+
(0, vitest_1.test)('Basic series test', () => {
|
|
39
|
+
const outerHTML = renderForFrame(10, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsxs)(series_1.Series, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(First, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Second, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Third, {}) })] }) }));
|
|
40
|
+
(0, vitest_1.expect)(outerHTML).toBe('<div style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;display:flex"><div>third 0</div></div>');
|
|
41
|
+
});
|
|
42
|
+
(0, vitest_1.test)('Should support fragments', () => {
|
|
43
|
+
const outerHtml = renderForFrame(10, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsxs)(series_1.Series, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(First, {}) }), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Second, {}) }, "0"), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Third, {}) }, "1")] })] }) }));
|
|
44
|
+
(0, vitest_1.expect)(outerHtml).not.toBe('<div style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;display:flex"><div>second 1</div></div>');
|
|
45
|
+
});
|
|
46
|
+
(0, vitest_1.test)('Should not allow foreign elements', () => {
|
|
47
|
+
(0, vitest_1.expect)(() => {
|
|
48
|
+
renderForFrame(0, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsx)(series_1.Series, { children: (0, jsx_runtime_1.jsx)(First, {}) }) }));
|
|
49
|
+
}).toThrow(/only accepts a/);
|
|
50
|
+
});
|
|
51
|
+
(0, vitest_1.test)('Should allow layout prop', () => {
|
|
52
|
+
const outerHTML = renderForFrame(0, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsx)(series_1.Series, { children: (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 1, children: (0, jsx_runtime_1.jsx)(First, {}) }) }) }));
|
|
53
|
+
(0, vitest_1.expect)(outerHTML).toBe('<div style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;display:flex"><div>first 0</div></div>');
|
|
54
|
+
const outerHTML2 = renderForFrame(0, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsx)(series_1.Series, { children: (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 1, layout: "none", children: (0, jsx_runtime_1.jsx)(First, {}) }) }) }));
|
|
55
|
+
(0, vitest_1.expect)(outerHTML2).toBe('<div>first 0</div>');
|
|
56
|
+
});
|
|
57
|
+
(0, vitest_1.test)('Should render nothing after the end', () => {
|
|
58
|
+
const outerHTML = renderForFrame(10, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsx)(series_1.Series, { children: (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 1, children: (0, jsx_runtime_1.jsx)(First, {}) }) }) }));
|
|
59
|
+
(0, vitest_1.expect)(outerHTML).toBe('');
|
|
60
|
+
});
|
|
61
|
+
(0, vitest_1.test)('Should throw if invalid or no duration provided', () => {
|
|
62
|
+
(0, vitest_1.expect)(() => {
|
|
63
|
+
renderForFrame(10, (0, jsx_runtime_1.jsx)(series_1.Series, { children: (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: NaN, children: (0, jsx_runtime_1.jsx)(First, {}) }) }));
|
|
64
|
+
}).toThrow(/The "durationInFrames" prop of a <Series.Sequence \/> component must be an integer, but got NaN./);
|
|
65
|
+
(0, vitest_1.expect)(() => {
|
|
66
|
+
renderForFrame(10, (0, jsx_runtime_1.jsx)(series_1.Series, { children: (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { children: (0, jsx_runtime_1.jsx)(First, {}) }) }));
|
|
67
|
+
}).toThrow(/The "durationInFrames" prop of a <Series.Sequence \/> component must be a number, but you passed a value of type undefined/);
|
|
68
|
+
});
|
|
69
|
+
(0, vitest_1.test)('Should allow whitespace', () => {
|
|
70
|
+
const outerHtml = renderForFrame(11, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsxs)(series_1.Series, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 10, children: (0, jsx_runtime_1.jsx)(First, {}) }), ' ', (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 10, children: (0, jsx_runtime_1.jsx)(Second, {}) })] }) }));
|
|
71
|
+
(0, vitest_1.expect)(outerHtml).toBe('<div style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;display:flex"><div>second 1</div></div>');
|
|
72
|
+
});
|
|
73
|
+
(0, vitest_1.test)('Handle empty Series.Sequence', () => {
|
|
74
|
+
(0, vitest_1.expect)(() => renderForFrame(11, (0, jsx_runtime_1.jsxs)(series_1.Series, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 10, children: (0, jsx_runtime_1.jsx)(First, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 10 })] }))).toThrow(/A <Series.Sequence \/> component \(index = 1, duration = 10\) was detected to not have any children\. Delete it to fix this error\./);
|
|
75
|
+
});
|
|
76
|
+
(0, vitest_1.test)('Should allow negative overlap prop', () => {
|
|
77
|
+
const outerHTML = renderForFrame(4, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsxs)(series_1.Series, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, layout: "none", children: (0, jsx_runtime_1.jsx)(First, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { offset: -1, layout: "none", durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Second, {}) })] }) }));
|
|
78
|
+
(0, vitest_1.expect)(outerHTML).toBe('<div>first 4</div><div>second 0</div>');
|
|
79
|
+
});
|
|
80
|
+
(0, vitest_1.test)('Should allow positive overlap prop', () => {
|
|
81
|
+
const outerHTML = renderForFrame(5, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsxs)(series_1.Series, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, layout: "none", children: (0, jsx_runtime_1.jsx)(First, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { offset: 1, layout: "none", durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Second, {}) })] }) }));
|
|
82
|
+
(0, vitest_1.expect)(outerHTML).toBe('');
|
|
83
|
+
});
|
|
84
|
+
(0, vitest_1.test)('Should disallow NaN as offset prop', () => {
|
|
85
|
+
(0, vitest_1.expect)(() => {
|
|
86
|
+
renderForFrame(9, (0, jsx_runtime_1.jsx)(series_1.Series, { children: (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { offset: NaN, layout: "none", durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Second, {}) }) }));
|
|
87
|
+
}).toThrow(/The "offset" property of a <Series.Sequence \/> must not be NaN, but got NaN \(index = 0, duration = 5\)\./);
|
|
88
|
+
});
|
|
89
|
+
(0, vitest_1.test)('Should disallow Infinity as offset prop', () => {
|
|
90
|
+
(0, vitest_1.expect)(() => {
|
|
91
|
+
renderForFrame(9, (0, jsx_runtime_1.jsx)(series_1.Series, { children: (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { offset: Infinity, layout: "none", durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Second, {}) }) }));
|
|
92
|
+
}).toThrow(/The "offset" property of a <Series.Sequence \/> must be finite, but got Infinity \(index = 0, duration = 5\)\./);
|
|
93
|
+
});
|
|
94
|
+
(0, vitest_1.test)('Should disallow non-integer numbers as offset prop', () => {
|
|
95
|
+
(0, vitest_1.expect)(() => {
|
|
96
|
+
renderForFrame(9, (0, jsx_runtime_1.jsx)(series_1.Series, { children: (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { offset: Math.PI, layout: "none", durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Second, {}) }) }));
|
|
97
|
+
}).toThrow(/The "offset" property of a <Series.Sequence \/> must be finite, but got 3.141592653589793 \(index = 0, duration = 5\)\./);
|
|
98
|
+
});
|
|
99
|
+
(0, vitest_1.test)('Should cascade negative offset props', () => {
|
|
100
|
+
const outerHTML = renderForFrame(9, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsxs)(series_1.Series, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, layout: "none", children: (0, jsx_runtime_1.jsx)(First, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { offset: -1, layout: "none", durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Second, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { layout: "none", durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Third, {}) })] }) }));
|
|
101
|
+
(0, vitest_1.expect)(outerHTML).toBe('<div>third 0</div>');
|
|
102
|
+
});
|
|
103
|
+
(0, vitest_1.test)('Should cascade positive offset props', () => {
|
|
104
|
+
const outerHTML = renderForFrame(11, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsxs)(series_1.Series, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, layout: "none", children: (0, jsx_runtime_1.jsx)(First, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { offset: 1, layout: "none", durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Second, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { layout: "none", durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Third, {}) })] }) }));
|
|
105
|
+
(0, vitest_1.expect)(outerHTML).toBe('<div>third 0</div>');
|
|
106
|
+
});
|
|
107
|
+
(0, vitest_1.test)('Allow durationInFrames as Infinity for last Series.Sequence', () => {
|
|
108
|
+
const outerHTML = renderForFrame(10, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsxs)(series_1.Series, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(First, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Second, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: Infinity, children: (0, jsx_runtime_1.jsx)(Third, {}) })] }) }));
|
|
109
|
+
(0, vitest_1.expect)(outerHTML).toBe('<div style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;display:flex"><div>third 0</div></div>');
|
|
110
|
+
});
|
|
111
|
+
(0, vitest_1.test)('Disallow durationInFrames as Infinity for first n-1 Series.Sequence', () => {
|
|
112
|
+
(0, vitest_1.expect)(() => {
|
|
113
|
+
renderForFrame(10, (0, jsx_runtime_1.jsx)(wrap_sequence_context_js_1.WrapSequenceContext, { children: (0, jsx_runtime_1.jsxs)(series_1.Series, { children: [(0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(First, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: Infinity, children: (0, jsx_runtime_1.jsx)(Second, {}) }), (0, jsx_runtime_1.jsx)(series_1.Series.Sequence, { durationInFrames: 5, children: (0, jsx_runtime_1.jsx)(Third, {}) })] }) }));
|
|
114
|
+
}).toThrow(/The "durationInFrames" prop of a <Series.Sequence \/> component must be an integer, but got Infinity\./);
|
|
115
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const is_approximately_the_same_js_1 = require("../is-approximately-the-same.js");
|
|
5
|
+
const spring_1 = require("../spring");
|
|
6
|
+
(0, vitest_1.test)('Basic spring to equal 0', () => {
|
|
7
|
+
(0, vitest_1.expect)((0, spring_1.spring)({
|
|
8
|
+
fps: 30,
|
|
9
|
+
frame: 0,
|
|
10
|
+
})).toEqual(0);
|
|
11
|
+
});
|
|
12
|
+
(0, vitest_1.test)('Basic spring to equal 1', () => {
|
|
13
|
+
(0, vitest_1.expect)((0, spring_1.spring)({
|
|
14
|
+
fps: 30,
|
|
15
|
+
frame: 0,
|
|
16
|
+
from: 1,
|
|
17
|
+
to: 0,
|
|
18
|
+
})).toEqual(1);
|
|
19
|
+
});
|
|
20
|
+
(0, vitest_1.test)('Should be approxmiately the same', () => {
|
|
21
|
+
(0, vitest_1.expect)((0, is_approximately_the_same_js_1.isApproximatelyTheSame)((0, spring_1.spring)({
|
|
22
|
+
fps: 30,
|
|
23
|
+
frame: 1,
|
|
24
|
+
}), 0.04941510804510185)).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
(0, vitest_1.test)('Should be close to 1', () => {
|
|
27
|
+
(0, vitest_1.expect)((0, spring_1.spring)({
|
|
28
|
+
fps: 30,
|
|
29
|
+
frame: 100,
|
|
30
|
+
})).toBeCloseTo(1);
|
|
31
|
+
});
|
|
32
|
+
(0, vitest_1.test)('Should be able to set duration for spring', () => {
|
|
33
|
+
(0, vitest_1.expect)((0, spring_1.spring)({
|
|
34
|
+
fps: 30,
|
|
35
|
+
frame: 5,
|
|
36
|
+
durationInFrames: 5,
|
|
37
|
+
})).toBeCloseTo(1);
|
|
38
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const truthy_js_1 = require("../truthy.js");
|
|
5
|
+
vitest_1.test.each([
|
|
6
|
+
['true', true],
|
|
7
|
+
['false', true],
|
|
8
|
+
['True', true],
|
|
9
|
+
['False', true],
|
|
10
|
+
['', false],
|
|
11
|
+
['abc', true],
|
|
12
|
+
[true, true],
|
|
13
|
+
[false, false],
|
|
14
|
+
[null, false],
|
|
15
|
+
[undefined, false],
|
|
16
|
+
[0, false],
|
|
17
|
+
[1, true],
|
|
18
|
+
[0.5, true],
|
|
19
|
+
[12, true],
|
|
20
|
+
[-1, true],
|
|
21
|
+
[-4, true],
|
|
22
|
+
])('test with %s', (input, expected) => {
|
|
23
|
+
(0, vitest_1.expect)((0, truthy_js_1.truthy)(input)).toEqual(expected);
|
|
24
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
const vitest_1 = require("vitest");
|
|
28
|
+
const useAudioFrameModule = __importStar(require("../audio/use-audio-frame.js"));
|
|
29
|
+
const use_audio_frame_js_1 = require("../audio/use-audio-frame.js");
|
|
30
|
+
const Sequence_js_1 = require("../Sequence.js");
|
|
31
|
+
const useFrameModule = __importStar(require("../use-current-frame.js"));
|
|
32
|
+
const render_hook_js_1 = require("./render-hook.js");
|
|
33
|
+
vitest_1.test.skip('Media starts at 0 if it is outside a sequence', () => {
|
|
34
|
+
const wrapper = ({ children }) => ((0, jsx_runtime_1.jsx)(Sequence_js_1.SequenceContext.Provider, { value: null, children: children }));
|
|
35
|
+
const { result } = (0, render_hook_js_1.renderHook)(() => (0, use_audio_frame_js_1.useMediaStartsAt)(), { wrapper });
|
|
36
|
+
(0, vitest_1.expect)(result.current).toEqual(0);
|
|
37
|
+
});
|
|
38
|
+
vitest_1.test.skip('Media start is shifted back based on sequence', () => {
|
|
39
|
+
const mockSequence = {
|
|
40
|
+
cumulatedFrom: 0,
|
|
41
|
+
relativeFrom: -100,
|
|
42
|
+
parentFrom: 0,
|
|
43
|
+
durationInFrames: 0,
|
|
44
|
+
id: 'mock',
|
|
45
|
+
};
|
|
46
|
+
const wrapper = ({ children }) => ((0, jsx_runtime_1.jsx)(Sequence_js_1.SequenceContext.Provider, { value: mockSequence, children: children }));
|
|
47
|
+
const { result } = (0, render_hook_js_1.renderHook)(() => (0, use_audio_frame_js_1.useMediaStartsAt)(), { wrapper });
|
|
48
|
+
(0, vitest_1.expect)(result.current).toEqual(-100);
|
|
49
|
+
});
|
|
50
|
+
(0, vitest_1.describe)('useFrameForVolumeProp hook tests', () => {
|
|
51
|
+
(0, vitest_1.beforeAll)(() => {
|
|
52
|
+
vitest_1.vitest
|
|
53
|
+
.spyOn(useAudioFrameModule, 'useMediaStartsAt')
|
|
54
|
+
.mockImplementation(() => -10);
|
|
55
|
+
});
|
|
56
|
+
(0, vitest_1.afterAll)(() => {
|
|
57
|
+
vitest_1.vitest.spyOn(useAudioFrameModule, 'useMediaStartsAt').mockRestore();
|
|
58
|
+
});
|
|
59
|
+
vitest_1.test.skip('Media not mounted', () => {
|
|
60
|
+
vitest_1.vitest.spyOn(useFrameModule, 'useCurrentFrame').mockImplementation(() => 9);
|
|
61
|
+
const { result } = (0, render_hook_js_1.renderHook)(() => (0, use_audio_frame_js_1.useFrameForVolumeProp)());
|
|
62
|
+
(0, vitest_1.expect)(result.current).toEqual(-1);
|
|
63
|
+
});
|
|
64
|
+
vitest_1.test.skip('Media mounted', () => {
|
|
65
|
+
vitest_1.vitest
|
|
66
|
+
.spyOn(useFrameModule, 'useCurrentFrame')
|
|
67
|
+
.mockImplementation(() => 10);
|
|
68
|
+
const { result } = (0, render_hook_js_1.renderHook)(() => (0, use_audio_frame_js_1.useFrameForVolumeProp)());
|
|
69
|
+
(0, vitest_1.expect)(result.current).toEqual(0);
|
|
70
|
+
});
|
|
71
|
+
vitest_1.test.skip('Media mounted + 1 frame', () => {
|
|
72
|
+
vitest_1.vitest
|
|
73
|
+
.spyOn(useFrameModule, 'useCurrentFrame')
|
|
74
|
+
.mockImplementation(() => 11);
|
|
75
|
+
const { result } = (0, render_hook_js_1.renderHook)(() => (0, use_audio_frame_js_1.useFrameForVolumeProp)());
|
|
76
|
+
(0, vitest_1.expect)(result.current).toEqual(1);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
const vitest_1 = require("vitest");
|
|
28
|
+
const internals_js_1 = require("../internals.js");
|
|
29
|
+
const use_media_in_timeline_js_1 = require("../use-media-in-timeline.js");
|
|
30
|
+
const useVideoConfigModule = __importStar(require("../use-video-config.js"));
|
|
31
|
+
const render_hook_js_1 = require("./render-hook.js");
|
|
32
|
+
const wrap_sequence_context_js_1 = require("./wrap-sequence-context.js");
|
|
33
|
+
(0, vitest_1.beforeAll)(() => {
|
|
34
|
+
vitest_1.vitest
|
|
35
|
+
.spyOn(useVideoConfigModule, 'useVideoConfig')
|
|
36
|
+
.mockImplementation(() => ({
|
|
37
|
+
width: 10,
|
|
38
|
+
height: 10,
|
|
39
|
+
fps: 30,
|
|
40
|
+
durationInFrames: 100,
|
|
41
|
+
id: 'hithere',
|
|
42
|
+
defaultProps: () => ({}),
|
|
43
|
+
}));
|
|
44
|
+
});
|
|
45
|
+
(0, vitest_1.afterAll)(() => {
|
|
46
|
+
vitest_1.vitest.spyOn(useVideoConfigModule, 'useVideoConfig').mockClear();
|
|
47
|
+
});
|
|
48
|
+
(0, vitest_1.test)('useMediaInTimeline registers and unregisters new sequence', () => {
|
|
49
|
+
const registerSequence = vitest_1.vitest.fn();
|
|
50
|
+
const unregisterSequence = vitest_1.vitest.fn();
|
|
51
|
+
const wrapper = ({ children }) => ((0, jsx_runtime_1.jsx)(internals_js_1.Internals.CompositionManager.Provider, { value:
|
|
52
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
53
|
+
{
|
|
54
|
+
...wrap_sequence_context_js_1.mockCompositionContext,
|
|
55
|
+
registerSequence,
|
|
56
|
+
unregisterSequence,
|
|
57
|
+
}, children: children }));
|
|
58
|
+
const audioRef = {
|
|
59
|
+
current: { volume: 0.5 },
|
|
60
|
+
};
|
|
61
|
+
const { unmount } = (0, render_hook_js_1.renderHook)(() => (0, use_media_in_timeline_js_1.useMediaInTimeline)({
|
|
62
|
+
volume: 1,
|
|
63
|
+
src: 'test',
|
|
64
|
+
mediaVolume: 1,
|
|
65
|
+
mediaType: 'audio',
|
|
66
|
+
mediaRef: audioRef,
|
|
67
|
+
playbackRate: 1,
|
|
68
|
+
}), {
|
|
69
|
+
wrapper,
|
|
70
|
+
});
|
|
71
|
+
(0, vitest_1.expect)(registerSequence).toHaveBeenCalled();
|
|
72
|
+
unmount();
|
|
73
|
+
(0, vitest_1.expect)(unregisterSequence).toHaveBeenCalled();
|
|
74
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const vitest_1 = require("vitest");
|
|
8
|
+
const use_media_tag_volume_js_1 = require("../use-media-tag-volume.js");
|
|
9
|
+
const render_hook_js_1 = require("./render-hook.js");
|
|
10
|
+
(0, vitest_1.describe)('Should update state when volume changes', () => {
|
|
11
|
+
const setState = vitest_1.vitest.fn();
|
|
12
|
+
const useStateSpy = vitest_1.vitest.spyOn(react_1.default, 'useState');
|
|
13
|
+
(0, vitest_1.beforeEach)(() => {
|
|
14
|
+
// @ts-expect-error
|
|
15
|
+
useStateSpy.mockImplementation((init) => [init, setState]);
|
|
16
|
+
});
|
|
17
|
+
(0, vitest_1.afterEach)(() => {
|
|
18
|
+
useStateSpy.mockRestore();
|
|
19
|
+
});
|
|
20
|
+
vitest_1.test.skip('has the volume been set', () => {
|
|
21
|
+
const addEventListener = vitest_1.vitest.fn();
|
|
22
|
+
const removeEventListener = vitest_1.vitest.fn();
|
|
23
|
+
let audioRef = {
|
|
24
|
+
current: { volume: 0.5, addEventListener, removeEventListener },
|
|
25
|
+
};
|
|
26
|
+
const { rerender } = (0, render_hook_js_1.renderHook)(({ mediaRef }) => (0, use_media_tag_volume_js_1.useMediaTagVolume)(mediaRef), {
|
|
27
|
+
initialProps: { mediaRef: audioRef },
|
|
28
|
+
});
|
|
29
|
+
(0, vitest_1.expect)(setState).toHaveBeenCalledWith(0.5);
|
|
30
|
+
audioRef = {
|
|
31
|
+
current: { ...audioRef.current, volume: 0.75 },
|
|
32
|
+
};
|
|
33
|
+
rerender({ mediaRef: audioRef });
|
|
34
|
+
(0, vitest_1.expect)(setState).toHaveBeenCalledWith(0.75);
|
|
35
|
+
(0, vitest_1.expect)(addEventListener).toHaveBeenCalledWith('volumechange', vitest_1.expect.anything());
|
|
36
|
+
(0, vitest_1.expect)(removeEventListener).toHaveBeenCalledWith('volumechange', vitest_1.expect.anything());
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
(0, vitest_1.test)('Should listen for volume changes', () => {
|
|
40
|
+
const addEventListener = vitest_1.vitest.fn();
|
|
41
|
+
const removeEventListener = vitest_1.vitest.fn();
|
|
42
|
+
const audioRef = {
|
|
43
|
+
current: { volume: 0.5, addEventListener, removeEventListener },
|
|
44
|
+
};
|
|
45
|
+
(0, render_hook_js_1.renderHook)(({ mediaRef }) => (0, use_media_tag_volume_js_1.useMediaTagVolume)(mediaRef), {
|
|
46
|
+
initialProps: { mediaRef: audioRef },
|
|
47
|
+
});
|
|
48
|
+
(0, vitest_1.expect)(addEventListener).toHaveBeenCalledTimes(1);
|
|
49
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const use_sync_volume_with_media_tag_js_1 = require("../use-sync-volume-with-media-tag.js");
|
|
5
|
+
const render_hook_js_1 = require("./render-hook.js");
|
|
6
|
+
(0, vitest_1.test)('has the volume been adapted', () => {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const addEventListener = vitest_1.vitest.fn();
|
|
9
|
+
const removeEventListener = vitest_1.vitest.fn();
|
|
10
|
+
const audioRef = {
|
|
11
|
+
current: { volume: 0.5, addEventListener, removeEventListener },
|
|
12
|
+
};
|
|
13
|
+
const volume = 0.6;
|
|
14
|
+
const volumePropFrame = 1;
|
|
15
|
+
const actualVolume = 0.4;
|
|
16
|
+
const initialProps = {
|
|
17
|
+
volumePropFrame,
|
|
18
|
+
actualVolume,
|
|
19
|
+
volume,
|
|
20
|
+
mediaRef: audioRef,
|
|
21
|
+
mediaVolume: 1,
|
|
22
|
+
};
|
|
23
|
+
const { rerender } = (0, render_hook_js_1.renderHook)((hookProps) => (0, use_sync_volume_with_media_tag_js_1.useSyncVolumeWithMediaTag)(hookProps), {
|
|
24
|
+
initialProps,
|
|
25
|
+
});
|
|
26
|
+
(0, vitest_1.expect)((_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.volume).toEqual(initialProps.volume);
|
|
27
|
+
const newVolume = 0.5;
|
|
28
|
+
rerender({
|
|
29
|
+
...initialProps,
|
|
30
|
+
volume: newVolume,
|
|
31
|
+
});
|
|
32
|
+
(0, vitest_1.expect)((_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.volume).toEqual(newVolume);
|
|
33
|
+
});
|
|
34
|
+
(0, vitest_1.test)('volume should not be adapted', () => {
|
|
35
|
+
var _a;
|
|
36
|
+
const addEventListener = vitest_1.vitest.fn();
|
|
37
|
+
const removeEventListener = vitest_1.vitest.fn();
|
|
38
|
+
const audioRef = {
|
|
39
|
+
current: { volume: 0.4, addEventListener, removeEventListener },
|
|
40
|
+
};
|
|
41
|
+
const volume = 0.4;
|
|
42
|
+
const volumePropFrame = 1;
|
|
43
|
+
const actualVolume = 0.4;
|
|
44
|
+
const initialProps = {
|
|
45
|
+
volumePropFrame,
|
|
46
|
+
actualVolume,
|
|
47
|
+
volume,
|
|
48
|
+
mediaRef: audioRef,
|
|
49
|
+
mediaVolume: 1,
|
|
50
|
+
};
|
|
51
|
+
(0, render_hook_js_1.renderHook)((hookProps) => (0, use_sync_volume_with_media_tag_js_1.useSyncVolumeWithMediaTag)(hookProps), {
|
|
52
|
+
initialProps,
|
|
53
|
+
});
|
|
54
|
+
(0, vitest_1.expect)((_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.volume).toEqual(initialProps.volume);
|
|
55
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const validate_start_from_props_js_1 = require("../validate-start-from-props.js");
|
|
5
|
+
const expect_to_throw_js_1 = require("./expect-to-throw.js");
|
|
6
|
+
(0, vitest_1.describe)('ValidateStartFrom props should throw', () => {
|
|
7
|
+
(0, vitest_1.describe)('Throw with invalid startFrom prop', () => {
|
|
8
|
+
(0, vitest_1.test)('It should throw if startFrom prop is negative', () => {
|
|
9
|
+
(0, expect_to_throw_js_1.expectToThrow)(() => (0, validate_start_from_props_js_1.validateStartFromProps)(-40, 1), /startFrom must be greater than equal to 0 instead got -40./);
|
|
10
|
+
});
|
|
11
|
+
(0, vitest_1.test)('It should throw if startFrom is not a number', () => {
|
|
12
|
+
(0, expect_to_throw_js_1.expectToThrow)(
|
|
13
|
+
// @ts-expect-error
|
|
14
|
+
() => (0, validate_start_from_props_js_1.validateStartFromProps)('10', 20), /type of startFrom prop must be a number, instead got type string./);
|
|
15
|
+
});
|
|
16
|
+
(0, vitest_1.test)('It should throw if startFrom is NaN', () => {
|
|
17
|
+
(0, expect_to_throw_js_1.expectToThrow)(() => (0, validate_start_from_props_js_1.validateStartFromProps)(NaN, 20), /startFrom prop can not be NaN or Infinity./);
|
|
18
|
+
});
|
|
19
|
+
(0, vitest_1.test)('It should throw if startFrom is Infinity', () => {
|
|
20
|
+
(0, expect_to_throw_js_1.expectToThrow)(() => (0, validate_start_from_props_js_1.validateStartFromProps)(Infinity, 20), /startFrom prop can not be NaN or Infinity./);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
(0, vitest_1.describe)('Throw with invalid endAt prop', () => {
|
|
24
|
+
(0, vitest_1.test)('It should throw if endAt prop is negative', () => {
|
|
25
|
+
(0, expect_to_throw_js_1.expectToThrow)(() => (0, validate_start_from_props_js_1.validateStartFromProps)(0, -40), /endAt must be a positive number, instead got -40./);
|
|
26
|
+
});
|
|
27
|
+
(0, vitest_1.test)('It should throw if endAt is less than startFrom', () => {
|
|
28
|
+
(0, expect_to_throw_js_1.expectToThrow)(() => (0, validate_start_from_props_js_1.validateStartFromProps)(10, 1), /endAt prop must be greater than startFrom prop./);
|
|
29
|
+
});
|
|
30
|
+
(0, vitest_1.test)('It should throw if endAt is not a number', () => {
|
|
31
|
+
(0, expect_to_throw_js_1.expectToThrow)(
|
|
32
|
+
// @ts-expect-error
|
|
33
|
+
() => (0, validate_start_from_props_js_1.validateStartFromProps)(10, '20'), /type of endAt prop must be a number, instead got type string./);
|
|
34
|
+
});
|
|
35
|
+
(0, vitest_1.test)('It should throw if endAt is NaN', () => {
|
|
36
|
+
(0, expect_to_throw_js_1.expectToThrow)(() => (0, validate_start_from_props_js_1.validateStartFromProps)(10, NaN), /endAt prop can not be NaN./);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
/**
|
|
28
|
+
* @vitest-environment jsdom
|
|
29
|
+
*/
|
|
30
|
+
const react_1 = require("@testing-library/react");
|
|
31
|
+
const react_2 = __importStar(require("react"));
|
|
32
|
+
const vitest_1 = require("vitest");
|
|
33
|
+
const CanUseRemotionHooks_js_1 = require("../CanUseRemotionHooks.js");
|
|
34
|
+
const internals_js_1 = require("../internals.js");
|
|
35
|
+
const video_1 = require("../video");
|
|
36
|
+
const expect_to_throw_js_1 = require("./expect-to-throw.js");
|
|
37
|
+
const Wrapper = ({ children }) => {
|
|
38
|
+
const compositions = (0, react_2.useContext)(internals_js_1.Internals.CompositionManager);
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(internals_js_1.Internals.RemotionRoot, { numberOfAudioTags: 0, children: (0, jsx_runtime_1.jsx)(internals_js_1.Internals.CompositionManager.Provider
|
|
40
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
41
|
+
, {
|
|
42
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
43
|
+
value: {
|
|
44
|
+
...compositions,
|
|
45
|
+
compositions: [
|
|
46
|
+
{
|
|
47
|
+
height: 1080,
|
|
48
|
+
width: 1080,
|
|
49
|
+
fps: 30,
|
|
50
|
+
durationInFrames: 30,
|
|
51
|
+
id: 'markup',
|
|
52
|
+
nonce: 0,
|
|
53
|
+
component: react_2.default.lazy(() => Promise.resolve({
|
|
54
|
+
default: (() => null),
|
|
55
|
+
})),
|
|
56
|
+
defaultProps: undefined,
|
|
57
|
+
folderName: null,
|
|
58
|
+
parentFolderName: null,
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
currentComposition: 'markup',
|
|
62
|
+
}, children: children }) }) }));
|
|
63
|
+
};
|
|
64
|
+
(0, vitest_1.describe)('Render correctly with props', () => {
|
|
65
|
+
(0, vitest_1.test)('It should render Video without startFrom / endAt props', () => {
|
|
66
|
+
(0, vitest_1.expect)(() => (0, react_1.render)((0, jsx_runtime_1.jsx)(Wrapper, { children: (0, jsx_runtime_1.jsx)(video_1.Video, { src: "test" }) }))).not.toThrow();
|
|
67
|
+
});
|
|
68
|
+
(0, vitest_1.test)('It should render Video with startFrom props', () => {
|
|
69
|
+
(0, vitest_1.expect)(() => (0, react_1.render)((0, jsx_runtime_1.jsx)(Wrapper, { children: (0, jsx_runtime_1.jsx)(video_1.Video, { src: "test", startFrom: 10 }) }))).not.toThrow();
|
|
70
|
+
});
|
|
71
|
+
(0, vitest_1.test)('It should render Video with endAt props', () => {
|
|
72
|
+
(0, vitest_1.expect)(() => (0, react_1.render)((0, jsx_runtime_1.jsx)(Wrapper, { children: (0, jsx_runtime_1.jsx)(video_1.Video, { src: "test", endAt: 10 }) }))).not.toThrow();
|
|
73
|
+
});
|
|
74
|
+
(0, vitest_1.test)('It should render Video with startFrom and endAt props', () => {
|
|
75
|
+
(0, vitest_1.expect)(() => (0, react_1.render)((0, jsx_runtime_1.jsx)(Wrapper, { children: (0, jsx_runtime_1.jsx)(video_1.Video, { src: "test", startFrom: 10, endAt: 15 }) }))).not.toThrow();
|
|
76
|
+
});
|
|
77
|
+
(0, vitest_1.test)('It should throw if videoConfig/Wrapper is missing', () => {
|
|
78
|
+
(0, expect_to_throw_js_1.expectToThrow)(() => (0, react_1.render)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(video_1.Video, { startFrom: 10, endAt: 15 }) })), /No video config found/);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|