remotion 3.3.45 → 3.3.51
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/{Clipper.js → cjs/Clipper.js} +2 -2
- package/dist/{Composition.js → cjs/Composition.js} +38 -38
- package/dist/{CompositionManager.d.ts → cjs/CompositionManager.d.ts} +1 -1
- package/dist/{Folder.js → cjs/Folder.js} +6 -6
- package/dist/{IFrame.js → cjs/IFrame.js} +4 -4
- package/dist/{Img.js → cjs/Img.js} +9 -9
- package/dist/{Null.js → cjs/Null.js} +2 -2
- package/dist/{RemotionRoot.js → cjs/RemotionRoot.js} +13 -13
- package/dist/{Sequence.js → cjs/Sequence.js} +15 -15
- package/dist/{Still.d.ts → cjs/Still.d.ts} +1 -1
- package/dist/{Still.js → cjs/Still.js} +2 -2
- package/dist/{audio → cjs/audio}/Audio.d.ts +2 -2
- package/dist/{audio → cjs/audio}/Audio.js +18 -18
- package/dist/{audio → cjs/audio}/AudioForDevelopment.d.ts +1 -1
- package/dist/{audio → cjs/audio}/AudioForDevelopment.js +22 -22
- package/dist/{audio → cjs/audio}/AudioForRendering.d.ts +1 -1
- package/dist/{audio → cjs/audio}/AudioForRendering.js +23 -23
- package/dist/cjs/audio/index.d.ts +2 -0
- package/dist/{audio → cjs/audio}/index.js +2 -2
- package/dist/{audio → cjs/audio}/props.d.ts +1 -1
- package/dist/{audio → cjs/audio}/shared-audio-tags.d.ts +1 -1
- package/dist/{audio → cjs/audio}/use-audio-frame.js +4 -4
- package/dist/{config → cjs/config}/input-props.js +3 -3
- package/dist/{delay-render.js → cjs/delay-render.js} +5 -5
- package/dist/{easing.js → cjs/easing.js} +2 -2
- package/dist/{freeze.js → cjs/freeze.js} +4 -4
- package/dist/{get-environment.js → cjs/get-environment.js} +2 -2
- package/dist/{index.d.ts → cjs/index.d.ts} +31 -31
- package/dist/{index.js → cjs/index.js} +45 -45
- package/dist/{internals.d.ts → cjs/internals.d.ts} +12 -11
- package/dist/cjs/internals.js +101 -0
- package/dist/{interpolate-colors.js → cjs/interpolate-colors.js} +2 -2
- package/dist/{loading-indicator.js → cjs/loading-indicator.js} +2 -2
- package/dist/{loop → cjs/loop}/index.d.ts +1 -1
- package/dist/{loop → cjs/loop}/index.js +6 -6
- package/dist/{multiple-versions-warning.js → cjs/multiple-versions-warning.js} +7 -7
- package/dist/{prefetch.js → cjs/prefetch.js} +6 -6
- package/dist/{random.js → cjs/random.js} +1 -0
- package/dist/{series → cjs/series}/index.d.ts +1 -1
- package/dist/{series → cjs/series}/index.js +6 -6
- package/dist/{setup-env-variables.js → cjs/setup-env-variables.js} +3 -3
- package/dist/{spring → cjs/spring}/index.d.ts +3 -3
- package/dist/{spring → cjs/spring}/index.js +12 -8
- package/dist/{spring → cjs/spring}/measure-spring.d.ts +1 -1
- package/dist/{spring → cjs/spring}/measure-spring.js +4 -4
- 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 +110 -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/{use-current-frame.js → cjs/use-current-frame.js} +6 -6
- package/dist/{use-lazy-component.d.ts → cjs/use-lazy-component.d.ts} +1 -1
- package/dist/{use-media-in-timeline.d.ts → cjs/use-media-in-timeline.d.ts} +1 -1
- package/dist/{use-media-in-timeline.js → cjs/use-media-in-timeline.js} +21 -21
- package/dist/{use-media-playback.js → cjs/use-media-playback.js} +16 -16
- package/dist/{use-sync-volume-with-media-tag.d.ts → cjs/use-sync-volume-with-media-tag.d.ts} +1 -1
- package/dist/{use-sync-volume-with-media-tag.js → cjs/use-sync-volume-with-media-tag.js} +4 -4
- package/dist/{use-unsafe-video-config.d.ts → cjs/use-unsafe-video-config.d.ts} +1 -1
- package/dist/{use-unsafe-video-config.js → cjs/use-unsafe-video-config.js} +4 -4
- package/dist/{use-video-config.d.ts → cjs/use-video-config.d.ts} +1 -1
- package/dist/{use-video-config.js → cjs/use-video-config.js} +6 -6
- package/dist/{use-video.js → cjs/use-video.js} +2 -2
- package/dist/cjs/validate-frame.d.ts +1 -0
- package/dist/cjs/validate-frame.js +24 -0
- package/dist/{validate-media-props.d.ts → cjs/validate-media-props.d.ts} +1 -1
- package/dist/cjs/version.d.ts +1 -0
- package/dist/{version.js → cjs/version.js} +1 -1
- package/dist/{video → cjs/video}/OffthreadVideo.d.ts +1 -1
- package/dist/cjs/video/OffthreadVideo.js +33 -0
- package/dist/{video → cjs/video}/OffthreadVideoForRendering.d.ts +1 -1
- package/dist/{video → cjs/video}/OffthreadVideoForRendering.js +28 -28
- package/dist/{video → cjs/video}/Video.d.ts +2 -2
- package/dist/{video → cjs/video}/Video.js +16 -16
- package/dist/{video → cjs/video}/VideoForDevelopment.d.ts +1 -1
- package/dist/{video → cjs/video}/VideoForDevelopment.js +22 -22
- package/dist/{video → cjs/video}/VideoForRendering.d.ts +1 -1
- package/dist/{video → cjs/video}/VideoForRendering.js +40 -40
- package/dist/{video → cjs/video}/get-current-time.js +2 -2
- package/dist/{video → cjs/video}/index.d.ts +3 -3
- package/dist/{video → cjs/video}/index.js +4 -4
- package/dist/{video → cjs/video}/props.d.ts +1 -1
- package/dist/cjs/wrap-remotion-context.d.ts +18 -0
- package/dist/{wrap-remotion-context.js → cjs/wrap-remotion-context.js} +16 -16
- 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 +54 -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 +108 -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/tsconfig-cjs.tsbuildinfo +1 -0
- package/package.json +21 -9
- 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/audio/index.d.ts +0 -2
- package/dist/get-compositions-from-markup.d.ts +0 -3
- package/dist/get-compositions-from-markup.js +0 -19
- package/dist/internals.js +0 -99
- package/dist/layers.d.ts +0 -24
- package/dist/layers.js +0 -149
- package/dist/version.d.ts +0 -1
- 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
- package/dist/video/OffthreadVideo.js +0 -33
- package/dist/wrap-remotion-context.d.ts +0 -18
- /package/dist/{AbsoluteFill.d.ts → cjs/AbsoluteFill.d.ts} +0 -0
- /package/dist/{AbsoluteFill.js → cjs/AbsoluteFill.js} +0 -0
- /package/dist/{CanUseRemotionHooks.d.ts → cjs/CanUseRemotionHooks.d.ts} +0 -0
- /package/dist/{CanUseRemotionHooks.js → cjs/CanUseRemotionHooks.js} +0 -0
- /package/dist/{Clipper.d.ts → cjs/Clipper.d.ts} +0 -0
- /package/dist/{Composition.d.ts → cjs/Composition.d.ts} +0 -0
- /package/dist/{CompositionManager.js → cjs/CompositionManager.js} +0 -0
- /package/dist/{Folder.d.ts → cjs/Folder.d.ts} +0 -0
- /package/dist/{IFrame.d.ts → cjs/IFrame.d.ts} +0 -0
- /package/dist/{Img.d.ts → cjs/Img.d.ts} +0 -0
- /package/dist/{NativeLayers.d.ts → cjs/NativeLayers.d.ts} +0 -0
- /package/dist/{NativeLayers.js → cjs/NativeLayers.js} +0 -0
- /package/dist/{Null.d.ts → cjs/Null.d.ts} +0 -0
- /package/dist/{RemotionRoot.d.ts → cjs/RemotionRoot.d.ts} +0 -0
- /package/dist/{Sequence.d.ts → cjs/Sequence.d.ts} +0 -0
- /package/dist/{absolute-src.d.ts → cjs/absolute-src.d.ts} +0 -0
- /package/dist/{absolute-src.js → cjs/absolute-src.js} +0 -0
- /package/dist/{asset-types.d.ts → cjs/asset-types.d.ts} +0 -0
- /package/dist/{asset-types.js → cjs/asset-types.js} +0 -0
- /package/dist/{audio → cjs/audio}/props.js +0 -0
- /package/dist/{audio → cjs/audio}/shared-audio-tags.js +0 -0
- /package/dist/{audio → cjs/audio}/use-audio-frame.d.ts +0 -0
- /package/dist/{bezier.d.ts → cjs/bezier.d.ts} +0 -0
- /package/dist/{bezier.js → cjs/bezier.js} +0 -0
- /package/dist/{cancel-render.d.ts → cjs/cancel-render.d.ts} +0 -0
- /package/dist/{cancel-render.js → cjs/cancel-render.js} +0 -0
- /package/dist/{config → cjs/config}/input-props.d.ts +0 -0
- /package/dist/{config.d.ts → cjs/config.d.ts} +0 -0
- /package/dist/{config.js → cjs/config.js} +0 -0
- /package/dist/{default-css.d.ts → cjs/default-css.d.ts} +0 -0
- /package/dist/{default-css.js → cjs/default-css.js} +0 -0
- /package/dist/{delay-render.d.ts → cjs/delay-render.d.ts} +0 -0
- /package/dist/{easing.d.ts → cjs/easing.d.ts} +0 -0
- /package/dist/{freeze.d.ts → cjs/freeze.d.ts} +0 -0
- /package/dist/{get-asset-file-name.d.ts → cjs/get-asset-file-name.d.ts} +0 -0
- /package/dist/{get-asset-file-name.js → cjs/get-asset-file-name.js} +0 -0
- /package/dist/{get-environment.d.ts → cjs/get-environment.d.ts} +0 -0
- /package/dist/{get-preview-dom-element.d.ts → cjs/get-preview-dom-element.d.ts} +0 -0
- /package/dist/{get-preview-dom-element.js → cjs/get-preview-dom-element.js} +0 -0
- /package/dist/{get-static-files.d.ts → cjs/get-static-files.d.ts} +0 -0
- /package/dist/{get-static-files.js → cjs/get-static-files.js} +0 -0
- /package/dist/{get-timeline-clip-name.d.ts → cjs/get-timeline-clip-name.d.ts} +0 -0
- /package/dist/{get-timeline-clip-name.js → cjs/get-timeline-clip-name.js} +0 -0
- /package/dist/{interpolate-colors.d.ts → cjs/interpolate-colors.d.ts} +0 -0
- /package/dist/{interpolate.d.ts → cjs/interpolate.d.ts} +0 -0
- /package/dist/{interpolate.js → cjs/interpolate.js} +0 -0
- /package/dist/{is-approximately-the-same.d.ts → cjs/is-approximately-the-same.d.ts} +0 -0
- /package/dist/{is-approximately-the-same.js → cjs/is-approximately-the-same.js} +0 -0
- /package/dist/{is-player.d.ts → cjs/is-player.d.ts} +0 -0
- /package/dist/{is-player.js → cjs/is-player.js} +0 -0
- /package/dist/{loading-indicator.d.ts → cjs/loading-indicator.d.ts} +0 -0
- /package/dist/{multiple-versions-warning.d.ts → cjs/multiple-versions-warning.d.ts} +0 -0
- /package/dist/{nonce.d.ts → cjs/nonce.d.ts} +0 -0
- /package/dist/{nonce.js → cjs/nonce.js} +0 -0
- /package/dist/{play-and-handle-not-allowed-error.d.ts → cjs/play-and-handle-not-allowed-error.d.ts} +0 -0
- /package/dist/{play-and-handle-not-allowed-error.js → cjs/play-and-handle-not-allowed-error.js} +0 -0
- /package/dist/{portal-node.d.ts → cjs/portal-node.d.ts} +0 -0
- /package/dist/{portal-node.js → cjs/portal-node.js} +0 -0
- /package/dist/{prefetch-state.d.ts → cjs/prefetch-state.d.ts} +0 -0
- /package/dist/{prefetch-state.js → cjs/prefetch-state.js} +0 -0
- /package/dist/{prefetch.d.ts → cjs/prefetch.d.ts} +0 -0
- /package/dist/{random.d.ts → cjs/random.d.ts} +0 -0
- /package/dist/{register-root.d.ts → cjs/register-root.d.ts} +0 -0
- /package/dist/{register-root.js → cjs/register-root.js} +0 -0
- /package/dist/{series → cjs/series}/flatten-children.d.ts +0 -0
- /package/dist/{series → cjs/series}/flatten-children.js +0 -0
- /package/dist/{setup-env-variables.d.ts → cjs/setup-env-variables.d.ts} +0 -0
- /package/dist/{spring → cjs/spring}/spring-utils.d.ts +0 -0
- /package/dist/{spring → cjs/spring}/spring-utils.js +0 -0
- /package/dist/{static-file.d.ts → cjs/static-file.d.ts} +0 -0
- /package/dist/{static-file.js → cjs/static-file.js} +0 -0
- /package/dist/{timeline-position-state.d.ts → cjs/timeline-position-state.d.ts} +0 -0
- /package/dist/{timeline-position-state.js → cjs/timeline-position-state.js} +0 -0
- /package/dist/{truthy.d.ts → cjs/truthy.d.ts} +0 -0
- /package/dist/{truthy.js → cjs/truthy.js} +0 -0
- /package/dist/{use-current-frame.d.ts → cjs/use-current-frame.d.ts} +0 -0
- /package/dist/{use-lazy-component.js → cjs/use-lazy-component.js} +0 -0
- /package/dist/{use-media-playback.d.ts → cjs/use-media-playback.d.ts} +0 -0
- /package/dist/{use-media-tag-volume.d.ts → cjs/use-media-tag-volume.d.ts} +0 -0
- /package/dist/{use-media-tag-volume.js → cjs/use-media-tag-volume.js} +0 -0
- /package/dist/{use-video.d.ts → cjs/use-video.d.ts} +0 -0
- /package/dist/{validate-media-props.js → cjs/validate-media-props.js} +0 -0
- /package/dist/{validate-start-from-props.d.ts → cjs/validate-start-from-props.d.ts} +0 -0
- /package/dist/{validate-start-from-props.js → cjs/validate-start-from-props.js} +0 -0
- /package/dist/{validation → cjs/validation}/validate-composition-id.d.ts +0 -0
- /package/dist/{validation → cjs/validation}/validate-composition-id.js +0 -0
- /package/dist/{validation → cjs/validation}/validate-dimensions.d.ts +0 -0
- /package/dist/{validation → cjs/validation}/validate-dimensions.js +0 -0
- /package/dist/{validation → cjs/validation}/validate-duration-in-frames.d.ts +0 -0
- /package/dist/{validation → cjs/validation}/validate-duration-in-frames.js +0 -0
- /package/dist/{validation → cjs/validation}/validate-folder-name.d.ts +0 -0
- /package/dist/{validation → cjs/validation}/validate-folder-name.js +0 -0
- /package/dist/{validation → cjs/validation}/validate-fps.d.ts +0 -0
- /package/dist/{validation → cjs/validation}/validate-fps.js +0 -0
- /package/dist/{validation → cjs/validation}/validate-offthreadvideo-image-format.d.ts +0 -0
- /package/dist/{validation → cjs/validation}/validate-offthreadvideo-image-format.js +0 -0
- /package/dist/{validation → cjs/validation}/validation-spring-duration.d.ts +0 -0
- /package/dist/{validation → cjs/validation}/validation-spring-duration.js +0 -0
- /package/dist/{video → cjs/video}/duration-state.d.ts +0 -0
- /package/dist/{video → cjs/video}/duration-state.js +0 -0
- /package/dist/{video → cjs/video}/get-current-time.d.ts +0 -0
- /package/dist/{video → cjs/video}/props.js +0 -0
- /package/dist/{video → cjs/video}/video-fragment.d.ts +0 -0
- /package/dist/{video → cjs/video}/video-fragment.js +0 -0
- /package/dist/{video-config.d.ts → cjs/video-config.d.ts} +0 -0
- /package/dist/{video-config.js → cjs/video-config.js} +0 -0
- /package/dist/{volume-position-state.d.ts → cjs/volume-position-state.d.ts} +0 -0
- /package/dist/{volume-position-state.js → cjs/volume-position-state.js} +0 -0
- /package/dist/{volume-prop.d.ts → cjs/volume-prop.d.ts} +0 -0
- /package/dist/{volume-prop.js → cjs/volume-prop.js} +0 -0
- /package/dist/{warn-about-non-seekable-media.d.ts → cjs/warn-about-non-seekable-media.d.ts} +0 -0
- /package/dist/{warn-about-non-seekable-media.js → cjs/warn-about-non-seekable-media.js} +0 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copied from:
|
|
3
|
+
* https://github.com/software-mansion/react-native-reanimated/blob/master/src/reanimated2/Colors.ts
|
|
4
|
+
*/
|
|
5
|
+
/* eslint no-bitwise: 0 */
|
|
6
|
+
import { interpolate } from './interpolate.js';
|
|
7
|
+
// var INTEGER = '[-+]?\\d+';
|
|
8
|
+
const NUMBER = '[-+]?\\d*\\.?\\d+';
|
|
9
|
+
const PERCENTAGE = NUMBER + '%';
|
|
10
|
+
function call(...args) {
|
|
11
|
+
return '\\(\\s*(' + args.join(')\\s*,\\s*(') + ')\\s*\\)';
|
|
12
|
+
}
|
|
13
|
+
function getMatchers() {
|
|
14
|
+
const cachedMatchers = {
|
|
15
|
+
rgb: undefined,
|
|
16
|
+
rgba: undefined,
|
|
17
|
+
hsl: undefined,
|
|
18
|
+
hsla: undefined,
|
|
19
|
+
hex3: undefined,
|
|
20
|
+
hex4: undefined,
|
|
21
|
+
hex5: undefined,
|
|
22
|
+
hex6: undefined,
|
|
23
|
+
hex8: undefined,
|
|
24
|
+
};
|
|
25
|
+
if (cachedMatchers.rgb === undefined) {
|
|
26
|
+
cachedMatchers.rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER));
|
|
27
|
+
cachedMatchers.rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER));
|
|
28
|
+
cachedMatchers.hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));
|
|
29
|
+
cachedMatchers.hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
|
|
30
|
+
cachedMatchers.hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
31
|
+
cachedMatchers.hex4 =
|
|
32
|
+
/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
33
|
+
cachedMatchers.hex6 = /^#([0-9a-fA-F]{6})$/;
|
|
34
|
+
cachedMatchers.hex8 = /^#([0-9a-fA-F]{8})$/;
|
|
35
|
+
}
|
|
36
|
+
return cachedMatchers;
|
|
37
|
+
}
|
|
38
|
+
function hue2rgb(p, q, t) {
|
|
39
|
+
if (t < 0) {
|
|
40
|
+
t += 1;
|
|
41
|
+
}
|
|
42
|
+
if (t > 1) {
|
|
43
|
+
t -= 1;
|
|
44
|
+
}
|
|
45
|
+
if (t < 1 / 6) {
|
|
46
|
+
return p + (q - p) * 6 * t;
|
|
47
|
+
}
|
|
48
|
+
if (t < 1 / 2) {
|
|
49
|
+
return q;
|
|
50
|
+
}
|
|
51
|
+
if (t < 2 / 3) {
|
|
52
|
+
return p + (q - p) * (2 / 3 - t) * 6;
|
|
53
|
+
}
|
|
54
|
+
return p;
|
|
55
|
+
}
|
|
56
|
+
function hslToRgb(h, s, l) {
|
|
57
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
58
|
+
const p = 2 * l - q;
|
|
59
|
+
const r = hue2rgb(p, q, h + 1 / 3);
|
|
60
|
+
const g = hue2rgb(p, q, h);
|
|
61
|
+
const b = hue2rgb(p, q, h - 1 / 3);
|
|
62
|
+
return ((Math.round(r * 255) << 24) |
|
|
63
|
+
(Math.round(g * 255) << 16) |
|
|
64
|
+
(Math.round(b * 255) << 8));
|
|
65
|
+
}
|
|
66
|
+
function parse255(str) {
|
|
67
|
+
const int = Number.parseInt(str, 10);
|
|
68
|
+
if (int < 0) {
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
71
|
+
if (int > 255) {
|
|
72
|
+
return 255;
|
|
73
|
+
}
|
|
74
|
+
return int;
|
|
75
|
+
}
|
|
76
|
+
function parse360(str) {
|
|
77
|
+
const int = Number.parseFloat(str);
|
|
78
|
+
return (((int % 360) + 360) % 360) / 360;
|
|
79
|
+
}
|
|
80
|
+
function parse1(str) {
|
|
81
|
+
const num = Number.parseFloat(str);
|
|
82
|
+
if (num < 0) {
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
if (num > 1) {
|
|
86
|
+
return 255;
|
|
87
|
+
}
|
|
88
|
+
return Math.round(num * 255);
|
|
89
|
+
}
|
|
90
|
+
function parsePercentage(str) {
|
|
91
|
+
// parseFloat conveniently ignores the final %
|
|
92
|
+
const int = Number.parseFloat(str);
|
|
93
|
+
if (int < 0) {
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
if (int > 100) {
|
|
97
|
+
return 1;
|
|
98
|
+
}
|
|
99
|
+
return int / 100;
|
|
100
|
+
}
|
|
101
|
+
const names = {
|
|
102
|
+
transparent: 0x00000000,
|
|
103
|
+
// http://www.w3.org/TR/css3-color/#svg-color
|
|
104
|
+
aliceblue: 0xf0f8ffff,
|
|
105
|
+
antiquewhite: 0xfaebd7ff,
|
|
106
|
+
aqua: 0x00ffffff,
|
|
107
|
+
aquamarine: 0x7fffd4ff,
|
|
108
|
+
azure: 0xf0ffffff,
|
|
109
|
+
beige: 0xf5f5dcff,
|
|
110
|
+
bisque: 0xffe4c4ff,
|
|
111
|
+
black: 0x000000ff,
|
|
112
|
+
blanchedalmond: 0xffebcdff,
|
|
113
|
+
blue: 0x0000ffff,
|
|
114
|
+
blueviolet: 0x8a2be2ff,
|
|
115
|
+
brown: 0xa52a2aff,
|
|
116
|
+
burlywood: 0xdeb887ff,
|
|
117
|
+
burntsienna: 0xea7e5dff,
|
|
118
|
+
cadetblue: 0x5f9ea0ff,
|
|
119
|
+
chartreuse: 0x7fff00ff,
|
|
120
|
+
chocolate: 0xd2691eff,
|
|
121
|
+
coral: 0xff7f50ff,
|
|
122
|
+
cornflowerblue: 0x6495edff,
|
|
123
|
+
cornsilk: 0xfff8dcff,
|
|
124
|
+
crimson: 0xdc143cff,
|
|
125
|
+
cyan: 0x00ffffff,
|
|
126
|
+
darkblue: 0x00008bff,
|
|
127
|
+
darkcyan: 0x008b8bff,
|
|
128
|
+
darkgoldenrod: 0xb8860bff,
|
|
129
|
+
darkgray: 0xa9a9a9ff,
|
|
130
|
+
darkgreen: 0x006400ff,
|
|
131
|
+
darkgrey: 0xa9a9a9ff,
|
|
132
|
+
darkkhaki: 0xbdb76bff,
|
|
133
|
+
darkmagenta: 0x8b008bff,
|
|
134
|
+
darkolivegreen: 0x556b2fff,
|
|
135
|
+
darkorange: 0xff8c00ff,
|
|
136
|
+
darkorchid: 0x9932ccff,
|
|
137
|
+
darkred: 0x8b0000ff,
|
|
138
|
+
darksalmon: 0xe9967aff,
|
|
139
|
+
darkseagreen: 0x8fbc8fff,
|
|
140
|
+
darkslateblue: 0x483d8bff,
|
|
141
|
+
darkslategray: 0x2f4f4fff,
|
|
142
|
+
darkslategrey: 0x2f4f4fff,
|
|
143
|
+
darkturquoise: 0x00ced1ff,
|
|
144
|
+
darkviolet: 0x9400d3ff,
|
|
145
|
+
deeppink: 0xff1493ff,
|
|
146
|
+
deepskyblue: 0x00bfffff,
|
|
147
|
+
dimgray: 0x696969ff,
|
|
148
|
+
dimgrey: 0x696969ff,
|
|
149
|
+
dodgerblue: 0x1e90ffff,
|
|
150
|
+
firebrick: 0xb22222ff,
|
|
151
|
+
floralwhite: 0xfffaf0ff,
|
|
152
|
+
forestgreen: 0x228b22ff,
|
|
153
|
+
fuchsia: 0xff00ffff,
|
|
154
|
+
gainsboro: 0xdcdcdcff,
|
|
155
|
+
ghostwhite: 0xf8f8ffff,
|
|
156
|
+
gold: 0xffd700ff,
|
|
157
|
+
goldenrod: 0xdaa520ff,
|
|
158
|
+
gray: 0x808080ff,
|
|
159
|
+
green: 0x008000ff,
|
|
160
|
+
greenyellow: 0xadff2fff,
|
|
161
|
+
grey: 0x808080ff,
|
|
162
|
+
honeydew: 0xf0fff0ff,
|
|
163
|
+
hotpink: 0xff69b4ff,
|
|
164
|
+
indianred: 0xcd5c5cff,
|
|
165
|
+
indigo: 0x4b0082ff,
|
|
166
|
+
ivory: 0xfffff0ff,
|
|
167
|
+
khaki: 0xf0e68cff,
|
|
168
|
+
lavender: 0xe6e6faff,
|
|
169
|
+
lavenderblush: 0xfff0f5ff,
|
|
170
|
+
lawngreen: 0x7cfc00ff,
|
|
171
|
+
lemonchiffon: 0xfffacdff,
|
|
172
|
+
lightblue: 0xadd8e6ff,
|
|
173
|
+
lightcoral: 0xf08080ff,
|
|
174
|
+
lightcyan: 0xe0ffffff,
|
|
175
|
+
lightgoldenrodyellow: 0xfafad2ff,
|
|
176
|
+
lightgray: 0xd3d3d3ff,
|
|
177
|
+
lightgreen: 0x90ee90ff,
|
|
178
|
+
lightgrey: 0xd3d3d3ff,
|
|
179
|
+
lightpink: 0xffb6c1ff,
|
|
180
|
+
lightsalmon: 0xffa07aff,
|
|
181
|
+
lightseagreen: 0x20b2aaff,
|
|
182
|
+
lightskyblue: 0x87cefaff,
|
|
183
|
+
lightslategray: 0x778899ff,
|
|
184
|
+
lightslategrey: 0x778899ff,
|
|
185
|
+
lightsteelblue: 0xb0c4deff,
|
|
186
|
+
lightyellow: 0xffffe0ff,
|
|
187
|
+
lime: 0x00ff00ff,
|
|
188
|
+
limegreen: 0x32cd32ff,
|
|
189
|
+
linen: 0xfaf0e6ff,
|
|
190
|
+
magenta: 0xff00ffff,
|
|
191
|
+
maroon: 0x800000ff,
|
|
192
|
+
mediumaquamarine: 0x66cdaaff,
|
|
193
|
+
mediumblue: 0x0000cdff,
|
|
194
|
+
mediumorchid: 0xba55d3ff,
|
|
195
|
+
mediumpurple: 0x9370dbff,
|
|
196
|
+
mediumseagreen: 0x3cb371ff,
|
|
197
|
+
mediumslateblue: 0x7b68eeff,
|
|
198
|
+
mediumspringgreen: 0x00fa9aff,
|
|
199
|
+
mediumturquoise: 0x48d1ccff,
|
|
200
|
+
mediumvioletred: 0xc71585ff,
|
|
201
|
+
midnightblue: 0x191970ff,
|
|
202
|
+
mintcream: 0xf5fffaff,
|
|
203
|
+
mistyrose: 0xffe4e1ff,
|
|
204
|
+
moccasin: 0xffe4b5ff,
|
|
205
|
+
navajowhite: 0xffdeadff,
|
|
206
|
+
navy: 0x000080ff,
|
|
207
|
+
oldlace: 0xfdf5e6ff,
|
|
208
|
+
olive: 0x808000ff,
|
|
209
|
+
olivedrab: 0x6b8e23ff,
|
|
210
|
+
orange: 0xffa500ff,
|
|
211
|
+
orangered: 0xff4500ff,
|
|
212
|
+
orchid: 0xda70d6ff,
|
|
213
|
+
palegoldenrod: 0xeee8aaff,
|
|
214
|
+
palegreen: 0x98fb98ff,
|
|
215
|
+
paleturquoise: 0xafeeeeff,
|
|
216
|
+
palevioletred: 0xdb7093ff,
|
|
217
|
+
papayawhip: 0xffefd5ff,
|
|
218
|
+
peachpuff: 0xffdab9ff,
|
|
219
|
+
peru: 0xcd853fff,
|
|
220
|
+
pink: 0xffc0cbff,
|
|
221
|
+
plum: 0xdda0ddff,
|
|
222
|
+
powderblue: 0xb0e0e6ff,
|
|
223
|
+
purple: 0x800080ff,
|
|
224
|
+
rebeccapurple: 0x663399ff,
|
|
225
|
+
red: 0xff0000ff,
|
|
226
|
+
rosybrown: 0xbc8f8fff,
|
|
227
|
+
royalblue: 0x4169e1ff,
|
|
228
|
+
saddlebrown: 0x8b4513ff,
|
|
229
|
+
salmon: 0xfa8072ff,
|
|
230
|
+
sandybrown: 0xf4a460ff,
|
|
231
|
+
seagreen: 0x2e8b57ff,
|
|
232
|
+
seashell: 0xfff5eeff,
|
|
233
|
+
sienna: 0xa0522dff,
|
|
234
|
+
silver: 0xc0c0c0ff,
|
|
235
|
+
skyblue: 0x87ceebff,
|
|
236
|
+
slateblue: 0x6a5acdff,
|
|
237
|
+
slategray: 0x708090ff,
|
|
238
|
+
slategrey: 0x708090ff,
|
|
239
|
+
snow: 0xfffafaff,
|
|
240
|
+
springgreen: 0x00ff7fff,
|
|
241
|
+
steelblue: 0x4682b4ff,
|
|
242
|
+
tan: 0xd2b48cff,
|
|
243
|
+
teal: 0x008080ff,
|
|
244
|
+
thistle: 0xd8bfd8ff,
|
|
245
|
+
tomato: 0xff6347ff,
|
|
246
|
+
turquoise: 0x40e0d0ff,
|
|
247
|
+
violet: 0xee82eeff,
|
|
248
|
+
wheat: 0xf5deb3ff,
|
|
249
|
+
white: 0xffffffff,
|
|
250
|
+
whitesmoke: 0xf5f5f5ff,
|
|
251
|
+
yellow: 0xffff00ff,
|
|
252
|
+
yellowgreen: 0x9acd32ff,
|
|
253
|
+
};
|
|
254
|
+
function normalizeColor(color) {
|
|
255
|
+
const matchers = getMatchers();
|
|
256
|
+
let match;
|
|
257
|
+
// Ordered based on occurrences on Facebook codebase
|
|
258
|
+
if (matchers.hex6) {
|
|
259
|
+
if ((match = matchers.hex6.exec(color))) {
|
|
260
|
+
return Number.parseInt(match[1] + 'ff', 16) >>> 0;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (names[color] !== undefined) {
|
|
264
|
+
return names[color];
|
|
265
|
+
}
|
|
266
|
+
if (matchers.rgb) {
|
|
267
|
+
if ((match = matchers.rgb.exec(color))) {
|
|
268
|
+
return (
|
|
269
|
+
// b
|
|
270
|
+
((parse255(match[1]) << 24) | // r
|
|
271
|
+
(parse255(match[2]) << 16) | // g
|
|
272
|
+
(parse255(match[3]) << 8) |
|
|
273
|
+
0x000000ff) >>> // a
|
|
274
|
+
0);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (matchers.rgba) {
|
|
278
|
+
if ((match = matchers.rgba.exec(color))) {
|
|
279
|
+
return (
|
|
280
|
+
// b
|
|
281
|
+
((parse255(match[1]) << 24) | // r
|
|
282
|
+
(parse255(match[2]) << 16) | // g
|
|
283
|
+
(parse255(match[3]) << 8) |
|
|
284
|
+
parse1(match[4])) >>> // a
|
|
285
|
+
0);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (matchers.hex3) {
|
|
289
|
+
if ((match = matchers.hex3.exec(color))) {
|
|
290
|
+
return (Number.parseInt(match[1] +
|
|
291
|
+
match[1] + // r
|
|
292
|
+
match[2] +
|
|
293
|
+
match[2] + // g
|
|
294
|
+
match[3] +
|
|
295
|
+
match[3] + // b
|
|
296
|
+
'ff', // a
|
|
297
|
+
16) >>> 0);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
// https://drafts.csswg.org/css-color-4/#hex-notation
|
|
301
|
+
if (matchers.hex8) {
|
|
302
|
+
if ((match = matchers.hex8.exec(color))) {
|
|
303
|
+
return Number.parseInt(match[1], 16) >>> 0;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (matchers.hex4) {
|
|
307
|
+
if ((match = matchers.hex4.exec(color))) {
|
|
308
|
+
return (Number.parseInt(match[1] +
|
|
309
|
+
match[1] + // r
|
|
310
|
+
match[2] +
|
|
311
|
+
match[2] + // g
|
|
312
|
+
match[3] +
|
|
313
|
+
match[3] + // b
|
|
314
|
+
match[4] +
|
|
315
|
+
match[4], // a
|
|
316
|
+
16) >>> 0);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (matchers.hsl) {
|
|
320
|
+
if ((match = matchers.hsl.exec(color))) {
|
|
321
|
+
return ((hslToRgb(parse360(match[1]), // h
|
|
322
|
+
parsePercentage(match[2]), // s
|
|
323
|
+
parsePercentage(match[3]) // l
|
|
324
|
+
) |
|
|
325
|
+
0x000000ff) >>> // a
|
|
326
|
+
0);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
if (matchers.hsla) {
|
|
330
|
+
if ((match = matchers.hsla.exec(color))) {
|
|
331
|
+
return ((hslToRgb(parse360(match[1]), // h
|
|
332
|
+
parsePercentage(match[2]), // s
|
|
333
|
+
parsePercentage(match[3]) // l
|
|
334
|
+
) |
|
|
335
|
+
parse1(match[4])) >>> // a
|
|
336
|
+
0);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
throw new Error(`invalid color string ${color} provided`);
|
|
340
|
+
}
|
|
341
|
+
const opacity = (c) => {
|
|
342
|
+
return ((c >> 24) & 255) / 255;
|
|
343
|
+
};
|
|
344
|
+
const red = (c) => {
|
|
345
|
+
return (c >> 16) & 255;
|
|
346
|
+
};
|
|
347
|
+
const green = (c) => {
|
|
348
|
+
return (c >> 8) & 255;
|
|
349
|
+
};
|
|
350
|
+
const blue = (c) => {
|
|
351
|
+
return c & 255;
|
|
352
|
+
};
|
|
353
|
+
const rgbaColor = (r, g, b, alpha) => {
|
|
354
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
355
|
+
};
|
|
356
|
+
function processColorInitially(color) {
|
|
357
|
+
let normalizedColor = normalizeColor(color);
|
|
358
|
+
normalizedColor = ((normalizedColor << 24) | (normalizedColor >>> 8)) >>> 0; // argb
|
|
359
|
+
return normalizedColor;
|
|
360
|
+
}
|
|
361
|
+
function processColor(color) {
|
|
362
|
+
const normalizedColor = processColorInitially(color);
|
|
363
|
+
return normalizedColor;
|
|
364
|
+
}
|
|
365
|
+
const interpolateColorsRGB = (value, inputRange, colors) => {
|
|
366
|
+
const [r, g, b, a] = [red, green, blue, opacity].map((f) => {
|
|
367
|
+
const unrounded = interpolate(value, inputRange, colors.map((c) => f(c)), {
|
|
368
|
+
extrapolateLeft: 'clamp',
|
|
369
|
+
extrapolateRight: 'clamp',
|
|
370
|
+
});
|
|
371
|
+
if (f === opacity) {
|
|
372
|
+
return Number(unrounded.toFixed(3));
|
|
373
|
+
}
|
|
374
|
+
return Math.round(unrounded);
|
|
375
|
+
});
|
|
376
|
+
return rgbaColor(r, g, b, a);
|
|
377
|
+
};
|
|
378
|
+
export const interpolateColors = (input, inputRange, outputRange) => {
|
|
379
|
+
if (typeof input === 'undefined') {
|
|
380
|
+
throw new TypeError('input can not be undefined');
|
|
381
|
+
}
|
|
382
|
+
if (typeof inputRange === 'undefined') {
|
|
383
|
+
throw new TypeError('inputRange can not be undefined');
|
|
384
|
+
}
|
|
385
|
+
if (typeof outputRange === 'undefined') {
|
|
386
|
+
throw new TypeError('outputRange can not be undefined');
|
|
387
|
+
}
|
|
388
|
+
if (inputRange.length !== outputRange.length) {
|
|
389
|
+
throw new TypeError('inputRange (' +
|
|
390
|
+
inputRange.length +
|
|
391
|
+
' values provided) and outputRange (' +
|
|
392
|
+
outputRange.length +
|
|
393
|
+
' values provided) must have the same length');
|
|
394
|
+
}
|
|
395
|
+
const processedOutputRange = outputRange.map((c) => processColor(c));
|
|
396
|
+
return interpolateColorsRGB(input, inputRange, processedOutputRange);
|
|
397
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare type ExtrapolateType = 'extend' | 'identity' | 'clamp';
|
|
2
|
+
/**
|
|
3
|
+
* Map a value from an input range to an output range.
|
|
4
|
+
* @link https://www.remotion.dev/docs/interpolate
|
|
5
|
+
* @param {!number} input value to interpolate
|
|
6
|
+
* @param {!number[]} inputRange range of values that you expect the input to assume.
|
|
7
|
+
* @param {!number[]} outputRange range of output values that you want the input to map to.
|
|
8
|
+
* @param {?object} options
|
|
9
|
+
* @param {?Function} options.easing easing function which allows you to customize the input, for example to apply a certain easing function. By default, the input is left unmodified, resulting in a pure linear interpolation {@link https://www.remotion.dev/docs/easing}
|
|
10
|
+
* @param {string=} [options.extrapolateLeft="extend"] What should happen if the input value is outside left the input range, default: "extend" {@link https://www.remotion.dev/docs/interpolate#extrapolateleft}
|
|
11
|
+
* @param {string=} [options.extrapolateRight="extend"] Same as extrapolateLeft, except for values outside right the input range {@link https://www.remotion.dev/docs/interpolate#extrapolateright}
|
|
12
|
+
*/
|
|
13
|
+
export declare function interpolate(input: number, inputRange: readonly number[], outputRange: readonly number[], options?: {
|
|
14
|
+
easing?: (input: number) => number;
|
|
15
|
+
extrapolateLeft?: ExtrapolateType;
|
|
16
|
+
extrapolateRight?: ExtrapolateType;
|
|
17
|
+
}): number;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/nodes/AnimatedInterpolation.js
|
|
2
|
+
function interpolateFunction(input, inputRange, outputRange, options) {
|
|
3
|
+
const { extrapolateLeft, extrapolateRight, easing } = options;
|
|
4
|
+
let result = input;
|
|
5
|
+
const [inputMin, inputMax] = inputRange;
|
|
6
|
+
const [outputMin, outputMax] = outputRange;
|
|
7
|
+
if (result < inputMin) {
|
|
8
|
+
if (extrapolateLeft === 'identity') {
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
if (extrapolateLeft === 'clamp') {
|
|
12
|
+
result = inputMin;
|
|
13
|
+
}
|
|
14
|
+
else if (extrapolateLeft === 'extend') {
|
|
15
|
+
// noop
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (result > inputMax) {
|
|
19
|
+
if (extrapolateRight === 'identity') {
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
if (extrapolateRight === 'clamp') {
|
|
23
|
+
result = inputMax;
|
|
24
|
+
}
|
|
25
|
+
else if (extrapolateRight === 'extend') {
|
|
26
|
+
// noop
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (outputMin === outputMax) {
|
|
30
|
+
return outputMin;
|
|
31
|
+
}
|
|
32
|
+
// Input Range
|
|
33
|
+
result = (result - inputMin) / (inputMax - inputMin);
|
|
34
|
+
// Easing
|
|
35
|
+
result = easing(result);
|
|
36
|
+
// Output Range
|
|
37
|
+
result = result * (outputMax - outputMin) + outputMin;
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
function findRange(input, inputRange) {
|
|
41
|
+
let i;
|
|
42
|
+
for (i = 1; i < inputRange.length - 1; ++i) {
|
|
43
|
+
if (inputRange[i] >= input) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return i - 1;
|
|
48
|
+
}
|
|
49
|
+
function checkValidInputRange(arr) {
|
|
50
|
+
for (let i = 1; i < arr.length; ++i) {
|
|
51
|
+
if (!(arr[i] > arr[i - 1])) {
|
|
52
|
+
throw new Error(`inputRange must be strictly monotonically non-decreasing but got [${arr.join(',')}]`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function checkInfiniteRange(name, arr) {
|
|
57
|
+
if (arr.length < 2) {
|
|
58
|
+
throw new Error(name + ' must have at least 2 elements');
|
|
59
|
+
}
|
|
60
|
+
for (const index in arr) {
|
|
61
|
+
if (typeof arr[index] !== 'number') {
|
|
62
|
+
throw new Error(`${name} must contain only numbers`);
|
|
63
|
+
}
|
|
64
|
+
if (arr[index] === -Infinity || arr[index] === Infinity) {
|
|
65
|
+
throw new Error(`${name} must contain only finite numbers, but got [${arr.join(',')}]`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Map a value from an input range to an output range.
|
|
71
|
+
* @link https://www.remotion.dev/docs/interpolate
|
|
72
|
+
* @param {!number} input value to interpolate
|
|
73
|
+
* @param {!number[]} inputRange range of values that you expect the input to assume.
|
|
74
|
+
* @param {!number[]} outputRange range of output values that you want the input to map to.
|
|
75
|
+
* @param {?object} options
|
|
76
|
+
* @param {?Function} options.easing easing function which allows you to customize the input, for example to apply a certain easing function. By default, the input is left unmodified, resulting in a pure linear interpolation {@link https://www.remotion.dev/docs/easing}
|
|
77
|
+
* @param {string=} [options.extrapolateLeft="extend"] What should happen if the input value is outside left the input range, default: "extend" {@link https://www.remotion.dev/docs/interpolate#extrapolateleft}
|
|
78
|
+
* @param {string=} [options.extrapolateRight="extend"] Same as extrapolateLeft, except for values outside right the input range {@link https://www.remotion.dev/docs/interpolate#extrapolateright}
|
|
79
|
+
*/
|
|
80
|
+
export function interpolate(input, inputRange, outputRange, options) {
|
|
81
|
+
var _a;
|
|
82
|
+
if (typeof input === 'undefined') {
|
|
83
|
+
throw new Error('input can not be undefined');
|
|
84
|
+
}
|
|
85
|
+
if (typeof inputRange === 'undefined') {
|
|
86
|
+
throw new Error('inputRange can not be undefined');
|
|
87
|
+
}
|
|
88
|
+
if (typeof outputRange === 'undefined') {
|
|
89
|
+
throw new Error('outputRange can not be undefined');
|
|
90
|
+
}
|
|
91
|
+
if (inputRange.length !== outputRange.length) {
|
|
92
|
+
throw new Error('inputRange (' +
|
|
93
|
+
inputRange.length +
|
|
94
|
+
') and outputRange (' +
|
|
95
|
+
outputRange.length +
|
|
96
|
+
') must have the same length');
|
|
97
|
+
}
|
|
98
|
+
checkInfiniteRange('inputRange', inputRange);
|
|
99
|
+
checkInfiniteRange('outputRange', outputRange);
|
|
100
|
+
checkValidInputRange(inputRange);
|
|
101
|
+
const easing = (_a = options === null || options === void 0 ? void 0 : options.easing) !== null && _a !== void 0 ? _a : ((num) => num);
|
|
102
|
+
let extrapolateLeft = 'extend';
|
|
103
|
+
if ((options === null || options === void 0 ? void 0 : options.extrapolateLeft) !== undefined) {
|
|
104
|
+
extrapolateLeft = options.extrapolateLeft;
|
|
105
|
+
}
|
|
106
|
+
let extrapolateRight = 'extend';
|
|
107
|
+
if ((options === null || options === void 0 ? void 0 : options.extrapolateRight) !== undefined) {
|
|
108
|
+
extrapolateRight = options.extrapolateRight;
|
|
109
|
+
}
|
|
110
|
+
if (typeof input !== 'number') {
|
|
111
|
+
throw new TypeError('Cannot interpolate an input which is not a number');
|
|
112
|
+
}
|
|
113
|
+
const range = findRange(input, inputRange);
|
|
114
|
+
return interpolateFunction(input, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
|
|
115
|
+
easing,
|
|
116
|
+
extrapolateLeft,
|
|
117
|
+
extrapolateRight,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isApproximatelyTheSame: (num1: number, num2: number) => boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
const IsPlayerContext = createContext(false);
|
|
4
|
+
export const IsPlayerContextProvider = ({ children, }) => {
|
|
5
|
+
return _jsx(IsPlayerContext.Provider, { value: true, children: children });
|
|
6
|
+
};
|
|
7
|
+
export const useIsPlayer = () => {
|
|
8
|
+
return useContext(IsPlayerContext);
|
|
9
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AbsoluteFill } from './AbsoluteFill.js';
|
|
3
|
+
const rotate = {
|
|
4
|
+
transform: `rotate(90deg)`,
|
|
5
|
+
};
|
|
6
|
+
const ICON_SIZE = 40;
|
|
7
|
+
const label = {
|
|
8
|
+
color: '#555',
|
|
9
|
+
fontSize: 14,
|
|
10
|
+
fontFamily: 'sans-serif',
|
|
11
|
+
};
|
|
12
|
+
const container = {
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
};
|
|
16
|
+
export const Loading = () => {
|
|
17
|
+
return (_jsxs(AbsoluteFill, { style: container, id: "remotion-comp-loading", children: [_jsx("style", { type: "text/css", children: `
|
|
18
|
+
@keyframes anim {
|
|
19
|
+
from {
|
|
20
|
+
opacity: 0
|
|
21
|
+
}
|
|
22
|
+
to {
|
|
23
|
+
opacity: 1
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
#remotion-comp-loading {
|
|
27
|
+
animation: anim 2s;
|
|
28
|
+
animation-fill-mode: forwards;
|
|
29
|
+
}
|
|
30
|
+
` }), _jsx("svg", { width: ICON_SIZE, height: ICON_SIZE, viewBox: "-100 -100 400 400", style: rotate, children: _jsx("path", { fill: "#555", stroke: "#555", strokeWidth: "100", strokeLinejoin: "round", d: "M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z" }) }), _jsx("p", { style: label, children: "Loading..." })] }));
|
|
31
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LayoutAndStyle } from '../Sequence.js';
|
|
3
|
+
export declare type LoopProps = {
|
|
4
|
+
durationInFrames: number;
|
|
5
|
+
times?: number;
|
|
6
|
+
name?: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
} & LayoutAndStyle;
|
|
9
|
+
export declare const Loop: React.FC<LoopProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Sequence } from '../Sequence.js';
|
|
3
|
+
import { useVideoConfig } from '../use-video-config.js';
|
|
4
|
+
import { validateDurationInFrames } from '../validation/validate-duration-in-frames.js';
|
|
5
|
+
export const Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
|
|
6
|
+
const { durationInFrames: compDuration } = useVideoConfig();
|
|
7
|
+
validateDurationInFrames(durationInFrames, 'of the <Loop /> component');
|
|
8
|
+
if (typeof times !== 'number') {
|
|
9
|
+
throw new TypeError(`You passed to "times" an argument of type ${typeof times}, but it must be a number.`);
|
|
10
|
+
}
|
|
11
|
+
if (times !== Infinity && times % 1 !== 0) {
|
|
12
|
+
throw new TypeError(`The "times" prop of a loop must be an integer, but got ${times}.`);
|
|
13
|
+
}
|
|
14
|
+
if (times < 0) {
|
|
15
|
+
throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${times}`);
|
|
16
|
+
}
|
|
17
|
+
const maxTimes = Math.ceil(compDuration / durationInFrames);
|
|
18
|
+
const actualTimes = Math.min(maxTimes, times);
|
|
19
|
+
const style = props.layout === 'none' ? undefined : props.style;
|
|
20
|
+
return (_jsx(_Fragment, { children: new Array(actualTimes).fill(true).map((_, i) => {
|
|
21
|
+
return (_jsx(Sequence
|
|
22
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
23
|
+
, { durationInFrames: durationInFrames, from: i * durationInFrames, name: name, showLoopTimesInTimeline: actualTimes, showInTimeline: i === 0, layout: props.layout, style: style, children: children }, `loop-${i}`));
|
|
24
|
+
}) }));
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkMultipleRemotionVersions: () => void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { truthy } from './truthy.js';
|
|
2
|
+
import { VERSION } from './version.js';
|
|
3
|
+
export const checkMultipleRemotionVersions = () => {
|
|
4
|
+
if (typeof globalThis === 'undefined') {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
const alreadyImported = globalThis.remotion_imported ||
|
|
8
|
+
(typeof window !== 'undefined' && window.remotion_imported);
|
|
9
|
+
if (alreadyImported) {
|
|
10
|
+
if (typeof window === 'undefined' && alreadyImported === VERSION) {
|
|
11
|
+
// Next.JS will reload the package and cause a server-side warning.
|
|
12
|
+
// It's okay if this happens during SSR in developement
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[
|
|
16
|
+
VERSION,
|
|
17
|
+
typeof alreadyImported === 'string'
|
|
18
|
+
? alreadyImported
|
|
19
|
+
: 'an older version',
|
|
20
|
+
]
|
|
21
|
+
.filter(truthy)
|
|
22
|
+
.join(' and ')}. This will cause things to break in an unexpected way.\nCheck that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
|
|
23
|
+
}
|
|
24
|
+
globalThis.remotion_imported = VERSION;
|
|
25
|
+
if (typeof window !== 'undefined') {
|
|
26
|
+
window.remotion_imported = VERSION;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext, useContext, useEffect, useState } from 'react';
|
|
2
|
+
export const NonceContext = createContext({
|
|
3
|
+
getNonce: () => 0,
|
|
4
|
+
fastRefreshes: 0,
|
|
5
|
+
});
|
|
6
|
+
export const useNonce = () => {
|
|
7
|
+
const context = useContext(NonceContext);
|
|
8
|
+
const [nonce, setNonce] = useState(() => context.getNonce());
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
setNonce(context.getNonce);
|
|
11
|
+
}, [context]);
|
|
12
|
+
return nonce;
|
|
13
|
+
};
|