@remotion/promo-pages 4.0.441 → 4.0.443
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/Homepage.js +1427 -1356
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/Homepage.js +101 -54
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/design.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/experts.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/homepage/Pricing.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsGallery.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsShow.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsSubmit.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/template-modal-content.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/templates.js +4 -3
- package/dist/cn.d.ts +2 -0
- package/dist/cn.js +5 -0
- package/dist/components/3DEngine/ButtonDemo.d.ts +2 -0
- package/dist/components/3DEngine/ButtonDemo.js +43 -0
- package/dist/components/3DEngine/Faces.d.ts +5 -0
- package/dist/components/3DEngine/Faces.js +7 -0
- package/dist/components/3DEngine/Outer.d.ts +8 -0
- package/dist/components/3DEngine/Outer.js +56 -0
- package/dist/components/3DEngine/Switch.d.ts +4 -0
- package/dist/components/3DEngine/Switch.js +4 -0
- package/dist/components/3DEngine/get-child-node-from.d.ts +1 -0
- package/dist/components/3DEngine/get-child-node-from.js +14 -0
- package/dist/components/3DEngine/hover-transforms.d.ts +9 -0
- package/dist/components/3DEngine/hover-transforms.js +177 -0
- package/dist/components/BackButton.d.ts +6 -0
- package/dist/components/BackButton.js +9 -0
- package/dist/components/CommandCopyButton.d.ts +5 -0
- package/dist/components/CommandCopyButton.js +4 -0
- package/dist/components/Homepage.d.ts +6 -0
- package/dist/components/Homepage.js +20 -0
- package/dist/components/ManageTeamMembers.d.ts +2 -0
- package/dist/components/ManageTeamMembers.js +42 -0
- package/dist/components/Spinner.d.ts +3 -0
- package/dist/components/Spinner.js +4 -0
- package/dist/components/TeamPicture.d.ts +1 -0
- package/dist/components/TeamPicture.js +4 -0
- package/dist/components/design.d.ts +1 -0
- package/dist/components/design.js +33 -0
- package/dist/components/experts/ExpertsPage.d.ts +11 -0
- package/dist/components/experts/ExpertsPage.js +50 -0
- package/dist/components/experts/experts-data.d.ts +15 -0
- package/dist/components/experts/experts-data.js +263 -0
- package/dist/components/experts/experts-icons.d.ts +7 -0
- package/dist/components/experts/experts-icons.js +36 -0
- package/dist/components/experts.d.ts +3 -0
- package/dist/components/experts.js +2 -0
- package/dist/components/homepage/BackgroundAnimation.d.ts +2 -0
- package/dist/components/homepage/BackgroundAnimation.js +66 -0
- package/dist/components/homepage/ChooseTemplate.d.ts +2 -0
- package/dist/components/homepage/ChooseTemplate.js +25 -0
- package/dist/components/homepage/CommunityStats.d.ts +3 -0
- package/dist/components/homepage/CommunityStats.js +6 -0
- package/dist/components/homepage/CommunityStatsItems.d.ts +7 -0
- package/dist/components/homepage/CommunityStatsItems.js +58 -0
- package/dist/components/homepage/Demo/Card.d.ts +15 -0
- package/dist/components/homepage/Demo/Card.js +174 -0
- package/dist/components/homepage/Demo/Cards.d.ts +15 -0
- package/dist/components/homepage/Demo/Cards.js +57 -0
- package/dist/components/homepage/Demo/Comp.d.ts +38 -0
- package/dist/components/homepage/Demo/Comp.js +72 -0
- package/dist/components/homepage/Demo/CurrentCountry.d.ts +9 -0
- package/dist/components/homepage/Demo/CurrentCountry.js +48 -0
- package/dist/components/homepage/Demo/DemoError.d.ts +2 -0
- package/dist/components/homepage/Demo/DemoError.js +10 -0
- package/dist/components/homepage/Demo/DemoErrorIcon.d.ts +2 -0
- package/dist/components/homepage/Demo/DemoErrorIcon.js +16 -0
- package/dist/components/homepage/Demo/DemoRender.d.ts +33 -0
- package/dist/components/homepage/Demo/DemoRender.js +107 -0
- package/dist/components/homepage/Demo/DigitWheel.d.ts +9 -0
- package/dist/components/homepage/Demo/DigitWheel.js +94 -0
- package/dist/components/homepage/Demo/DisplayedEmoji.d.ts +5 -0
- package/dist/components/homepage/Demo/DisplayedEmoji.js +59 -0
- package/dist/components/homepage/Demo/DoneCheckmark.d.ts +2 -0
- package/dist/components/homepage/Demo/DoneCheckmark.js +20 -0
- package/dist/components/homepage/Demo/DownloadNudge.d.ts +2 -0
- package/dist/components/homepage/Demo/DownloadNudge.js +27 -0
- package/dist/components/homepage/Demo/DragAndDropNudge.d.ts +3 -0
- package/dist/components/homepage/Demo/DragAndDropNudge.js +26 -0
- package/dist/components/homepage/Demo/EmojiCard.d.ts +10 -0
- package/dist/components/homepage/Demo/EmojiCard.js +120 -0
- package/dist/components/homepage/Demo/Minus.d.ts +5 -0
- package/dist/components/homepage/Demo/Minus.js +11 -0
- package/dist/components/homepage/Demo/PlayPauseButton.d.ts +5 -0
- package/dist/components/homepage/Demo/PlayPauseButton.js +47 -0
- package/dist/components/homepage/Demo/PlayerControls.d.ts +8 -0
- package/dist/components/homepage/Demo/PlayerControls.js +15 -0
- package/dist/components/homepage/Demo/PlayerSeekBar.d.ts +11 -0
- package/dist/components/homepage/Demo/PlayerSeekBar.js +216 -0
- package/dist/components/homepage/Demo/PlayerVolume.d.ts +5 -0
- package/dist/components/homepage/Demo/PlayerVolume.js +53 -0
- package/dist/components/homepage/Demo/Progress.d.ts +4 -0
- package/dist/components/homepage/Demo/Progress.js +14 -0
- package/dist/components/homepage/Demo/Spinner.d.ts +5 -0
- package/dist/components/homepage/Demo/Spinner.js +37 -0
- package/dist/components/homepage/Demo/Switcher.d.ts +6 -0
- package/dist/components/homepage/Demo/Switcher.js +25 -0
- package/dist/components/homepage/Demo/Temperature.d.ts +6 -0
- package/dist/components/homepage/Demo/Temperature.js +21 -0
- package/dist/components/homepage/Demo/TemperatureNumber.d.ts +5 -0
- package/dist/components/homepage/Demo/TemperatureNumber.js +36 -0
- package/dist/components/homepage/Demo/ThemeNudge.d.ts +3 -0
- package/dist/components/homepage/Demo/ThemeNudge.js +35 -0
- package/dist/components/homepage/Demo/TimeDisplay.d.ts +6 -0
- package/dist/components/homepage/Demo/TimeDisplay.js +27 -0
- package/dist/components/homepage/Demo/TrendingRepos.d.ts +6 -0
- package/dist/components/homepage/Demo/TrendingRepos.js +65 -0
- package/dist/components/homepage/Demo/icons.d.ts +10 -0
- package/dist/components/homepage/Demo/icons.js +22 -0
- package/dist/components/homepage/Demo/index.d.ts +2 -0
- package/dist/components/homepage/Demo/index.js +95 -0
- package/dist/components/homepage/Demo/math.d.ts +10 -0
- package/dist/components/homepage/Demo/math.js +29 -0
- package/dist/components/homepage/Demo/types.d.ts +6 -0
- package/dist/components/homepage/Demo/types.js +0 -0
- package/dist/components/homepage/EditorStarterSection.d.ts +3 -0
- package/dist/components/homepage/EditorStarterSection.js +8 -0
- package/dist/components/homepage/EvaluateRemotion.d.ts +3 -0
- package/dist/components/homepage/EvaluateRemotion.js +21 -0
- package/dist/components/homepage/FreePricing.d.ts +4 -0
- package/dist/components/homepage/FreePricing.js +134 -0
- package/dist/components/homepage/GetStartedStrip.d.ts +2 -0
- package/dist/components/homepage/GetStartedStrip.js +14 -0
- package/dist/components/homepage/GitHubButton.d.ts +2 -0
- package/dist/components/homepage/GitHubButton.js +7 -0
- package/dist/components/homepage/IconForTemplate.d.ts +6 -0
- package/dist/components/homepage/IconForTemplate.js +105 -0
- package/dist/components/homepage/IfYouKnowReact.d.ts +3 -0
- package/dist/components/homepage/IfYouKnowReact.js +23 -0
- package/dist/components/homepage/InfoTooltip.d.ts +6 -0
- package/dist/components/homepage/InfoTooltip.js +6 -0
- package/dist/components/homepage/MoreTemplatesButton.d.ts +2 -0
- package/dist/components/homepage/MoreTemplatesButton.js +11 -0
- package/dist/components/homepage/MuxVideo.d.ts +7 -0
- package/dist/components/homepage/MuxVideo.js +45 -0
- package/dist/components/homepage/NewsletterButton.d.ts +2 -0
- package/dist/components/homepage/NewsletterButton.js +38 -0
- package/dist/components/homepage/ParameterizeAndEdit.d.ts +2 -0
- package/dist/components/homepage/ParameterizeAndEdit.js +22 -0
- package/dist/components/homepage/Pricing.d.ts +2 -0
- package/dist/components/homepage/Pricing.js +15 -0
- package/dist/components/homepage/PricingBulletPoint.d.ts +6 -0
- package/dist/components/homepage/PricingBulletPoint.js +19 -0
- package/dist/components/homepage/RealMp4Videos.d.ts +2 -0
- package/dist/components/homepage/RealMp4Videos.js +41 -0
- package/dist/components/homepage/Spacer.d.ts +2 -0
- package/dist/components/homepage/Spacer.js +4 -0
- package/dist/components/homepage/TemplateIcon.d.ts +5 -0
- package/dist/components/homepage/TemplateIcon.js +24 -0
- package/dist/components/homepage/TextInput.d.ts +7 -0
- package/dist/components/homepage/TextInput.js +34 -0
- package/dist/components/homepage/TrustedByBanner.d.ts +2 -0
- package/dist/components/homepage/TrustedByBanner.js +27 -0
- package/dist/components/homepage/VideoApps.d.ts +4 -0
- package/dist/components/homepage/VideoApps.js +72 -0
- package/dist/components/homepage/VideoAppsShowcase.d.ts +3 -0
- package/dist/components/homepage/VideoAppsShowcase.js +139 -0
- package/dist/components/homepage/VideoAppsTitle.d.ts +4 -0
- package/dist/components/homepage/VideoAppsTitle.js +4 -0
- package/dist/components/homepage/VideoPlayerWithControls.d.ts +20 -0
- package/dist/components/homepage/VideoPlayerWithControls.js +105 -0
- package/dist/components/homepage/WriteInReact.d.ts +2 -0
- package/dist/components/homepage/WriteInReact.js +10 -0
- package/dist/components/homepage/YouAreHere.d.ts +2 -0
- package/dist/components/homepage/YouAreHere.js +23 -0
- package/dist/components/homepage/layout/Button.d.ts +22 -0
- package/dist/components/homepage/layout/Button.js +30 -0
- package/dist/components/homepage/layout/colors.d.ts +13 -0
- package/dist/components/homepage/layout/colors.js +14 -0
- package/dist/components/homepage/layout/use-color-mode.d.ts +21 -0
- package/dist/components/homepage/layout/use-color-mode.js +22 -0
- package/dist/components/homepage/layout/use-el-size.d.ts +5 -0
- package/dist/components/homepage/layout/use-el-size.js +40 -0
- package/dist/components/homepage/layout/use-mobile-layout.d.ts +1 -0
- package/dist/components/homepage/layout/use-mobile-layout.js +6 -0
- package/dist/components/icons/blank.d.ts +3 -0
- package/dist/components/icons/blank.js +4 -0
- package/dist/components/icons/brain.d.ts +2 -0
- package/dist/components/icons/brain.js +4 -0
- package/dist/components/icons/clone.d.ts +2 -0
- package/dist/components/icons/clone.js +2 -0
- package/dist/components/icons/code-hike.d.ts +3 -0
- package/dist/components/icons/code-hike.js +4 -0
- package/dist/components/icons/cubes.d.ts +3 -0
- package/dist/components/icons/cubes.js +4 -0
- package/dist/components/icons/editor.d.ts +3 -0
- package/dist/components/icons/editor.js +4 -0
- package/dist/components/icons/electron.d.ts +4 -0
- package/dist/components/icons/electron.js +4 -0
- package/dist/components/icons/js.d.ts +3 -0
- package/dist/components/icons/js.js +4 -0
- package/dist/components/icons/music.d.ts +2 -0
- package/dist/components/icons/music.js +4 -0
- package/dist/components/icons/next.d.ts +4 -0
- package/dist/components/icons/next.js +4 -0
- package/dist/components/icons/overlay.d.ts +3 -0
- package/dist/components/icons/overlay.js +4 -0
- package/dist/components/icons/prompt-to-video.d.ts +2 -0
- package/dist/components/icons/prompt-to-video.js +4 -0
- package/dist/components/icons/recorder.d.ts +3 -0
- package/dist/components/icons/recorder.js +4 -0
- package/dist/components/icons/remix.d.ts +3 -0
- package/dist/components/icons/remix.js +4 -0
- package/dist/components/icons/render-server.d.ts +3 -0
- package/dist/components/icons/render-server.js +4 -0
- package/dist/components/icons/skia.d.ts +3 -0
- package/dist/components/icons/skia.js +4 -0
- package/dist/components/icons/stargazer.d.ts +3 -0
- package/dist/components/icons/stargazer.js +4 -0
- package/dist/components/icons/still.d.ts +3 -0
- package/dist/components/icons/still.js +4 -0
- package/dist/components/icons/tailwind.d.ts +3 -0
- package/dist/components/icons/tailwind.js +4 -0
- package/dist/components/icons/tiktok.d.ts +3 -0
- package/dist/components/icons/tiktok.js +4 -0
- package/dist/components/icons/timeline.d.ts +3 -0
- package/dist/components/icons/timeline.js +4 -0
- package/dist/components/icons/ts.d.ts +3 -0
- package/dist/components/icons/ts.js +4 -0
- package/dist/components/icons/undo.d.ts +3 -0
- package/dist/components/icons/undo.js +2 -0
- package/dist/components/icons/vercel.d.ts +4 -0
- package/dist/components/icons/vercel.js +4 -0
- package/dist/components/icons/waveform.d.ts +3 -0
- package/dist/components/icons/waveform.js +4 -0
- package/dist/components/prompts/CardLikeButton.d.ts +5 -0
- package/dist/components/prompts/CardLikeButton.js +49 -0
- package/dist/components/prompts/ClipboardIcon.d.ts +5 -0
- package/dist/components/prompts/ClipboardIcon.js +4 -0
- package/dist/components/prompts/CopyPromptButton.d.ts +4 -0
- package/dist/components/prompts/CopyPromptButton.js +13 -0
- package/dist/components/prompts/LikeButton.d.ts +5 -0
- package/dist/components/prompts/LikeButton.js +49 -0
- package/dist/components/prompts/MuxPlayer.d.ts +8 -0
- package/dist/components/prompts/MuxPlayer.js +21 -0
- package/dist/components/prompts/NewBackButton.d.ts +5 -0
- package/dist/components/prompts/NewBackButton.js +8 -0
- package/dist/components/prompts/Page.d.ts +8 -0
- package/dist/components/prompts/Page.js +7 -0
- package/dist/components/prompts/PromptsGallery.d.ts +7 -0
- package/dist/components/prompts/PromptsGallery.js +60 -0
- package/dist/components/prompts/PromptsShow.d.ts +5 -0
- package/dist/components/prompts/PromptsShow.js +17 -0
- package/dist/components/prompts/PromptsSubmit.d.ts +2 -0
- package/dist/components/prompts/PromptsSubmit.js +173 -0
- package/dist/components/prompts/config.d.ts +1 -0
- package/dist/components/prompts/config.js +1 -0
- package/dist/components/prompts/prompt-helpers.d.ts +8 -0
- package/dist/components/prompts/prompt-helpers.js +76 -0
- package/dist/components/prompts/prompt-types.d.ts +14 -0
- package/dist/components/prompts/prompt-types.js +0 -0
- package/dist/components/prompts/use-heart-animation.d.ts +5 -0
- package/dist/components/prompts/use-heart-animation.js +29 -0
- package/dist/components/team/TeamCards.d.ts +6 -0
- package/dist/components/team/TeamCards.js +19 -0
- package/dist/components/team/TitleTeamCards.d.ts +2 -0
- package/dist/components/team/TitleTeamCards.js +6 -0
- package/dist/components/team/TrustSection.d.ts +2 -0
- package/dist/components/team/TrustSection.js +59 -0
- package/dist/components/team.d.ts +3 -0
- package/dist/components/team.js +14 -0
- package/dist/components/template-modal-content.d.ts +5 -0
- package/dist/components/template-modal-content.js +73 -0
- package/dist/components/templates.d.ts +2 -0
- package/dist/components/templates.js +27 -0
- package/dist/design.js +1500 -1464
- package/dist/experts.js +1385 -1349
- package/dist/helpers/mobile-layout.d.ts +1 -0
- package/dist/helpers/mobile-layout.js +6 -0
- package/dist/helpers/use-el-size.d.ts +5 -0
- package/dist/helpers/use-el-size.js +40 -0
- package/dist/homepage/Pricing.js +1500 -1464
- package/dist/main.d.ts +1 -0
- package/dist/main.js +6 -0
- package/dist/prompts/PromptsGallery.js +1504 -1467
- package/dist/prompts/PromptsShow.js +1481 -1445
- package/dist/prompts/PromptsSubmit.js +1483 -1447
- package/dist/prompts-show.d.ts +1 -0
- package/dist/prompts-show.js +20 -0
- package/dist/prompts-submit.d.ts +1 -0
- package/dist/prompts-submit.js +6 -0
- package/dist/prompts.d.ts +1 -0
- package/dist/prompts.js +6 -0
- package/dist/tailwind.css +0 -3
- package/dist/team.d.ts +1 -0
- package/dist/team.js +1500 -1464
- package/dist/template-modal-content.js +1504 -1468
- package/dist/templates.js +1501 -1464
- package/package.json +13 -13
package/dist/Homepage.js
CHANGED
|
@@ -740,176 +740,176 @@ import { useMemo as useMemo36 } from "react";
|
|
|
740
740
|
|
|
741
741
|
// ../core/dist/esm/index.mjs
|
|
742
742
|
import { createContext } from "react";
|
|
743
|
-
import {
|
|
743
|
+
import { Suspense, useContext as useContext9, useEffect as useEffect2 } from "react";
|
|
744
|
+
import { createPortal } from "react-dom";
|
|
745
|
+
import { createContext as createContext2 } from "react";
|
|
744
746
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
747
|
+
import { createContext as createContext3 } from "react";
|
|
748
|
+
import { createContext as createContext5, useContext as useContext2, useEffect, useMemo as useMemo2 } from "react";
|
|
749
|
+
import { createContext as createContext4, useCallback, useContext, useMemo, useRef } from "react";
|
|
750
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
751
|
+
import { createContext as createContext6, useContext as useContext3 } from "react";
|
|
752
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
753
|
+
import { forwardRef, useMemo as useMemo3 } from "react";
|
|
754
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
755
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
756
|
+
import { createContext as createContext8, createRef, useContext as useContext5, useMemo as useMemo5 } from "react";
|
|
757
|
+
import React3, { createContext as createContext7, useCallback as useCallback2, useMemo as useMemo4 } from "react";
|
|
758
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
759
|
+
import { useContext as useContext4, useState } from "react";
|
|
760
|
+
import React4 from "react";
|
|
761
|
+
import { createContext as createContext10, useCallback as useCallback3, useContext as useContext7 } from "react";
|
|
762
|
+
import { createContext as createContext9 } from "react";
|
|
763
|
+
import * as React5 from "react";
|
|
764
|
+
import React6, { useMemo as useMemo6, useRef as useRef2 } from "react";
|
|
765
|
+
import { useContext as useContext8, useMemo as useMemo7 } from "react";
|
|
766
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
745
767
|
import {
|
|
746
768
|
forwardRef as forwardRef2,
|
|
747
|
-
useContext as
|
|
748
|
-
useEffect,
|
|
749
|
-
useMemo as
|
|
769
|
+
useContext as useContext15,
|
|
770
|
+
useEffect as useEffect3,
|
|
771
|
+
useMemo as useMemo13,
|
|
750
772
|
useState as useState4
|
|
751
773
|
} from "react";
|
|
752
|
-
import {
|
|
753
|
-
import {
|
|
754
|
-
import { useContext as
|
|
755
|
-
import { createContext as createContext3 } from "react";
|
|
756
|
-
import { useContext as useContext7, useMemo as useMemo6 } from "react";
|
|
774
|
+
import { useContext as useContext14, useMemo as useMemo11 } from "react";
|
|
775
|
+
import { createContext as createContext11 } from "react";
|
|
776
|
+
import { useContext as useContext10, useMemo as useMemo9 } from "react";
|
|
757
777
|
import {
|
|
758
|
-
createContext as
|
|
778
|
+
createContext as createContext12,
|
|
759
779
|
useLayoutEffect,
|
|
760
|
-
useMemo as
|
|
761
|
-
useRef,
|
|
780
|
+
useMemo as useMemo8,
|
|
781
|
+
useRef as useRef3,
|
|
762
782
|
useState as useState2
|
|
763
783
|
} from "react";
|
|
764
|
-
import { createContext as createContext5, useCallback, useContext as useContext4 } from "react";
|
|
765
|
-
import { createContext as createContext4 } from "react";
|
|
766
|
-
import * as React2 from "react";
|
|
767
|
-
import { useContext as useContext3, useState } from "react";
|
|
768
|
-
import React3 from "react";
|
|
769
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
770
|
-
import { useContext as useContext6, useMemo as useMemo5 } from "react";
|
|
771
|
-
import { createContext as createContext7 } from "react";
|
|
772
|
-
import { createContext as createContext9, createRef, useContext as useContext5, useMemo as useMemo4 } from "react";
|
|
773
|
-
import React5, { createContext as createContext8, useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
774
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
775
|
-
import { useContext as useContext8 } from "react";
|
|
776
|
-
import { createContext as createContext10 } from "react";
|
|
777
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
778
|
-
import { useContext as useContext10 } from "react";
|
|
779
|
-
import { useContext as useContext9, useMemo as useMemo7 } from "react";
|
|
780
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
781
|
-
import { createContext as createContext11, useCallback as useCallback3, useContext as useContext12, useMemo as useMemo9, useRef as useRef2 } from "react";
|
|
782
|
-
import { createContext as createContext12 } from "react";
|
|
783
|
-
import React8, { useCallback as useCallback4, useMemo as useMemo10, useRef as useRef3, useState as useState3 } from "react";
|
|
784
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
785
784
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
785
|
+
import { useContext as useContext11 } from "react";
|
|
786
|
+
import { useContext as useContext13 } from "react";
|
|
787
|
+
import { useContext as useContext12, useMemo as useMemo10 } from "react";
|
|
788
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
789
|
+
import { createContext as createContext13 } from "react";
|
|
790
|
+
import React10, { useCallback as useCallback4, useMemo as useMemo12, useRef as useRef4, useState as useState3 } from "react";
|
|
791
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
792
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
786
793
|
import {
|
|
787
794
|
forwardRef as forwardRef3,
|
|
788
|
-
useEffect as
|
|
795
|
+
useEffect as useEffect4,
|
|
789
796
|
useImperativeHandle as useImperativeHandle2,
|
|
790
797
|
useLayoutEffect as useLayoutEffect2,
|
|
791
|
-
useRef as
|
|
798
|
+
useRef as useRef6,
|
|
792
799
|
useState as useState5
|
|
793
800
|
} from "react";
|
|
794
|
-
import
|
|
795
|
-
import { jsx as
|
|
796
|
-
import { jsx as
|
|
797
|
-
import { useContext as
|
|
801
|
+
import React12, { useCallback as useCallback5, useImperativeHandle, useRef as useRef5 } from "react";
|
|
802
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
803
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
804
|
+
import { useContext as useContext16, useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
|
|
798
805
|
import {
|
|
799
|
-
createContext as
|
|
806
|
+
createContext as createContext14,
|
|
800
807
|
useCallback as useCallback6,
|
|
801
808
|
useImperativeHandle as useImperativeHandle3,
|
|
802
809
|
useLayoutEffect as useLayoutEffect3,
|
|
803
|
-
useMemo as
|
|
804
|
-
useRef as
|
|
810
|
+
useMemo as useMemo14,
|
|
811
|
+
useRef as useRef7,
|
|
805
812
|
useState as useState6
|
|
806
813
|
} from "react";
|
|
807
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
808
|
-
import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext26 } from "react";
|
|
809
|
-
import React11, { createContext as createContext14, useMemo as useMemo13 } from "react";
|
|
810
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
811
|
-
import { useContext as useContext15 } from "react";
|
|
812
|
-
import { createContext as createContext15, useEffect as useEffect3, useState as useState8 } from "react";
|
|
813
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
814
|
-
import { createContext as createContext16, useMemo as useMemo14, useReducer } from "react";
|
|
815
814
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
816
|
-
import
|
|
815
|
+
import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext28 } from "react";
|
|
816
|
+
import React13, { createContext as createContext15, useMemo as useMemo15 } from "react";
|
|
817
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
818
|
+
import { useContext as useContext17 } from "react";
|
|
819
|
+
import { createContext as createContext16, useEffect as useEffect5, useState as useState8 } from "react";
|
|
820
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
821
|
+
import { createContext as createContext17, useMemo as useMemo16, useReducer } from "react";
|
|
822
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
823
|
+
import React19, {
|
|
817
824
|
forwardRef as forwardRef4,
|
|
818
|
-
useContext as
|
|
819
|
-
useEffect as
|
|
825
|
+
useContext as useContext26,
|
|
826
|
+
useEffect as useEffect12,
|
|
820
827
|
useImperativeHandle as useImperativeHandle4,
|
|
821
|
-
useMemo as
|
|
822
|
-
useRef as
|
|
828
|
+
useMemo as useMemo24,
|
|
829
|
+
useRef as useRef15,
|
|
823
830
|
useState as useState13
|
|
824
831
|
} from "react";
|
|
825
|
-
import { useContext as
|
|
826
|
-
import
|
|
827
|
-
createContext as
|
|
832
|
+
import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useRef as useRef10 } from "react";
|
|
833
|
+
import React16, {
|
|
834
|
+
createContext as createContext18,
|
|
828
835
|
createRef as createRef2,
|
|
829
836
|
useCallback as useCallback7,
|
|
830
|
-
useContext as
|
|
831
|
-
useMemo as
|
|
832
|
-
useRef as
|
|
837
|
+
useContext as useContext18,
|
|
838
|
+
useMemo as useMemo18,
|
|
839
|
+
useRef as useRef8,
|
|
833
840
|
useState as useState9
|
|
834
841
|
} from "react";
|
|
835
|
-
import { useMemo as
|
|
836
|
-
import { jsx as
|
|
837
|
-
import { useRef as
|
|
838
|
-
import { useContext as
|
|
839
|
-
import { useContext as
|
|
842
|
+
import { useMemo as useMemo17 } from "react";
|
|
843
|
+
import { jsx as jsx18, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
844
|
+
import { useRef as useRef9 } from "react";
|
|
845
|
+
import { useContext as useContext21, useEffect as useEffect6, useMemo as useMemo19, useState as useState10 } from "react";
|
|
846
|
+
import { useContext as useContext20 } from "react";
|
|
840
847
|
import {
|
|
841
848
|
useCallback as useCallback10,
|
|
842
|
-
useContext as
|
|
843
|
-
useEffect as
|
|
849
|
+
useContext as useContext24,
|
|
850
|
+
useEffect as useEffect10,
|
|
844
851
|
useLayoutEffect as useLayoutEffect7,
|
|
845
|
-
useRef as
|
|
852
|
+
useRef as useRef14
|
|
846
853
|
} from "react";
|
|
847
|
-
import { useCallback as useCallback9, useMemo as
|
|
848
|
-
import { useContext as
|
|
849
|
-
import
|
|
854
|
+
import { useCallback as useCallback9, useMemo as useMemo22, useRef as useRef12 } from "react";
|
|
855
|
+
import { useContext as useContext23, useMemo as useMemo21 } from "react";
|
|
856
|
+
import React17, {
|
|
850
857
|
useCallback as useCallback8,
|
|
851
|
-
useContext as
|
|
852
|
-
useEffect as
|
|
858
|
+
useContext as useContext22,
|
|
859
|
+
useEffect as useEffect7,
|
|
853
860
|
useLayoutEffect as useLayoutEffect6,
|
|
854
|
-
useMemo as
|
|
855
|
-
useRef as
|
|
861
|
+
useMemo as useMemo20,
|
|
862
|
+
useRef as useRef11,
|
|
856
863
|
useState as useState11
|
|
857
864
|
} from "react";
|
|
858
|
-
import { jsx as
|
|
859
|
-
import
|
|
860
|
-
import { useEffect as
|
|
861
|
-
import { useEffect as
|
|
862
|
-
import { useEffect as
|
|
863
|
-
import { createContext as
|
|
864
|
-
import { jsx as
|
|
865
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
866
|
+
import React18 from "react";
|
|
867
|
+
import { useEffect as useEffect8, useState as useState12 } from "react";
|
|
868
|
+
import { useEffect as useEffect9, useRef as useRef13 } from "react";
|
|
869
|
+
import { useEffect as useEffect11 } from "react";
|
|
870
|
+
import { createContext as createContext19, useContext as useContext25, useMemo as useMemo23 } from "react";
|
|
871
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
865
872
|
import {
|
|
866
873
|
forwardRef as forwardRef5,
|
|
867
|
-
useContext as
|
|
868
|
-
useEffect as
|
|
874
|
+
useContext as useContext27,
|
|
875
|
+
useEffect as useEffect13,
|
|
869
876
|
useImperativeHandle as useImperativeHandle5,
|
|
870
877
|
useLayoutEffect as useLayoutEffect8,
|
|
871
|
-
useMemo as
|
|
872
|
-
useRef as
|
|
878
|
+
useMemo as useMemo25,
|
|
879
|
+
useRef as useRef16
|
|
873
880
|
} from "react";
|
|
874
|
-
import { jsx as
|
|
875
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
876
|
-
import { Suspense, useContext as useContext28, useEffect as useEffect13 } from "react";
|
|
877
|
-
import { createPortal } from "react-dom";
|
|
878
|
-
import { createContext as createContext19, useContext as useContext27, useEffect as useEffect12, useMemo as useMemo24 } from "react";
|
|
879
|
-
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
880
|
-
import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
881
|
-
import React20, { useMemo as useMemo25, useRef as useRef16 } from "react";
|
|
881
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
882
882
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
883
883
|
import { forwardRef as forwardRef7, useCallback as useCallback12, useState as useState14 } from "react";
|
|
884
884
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
885
885
|
import {
|
|
886
|
-
forwardRef as forwardRef8,
|
|
887
886
|
useCallback as useCallback13,
|
|
888
|
-
useContext as
|
|
887
|
+
useContext as useContext30,
|
|
889
888
|
useImperativeHandle as useImperativeHandle6,
|
|
890
889
|
useLayoutEffect as useLayoutEffect9,
|
|
891
890
|
useRef as useRef17,
|
|
892
|
-
useState as
|
|
891
|
+
useState as useState16
|
|
893
892
|
} from "react";
|
|
893
|
+
import React23, { forwardRef as forwardRef8, useMemo as useMemo27 } from "react";
|
|
894
|
+
import { useContext as useContext29, useMemo as useMemo26, useState as useState15 } from "react";
|
|
894
895
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
895
896
|
import { createRef as createRef3 } from "react";
|
|
896
|
-
import
|
|
897
|
+
import React25 from "react";
|
|
897
898
|
import {
|
|
898
899
|
useCallback as useCallback14,
|
|
899
900
|
useImperativeHandle as useImperativeHandle7,
|
|
900
|
-
useMemo as
|
|
901
|
+
useMemo as useMemo28,
|
|
901
902
|
useRef as useRef18,
|
|
902
|
-
useState as
|
|
903
|
+
useState as useState17
|
|
903
904
|
} from "react";
|
|
904
905
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
905
|
-
import
|
|
906
|
-
import { useMemo as
|
|
907
|
-
import { createContext as createContext20, useContext as
|
|
906
|
+
import React26 from "react";
|
|
907
|
+
import { useMemo as useMemo30 } from "react";
|
|
908
|
+
import { createContext as createContext20, useContext as useContext31, useMemo as useMemo29 } from "react";
|
|
908
909
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
909
910
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
910
|
-
import
|
|
911
|
-
import
|
|
912
|
-
import { useContext as useContext31, useMemo as useMemo29, useState as useState17 } from "react";
|
|
911
|
+
import React28 from "react";
|
|
912
|
+
import React29, { createContext as createContext21 } from "react";
|
|
913
913
|
import { useContext as useContext32 } from "react";
|
|
914
914
|
import { useCallback as useCallback16 } from "react";
|
|
915
915
|
import {
|
|
@@ -917,34 +917,33 @@ import {
|
|
|
917
917
|
useContext as useContext33,
|
|
918
918
|
useEffect as useEffect14,
|
|
919
919
|
useLayoutEffect as useLayoutEffect10,
|
|
920
|
-
useMemo as
|
|
920
|
+
useMemo as useMemo31,
|
|
921
921
|
useState as useState18
|
|
922
922
|
} from "react";
|
|
923
923
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
924
|
-
import
|
|
924
|
+
import React31, {
|
|
925
925
|
forwardRef as forwardRef9,
|
|
926
926
|
useContext as useContext34,
|
|
927
927
|
useEffect as useEffect16,
|
|
928
928
|
useImperativeHandle as useImperativeHandle8,
|
|
929
|
-
useMemo as
|
|
929
|
+
useMemo as useMemo32,
|
|
930
930
|
useRef as useRef19,
|
|
931
931
|
useState as useState19
|
|
932
932
|
} from "react";
|
|
933
933
|
import { useEffect as useEffect15 } from "react";
|
|
934
934
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
935
935
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
936
|
-
import React32, { forwardRef as forwardRef10, useMemo as useMemo32 } from "react";
|
|
937
936
|
import React33, { useMemo as useMemo33 } from "react";
|
|
938
937
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
939
|
-
import { Children, forwardRef as
|
|
938
|
+
import { Children, forwardRef as forwardRef10, useMemo as useMemo34 } from "react";
|
|
940
939
|
import React34 from "react";
|
|
941
940
|
import React35, { createContext as createContext22 } from "react";
|
|
942
941
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
943
942
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
944
943
|
import React37 from "react";
|
|
945
|
-
import { forwardRef as
|
|
944
|
+
import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext36 } from "react";
|
|
946
945
|
import {
|
|
947
|
-
forwardRef as
|
|
946
|
+
forwardRef as forwardRef11,
|
|
948
947
|
useContext as useContext35,
|
|
949
948
|
useEffect as useEffect17,
|
|
950
949
|
useImperativeHandle as useImperativeHandle9,
|
|
@@ -979,53 +978,171 @@ if (typeof createContext !== "function") {
|
|
|
979
978
|
throw new Error(err.join(`
|
|
980
979
|
`));
|
|
981
980
|
}
|
|
982
|
-
var
|
|
983
|
-
var
|
|
984
|
-
|
|
985
|
-
componentsToAddStacksTo.push(component);
|
|
986
|
-
};
|
|
987
|
-
var IsPlayerContext = createContext2(false);
|
|
988
|
-
var IsPlayerContextProvider = ({
|
|
989
|
-
children
|
|
990
|
-
}) => {
|
|
991
|
-
return /* @__PURE__ */ jsx2(IsPlayerContext.Provider, {
|
|
981
|
+
var CanUseRemotionHooks = createContext2(false);
|
|
982
|
+
var CanUseRemotionHooksProvider = ({ children }) => {
|
|
983
|
+
return /* @__PURE__ */ jsx2(CanUseRemotionHooks.Provider, {
|
|
992
984
|
value: true,
|
|
993
985
|
children
|
|
994
986
|
});
|
|
995
987
|
};
|
|
996
|
-
var
|
|
997
|
-
|
|
988
|
+
var CompositionManager = createContext3({
|
|
989
|
+
compositions: [],
|
|
990
|
+
folders: [],
|
|
991
|
+
currentCompositionMetadata: null,
|
|
992
|
+
canvasContent: null
|
|
993
|
+
});
|
|
994
|
+
var CompositionSetters = createContext3({
|
|
995
|
+
registerComposition: () => {
|
|
996
|
+
return;
|
|
997
|
+
},
|
|
998
|
+
unregisterComposition: () => {
|
|
999
|
+
return;
|
|
1000
|
+
},
|
|
1001
|
+
registerFolder: () => {
|
|
1002
|
+
return;
|
|
1003
|
+
},
|
|
1004
|
+
unregisterFolder: () => {
|
|
1005
|
+
return;
|
|
1006
|
+
},
|
|
1007
|
+
setCanvasContent: () => {
|
|
1008
|
+
return;
|
|
1009
|
+
},
|
|
1010
|
+
onlyRenderComposition: null
|
|
1011
|
+
});
|
|
1012
|
+
var NonceContext = createContext4({
|
|
1013
|
+
getNonce: () => 0
|
|
1014
|
+
});
|
|
1015
|
+
var fastRefreshNonce = 0;
|
|
1016
|
+
try {
|
|
1017
|
+
if (typeof __webpack_module__ !== "undefined") {
|
|
1018
|
+
if (__webpack_module__.hot) {
|
|
1019
|
+
__webpack_module__.hot.addStatusHandler((status) => {
|
|
1020
|
+
if (status === "idle") {
|
|
1021
|
+
fastRefreshNonce++;
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
} catch {}
|
|
1027
|
+
var useNonce = () => {
|
|
1028
|
+
const context = useContext(NonceContext);
|
|
1029
|
+
const nonce = context.getNonce();
|
|
1030
|
+
const nonceRef = useRef(nonce);
|
|
1031
|
+
nonceRef.current = nonce;
|
|
1032
|
+
const history = useRef([[fastRefreshNonce, nonce]]);
|
|
1033
|
+
const get = useCallback(() => {
|
|
1034
|
+
if (fastRefreshNonce !== history.current[history.current.length - 1][0]) {
|
|
1035
|
+
history.current = [
|
|
1036
|
+
...history.current,
|
|
1037
|
+
[fastRefreshNonce, nonceRef.current]
|
|
1038
|
+
];
|
|
1039
|
+
}
|
|
1040
|
+
return history.current;
|
|
1041
|
+
}, [history]);
|
|
1042
|
+
return useMemo(() => {
|
|
1043
|
+
return { get };
|
|
1044
|
+
}, [get]);
|
|
998
1045
|
};
|
|
999
1046
|
function truthy(value) {
|
|
1000
1047
|
return Boolean(value);
|
|
1001
1048
|
}
|
|
1002
|
-
var
|
|
1003
|
-
var
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1049
|
+
var getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
1050
|
+
var invalidFolderNameErrorMessage = `Folder name must match ${String(getRegex())}`;
|
|
1051
|
+
var FolderContext = createContext5({
|
|
1052
|
+
folderName: null,
|
|
1053
|
+
parentName: null
|
|
1054
|
+
});
|
|
1055
|
+
function getNodeEnvString() {
|
|
1056
|
+
return ["NOD", "E_EN", "V"].join("");
|
|
1057
|
+
}
|
|
1058
|
+
var getEnvString = () => {
|
|
1059
|
+
return ["e", "nv"].join("");
|
|
1060
|
+
};
|
|
1061
|
+
var getRemotionEnvironment = () => {
|
|
1062
|
+
const isPlayer = typeof window !== "undefined" && window.remotion_isPlayer;
|
|
1063
|
+
const isRendering = typeof window !== "undefined" && typeof window.process !== "undefined" && typeof window.process.env !== "undefined" && (window.process[getEnvString()][getNodeEnvString()] === "test" || window.process[getEnvString()][getNodeEnvString()] === "production" && typeof window !== "undefined" && typeof window.remotion_puppeteerTimeout !== "undefined");
|
|
1064
|
+
const isStudio = typeof window !== "undefined" && window.remotion_isStudio;
|
|
1065
|
+
const isReadOnlyStudio = typeof window !== "undefined" && window.remotion_isReadOnlyStudio;
|
|
1066
|
+
return {
|
|
1067
|
+
isStudio,
|
|
1068
|
+
isRendering,
|
|
1069
|
+
isPlayer,
|
|
1070
|
+
isReadOnlyStudio,
|
|
1071
|
+
isClientSideRendering: false
|
|
1012
1072
|
};
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1073
|
+
};
|
|
1074
|
+
var DATE_TOKEN = "remotion-date:";
|
|
1075
|
+
var FILE_TOKEN = "remotion-file:";
|
|
1076
|
+
var serializeJSONWithSpecialTypes = ({
|
|
1077
|
+
data,
|
|
1078
|
+
indent,
|
|
1079
|
+
staticBase
|
|
1080
|
+
}) => {
|
|
1081
|
+
let customDateUsed = false;
|
|
1082
|
+
let customFileUsed = false;
|
|
1083
|
+
let mapUsed = false;
|
|
1084
|
+
let setUsed = false;
|
|
1085
|
+
try {
|
|
1086
|
+
const serializedString = JSON.stringify(data, function(key, value) {
|
|
1087
|
+
const item = this[key];
|
|
1088
|
+
if (item instanceof Date) {
|
|
1089
|
+
customDateUsed = true;
|
|
1090
|
+
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
1091
|
+
}
|
|
1092
|
+
if (item instanceof Map) {
|
|
1093
|
+
mapUsed = true;
|
|
1094
|
+
return value;
|
|
1095
|
+
}
|
|
1096
|
+
if (item instanceof Set) {
|
|
1097
|
+
setUsed = true;
|
|
1098
|
+
return value;
|
|
1099
|
+
}
|
|
1100
|
+
if (typeof item === "string" && staticBase !== null && item.startsWith(staticBase)) {
|
|
1101
|
+
customFileUsed = true;
|
|
1102
|
+
return `${FILE_TOKEN}${item.replace(staticBase + "/", "")}`;
|
|
1103
|
+
}
|
|
1104
|
+
return value;
|
|
1105
|
+
}, indent);
|
|
1106
|
+
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
1107
|
+
} catch (err) {
|
|
1108
|
+
throw new Error("Could not serialize the passed input props to JSON: " + err.message);
|
|
1109
|
+
}
|
|
1110
|
+
};
|
|
1111
|
+
var deserializeJSONWithSpecialTypes = (data) => {
|
|
1112
|
+
return JSON.parse(data, (_, value) => {
|
|
1113
|
+
if (typeof value === "string" && value.startsWith(DATE_TOKEN)) {
|
|
1114
|
+
return new Date(value.replace(DATE_TOKEN, ""));
|
|
1017
1115
|
}
|
|
1018
|
-
if (typeof
|
|
1019
|
-
|
|
1020
|
-
return;
|
|
1116
|
+
if (typeof value === "string" && value.startsWith(FILE_TOKEN)) {
|
|
1117
|
+
return `${window.remotion_staticBase}/${value.replace(FILE_TOKEN, "")}`;
|
|
1021
1118
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1119
|
+
return value;
|
|
1120
|
+
});
|
|
1121
|
+
};
|
|
1122
|
+
var serializeThenDeserialize = (props) => {
|
|
1123
|
+
return deserializeJSONWithSpecialTypes(serializeJSONWithSpecialTypes({
|
|
1124
|
+
data: props,
|
|
1125
|
+
indent: 2,
|
|
1126
|
+
staticBase: window.remotion_staticBase
|
|
1127
|
+
}).serializedString);
|
|
1128
|
+
};
|
|
1129
|
+
var serializeThenDeserializeInStudio = (props) => {
|
|
1130
|
+
if (getRemotionEnvironment().isStudio) {
|
|
1131
|
+
return serializeThenDeserialize(props);
|
|
1027
1132
|
}
|
|
1028
|
-
|
|
1133
|
+
return props;
|
|
1134
|
+
};
|
|
1135
|
+
var IsPlayerContext = createContext6(false);
|
|
1136
|
+
var IsPlayerContextProvider = ({
|
|
1137
|
+
children
|
|
1138
|
+
}) => {
|
|
1139
|
+
return /* @__PURE__ */ jsx3(IsPlayerContext.Provider, {
|
|
1140
|
+
value: true,
|
|
1141
|
+
children
|
|
1142
|
+
});
|
|
1143
|
+
};
|
|
1144
|
+
var useIsPlayer = () => {
|
|
1145
|
+
return useContext3(IsPlayerContext);
|
|
1029
1146
|
};
|
|
1030
1147
|
var hasTailwindClassName = ({
|
|
1031
1148
|
className,
|
|
@@ -1049,7 +1166,7 @@ var hasTailwindClassName = ({
|
|
|
1049
1166
|
};
|
|
1050
1167
|
var AbsoluteFillRefForwarding = (props, ref) => {
|
|
1051
1168
|
const { style, ...other } = props;
|
|
1052
|
-
const actualStyle =
|
|
1169
|
+
const actualStyle = useMemo3(() => {
|
|
1053
1170
|
return {
|
|
1054
1171
|
position: "absolute",
|
|
1055
1172
|
top: hasTailwindClassName({
|
|
@@ -1112,56 +1229,309 @@ var AbsoluteFillRefForwarding = (props, ref) => {
|
|
|
1112
1229
|
...style
|
|
1113
1230
|
};
|
|
1114
1231
|
}, [other.className, style]);
|
|
1115
|
-
return /* @__PURE__ */
|
|
1232
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
1116
1233
|
ref,
|
|
1117
1234
|
style: actualStyle,
|
|
1118
1235
|
...other
|
|
1119
1236
|
});
|
|
1120
1237
|
};
|
|
1121
1238
|
var AbsoluteFill = forwardRef(AbsoluteFillRefForwarding);
|
|
1122
|
-
var
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1239
|
+
var rotate = {
|
|
1240
|
+
transform: `rotate(90deg)`
|
|
1241
|
+
};
|
|
1242
|
+
var ICON_SIZE = 40;
|
|
1243
|
+
var label = {
|
|
1244
|
+
color: "white",
|
|
1245
|
+
fontSize: 14,
|
|
1246
|
+
fontFamily: "sans-serif"
|
|
1247
|
+
};
|
|
1248
|
+
var container = {
|
|
1249
|
+
justifyContent: "center",
|
|
1250
|
+
alignItems: "center"
|
|
1251
|
+
};
|
|
1252
|
+
var Loading = () => {
|
|
1253
|
+
return /* @__PURE__ */ jsxs2(AbsoluteFill, {
|
|
1254
|
+
style: container,
|
|
1255
|
+
id: "remotion-comp-loading",
|
|
1256
|
+
children: [
|
|
1257
|
+
/* @__PURE__ */ jsx5("style", {
|
|
1258
|
+
type: "text/css",
|
|
1259
|
+
children: `
|
|
1260
|
+
@keyframes anim {
|
|
1261
|
+
from {
|
|
1262
|
+
opacity: 0
|
|
1263
|
+
}
|
|
1264
|
+
to {
|
|
1265
|
+
opacity: 1
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
#remotion-comp-loading {
|
|
1269
|
+
animation: anim 2s;
|
|
1270
|
+
animation-fill-mode: forwards;
|
|
1271
|
+
}
|
|
1272
|
+
`
|
|
1273
|
+
}),
|
|
1274
|
+
/* @__PURE__ */ jsx5("svg", {
|
|
1275
|
+
width: ICON_SIZE,
|
|
1276
|
+
height: ICON_SIZE,
|
|
1277
|
+
viewBox: "-100 -100 400 400",
|
|
1278
|
+
style: rotate,
|
|
1279
|
+
children: /* @__PURE__ */ jsx5("path", {
|
|
1280
|
+
fill: "#555",
|
|
1281
|
+
stroke: "#555",
|
|
1282
|
+
strokeWidth: "100",
|
|
1283
|
+
strokeLinejoin: "round",
|
|
1284
|
+
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"
|
|
1285
|
+
})
|
|
1286
|
+
}),
|
|
1287
|
+
/* @__PURE__ */ jsxs2("p", {
|
|
1288
|
+
style: label,
|
|
1289
|
+
children: [
|
|
1290
|
+
"Resolving ",
|
|
1291
|
+
"<Suspense>",
|
|
1292
|
+
"..."
|
|
1293
|
+
]
|
|
1294
|
+
})
|
|
1295
|
+
]
|
|
1296
|
+
});
|
|
1297
|
+
};
|
|
1298
|
+
var _portalNode = null;
|
|
1299
|
+
var portalNode = () => {
|
|
1300
|
+
if (!_portalNode) {
|
|
1301
|
+
if (typeof document === "undefined") {
|
|
1302
|
+
throw new Error("Tried to call an API that only works in the browser from outside the browser");
|
|
1303
|
+
}
|
|
1304
|
+
_portalNode = document.createElement("div");
|
|
1305
|
+
_portalNode.style.position = "absolute";
|
|
1306
|
+
_portalNode.style.top = "0px";
|
|
1307
|
+
_portalNode.style.left = "0px";
|
|
1308
|
+
_portalNode.style.right = "0px";
|
|
1309
|
+
_portalNode.style.bottom = "0px";
|
|
1310
|
+
_portalNode.style.width = "100%";
|
|
1311
|
+
_portalNode.style.height = "100%";
|
|
1312
|
+
_portalNode.style.display = "flex";
|
|
1313
|
+
_portalNode.style.flexDirection = "column";
|
|
1314
|
+
const containerNode = document.createElement("div");
|
|
1315
|
+
containerNode.style.position = "fixed";
|
|
1316
|
+
containerNode.style.top = -999999 + "px";
|
|
1317
|
+
containerNode.appendChild(_portalNode);
|
|
1318
|
+
document.body.appendChild(containerNode);
|
|
1319
|
+
}
|
|
1320
|
+
return _portalNode;
|
|
1321
|
+
};
|
|
1322
|
+
var getKey = () => {
|
|
1323
|
+
return `remotion_inputPropsOverride` + window.location.origin;
|
|
1324
|
+
};
|
|
1325
|
+
var getInputPropsOverride = () => {
|
|
1326
|
+
if (typeof localStorage === "undefined")
|
|
1327
|
+
return null;
|
|
1328
|
+
const override = localStorage.getItem(getKey());
|
|
1329
|
+
if (!override)
|
|
1330
|
+
return null;
|
|
1331
|
+
return JSON.parse(override);
|
|
1332
|
+
};
|
|
1333
|
+
var setInputPropsOverride = (override) => {
|
|
1334
|
+
if (typeof localStorage === "undefined")
|
|
1335
|
+
return;
|
|
1336
|
+
if (override === null) {
|
|
1337
|
+
localStorage.removeItem(getKey());
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
1341
|
+
};
|
|
1342
|
+
var didWarnSSRImport = false;
|
|
1343
|
+
var warnOnceSSRImport = () => {
|
|
1344
|
+
if (didWarnSSRImport) {
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
didWarnSSRImport = true;
|
|
1348
|
+
console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.");
|
|
1349
|
+
console.warn("To hide this warning, don't call this function on the server:");
|
|
1350
|
+
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
1351
|
+
};
|
|
1352
|
+
var getInputProps = () => {
|
|
1353
|
+
if (typeof window === "undefined") {
|
|
1354
|
+
warnOnceSSRImport();
|
|
1355
|
+
return {};
|
|
1356
|
+
}
|
|
1357
|
+
if (getRemotionEnvironment().isPlayer) {
|
|
1358
|
+
throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");
|
|
1359
|
+
}
|
|
1360
|
+
const override = getInputPropsOverride();
|
|
1361
|
+
if (override) {
|
|
1362
|
+
return override;
|
|
1363
|
+
}
|
|
1364
|
+
if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
|
|
1365
|
+
throw new Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");
|
|
1366
|
+
}
|
|
1367
|
+
const param = window.remotion_inputProps;
|
|
1368
|
+
if (!param) {
|
|
1369
|
+
return {};
|
|
1370
|
+
}
|
|
1371
|
+
const parsed = deserializeJSONWithSpecialTypes(param);
|
|
1372
|
+
return parsed;
|
|
1373
|
+
};
|
|
1374
|
+
var EditorPropsContext = createContext7({
|
|
1375
|
+
props: {},
|
|
1376
|
+
updateProps: () => {
|
|
1377
|
+
throw new Error("Not implemented");
|
|
1378
|
+
}
|
|
1133
1379
|
});
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1380
|
+
var timeValueRef = React3.createRef();
|
|
1381
|
+
var EditorPropsProvider = ({ children }) => {
|
|
1382
|
+
const [props, setProps] = React3.useState({});
|
|
1383
|
+
const updateProps = useCallback2(({
|
|
1384
|
+
defaultProps,
|
|
1385
|
+
id,
|
|
1386
|
+
newProps
|
|
1387
|
+
}) => {
|
|
1388
|
+
setProps((prev) => {
|
|
1389
|
+
return {
|
|
1390
|
+
...prev,
|
|
1391
|
+
[id]: typeof newProps === "function" ? newProps(prev[id] ?? defaultProps) : newProps
|
|
1392
|
+
};
|
|
1393
|
+
});
|
|
1394
|
+
}, []);
|
|
1395
|
+
const ctx = useMemo4(() => {
|
|
1396
|
+
return { props, updateProps };
|
|
1397
|
+
}, [props, updateProps]);
|
|
1398
|
+
return /* @__PURE__ */ jsx6(EditorPropsContext.Provider, {
|
|
1399
|
+
value: ctx,
|
|
1400
|
+
children
|
|
1401
|
+
});
|
|
1402
|
+
};
|
|
1403
|
+
var RemotionEnvironmentContext = React4.createContext(null);
|
|
1404
|
+
var useRemotionEnvironment = () => {
|
|
1405
|
+
const context = useContext4(RemotionEnvironmentContext);
|
|
1406
|
+
const [env] = useState(() => getRemotionEnvironment());
|
|
1407
|
+
return context ?? env;
|
|
1408
|
+
};
|
|
1409
|
+
function validateDimension(amount, nameOfProp, location) {
|
|
1410
|
+
if (typeof amount !== "number") {
|
|
1411
|
+
throw new Error(`The "${nameOfProp}" prop ${location} must be a number, but you passed a value of type ${typeof amount}`);
|
|
1412
|
+
}
|
|
1413
|
+
if (isNaN(amount)) {
|
|
1414
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must not be NaN, but is NaN.`);
|
|
1415
|
+
}
|
|
1416
|
+
if (!Number.isFinite(amount)) {
|
|
1417
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be finite, but is ${amount}.`);
|
|
1418
|
+
}
|
|
1419
|
+
if (amount % 1 !== 0) {
|
|
1420
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be an integer, but is ${amount}.`);
|
|
1421
|
+
}
|
|
1422
|
+
if (amount <= 0) {
|
|
1423
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be positive, but got ${amount}.`);
|
|
1424
|
+
}
|
|
1139
1425
|
}
|
|
1140
|
-
function
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1426
|
+
function validateDurationInFrames(durationInFrames, options) {
|
|
1427
|
+
const { allowFloats, component } = options;
|
|
1428
|
+
if (typeof durationInFrames === "undefined") {
|
|
1429
|
+
throw new Error(`The "durationInFrames" prop ${component} is missing.`);
|
|
1430
|
+
}
|
|
1431
|
+
if (typeof durationInFrames !== "number") {
|
|
1432
|
+
throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
|
|
1433
|
+
}
|
|
1434
|
+
if (durationInFrames <= 0) {
|
|
1435
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
1436
|
+
}
|
|
1437
|
+
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
1438
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
1439
|
+
}
|
|
1440
|
+
if (!Number.isFinite(durationInFrames)) {
|
|
1441
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
1148
1442
|
}
|
|
1149
|
-
return hash;
|
|
1150
1443
|
}
|
|
1151
|
-
|
|
1152
|
-
if (
|
|
1153
|
-
throw new
|
|
1444
|
+
function validateFps(fps, location, isGif) {
|
|
1445
|
+
if (typeof fps !== "number") {
|
|
1446
|
+
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
1154
1447
|
}
|
|
1155
|
-
if (
|
|
1156
|
-
|
|
1448
|
+
if (!Number.isFinite(fps)) {
|
|
1449
|
+
throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
|
|
1157
1450
|
}
|
|
1158
|
-
if (
|
|
1159
|
-
|
|
1451
|
+
if (isNaN(fps)) {
|
|
1452
|
+
throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
|
|
1160
1453
|
}
|
|
1161
|
-
if (
|
|
1162
|
-
|
|
1454
|
+
if (fps <= 0) {
|
|
1455
|
+
throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
|
|
1163
1456
|
}
|
|
1164
|
-
|
|
1457
|
+
if (isGif && fps > 50) {
|
|
1458
|
+
throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
var ResolveCompositionContext = createContext8(null);
|
|
1462
|
+
var resolveCompositionsRef = createRef();
|
|
1463
|
+
var needsResolution = (composition) => {
|
|
1464
|
+
return Boolean(composition.calculateMetadata);
|
|
1465
|
+
};
|
|
1466
|
+
var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
1467
|
+
const context = useContext5(ResolveCompositionContext);
|
|
1468
|
+
const { props: allEditorProps } = useContext5(EditorPropsContext);
|
|
1469
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext5(CompositionManager);
|
|
1470
|
+
const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
1471
|
+
const compositionId = preferredCompositionId ?? currentComposition;
|
|
1472
|
+
const composition = compositions.find((c) => c.id === compositionId);
|
|
1473
|
+
const selectedEditorProps = useMemo5(() => {
|
|
1474
|
+
return composition ? allEditorProps[composition.id] ?? {} : {};
|
|
1475
|
+
}, [allEditorProps, composition]);
|
|
1476
|
+
const env = useRemotionEnvironment();
|
|
1477
|
+
return useMemo5(() => {
|
|
1478
|
+
if (!composition) {
|
|
1479
|
+
return null;
|
|
1480
|
+
}
|
|
1481
|
+
if (currentCompositionMetadata) {
|
|
1482
|
+
return {
|
|
1483
|
+
type: "success",
|
|
1484
|
+
result: {
|
|
1485
|
+
...currentCompositionMetadata,
|
|
1486
|
+
id: composition.id,
|
|
1487
|
+
defaultProps: composition.defaultProps ?? {}
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
if (!needsResolution(composition)) {
|
|
1492
|
+
validateDurationInFrames(composition.durationInFrames, {
|
|
1493
|
+
allowFloats: false,
|
|
1494
|
+
component: `in <Composition id="${composition.id}">`
|
|
1495
|
+
});
|
|
1496
|
+
validateFps(composition.fps, `in <Composition id="${composition.id}">`, false);
|
|
1497
|
+
validateDimension(composition.width, "width", `in <Composition id="${composition.id}">`);
|
|
1498
|
+
validateDimension(composition.height, "height", `in <Composition id="${composition.id}">`);
|
|
1499
|
+
return {
|
|
1500
|
+
type: "success",
|
|
1501
|
+
result: {
|
|
1502
|
+
width: composition.width,
|
|
1503
|
+
height: composition.height,
|
|
1504
|
+
fps: composition.fps,
|
|
1505
|
+
id: composition.id,
|
|
1506
|
+
durationInFrames: composition.durationInFrames,
|
|
1507
|
+
defaultProps: composition.defaultProps ?? {},
|
|
1508
|
+
props: {
|
|
1509
|
+
...composition.defaultProps ?? {},
|
|
1510
|
+
...selectedEditorProps ?? {},
|
|
1511
|
+
...typeof window === "undefined" || env.isPlayer || !window.remotion_inputProps ? {} : getInputProps() ?? {}
|
|
1512
|
+
},
|
|
1513
|
+
defaultCodec: null,
|
|
1514
|
+
defaultOutName: null,
|
|
1515
|
+
defaultVideoImageFormat: null,
|
|
1516
|
+
defaultPixelFormat: null,
|
|
1517
|
+
defaultProResProfile: null
|
|
1518
|
+
}
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
if (!context) {
|
|
1522
|
+
return null;
|
|
1523
|
+
}
|
|
1524
|
+
if (!context[composition.id]) {
|
|
1525
|
+
return null;
|
|
1526
|
+
}
|
|
1527
|
+
return context[composition.id];
|
|
1528
|
+
}, [
|
|
1529
|
+
composition,
|
|
1530
|
+
context,
|
|
1531
|
+
currentCompositionMetadata,
|
|
1532
|
+
selectedEditorProps,
|
|
1533
|
+
env.isPlayer
|
|
1534
|
+
]);
|
|
1165
1535
|
};
|
|
1166
1536
|
var getErrorStackWithMessage = (error) => {
|
|
1167
1537
|
const stack = error.stack ?? "";
|
|
@@ -1212,25 +1582,6 @@ function cancelRenderInternal(scope, err) {
|
|
|
1212
1582
|
function cancelRender(err) {
|
|
1213
1583
|
return cancelRenderInternal(typeof window !== "undefined" ? window : undefined, err);
|
|
1214
1584
|
}
|
|
1215
|
-
function getNodeEnvString() {
|
|
1216
|
-
return ["NOD", "E_EN", "V"].join("");
|
|
1217
|
-
}
|
|
1218
|
-
var getEnvString = () => {
|
|
1219
|
-
return ["e", "nv"].join("");
|
|
1220
|
-
};
|
|
1221
|
-
var getRemotionEnvironment = () => {
|
|
1222
|
-
const isPlayer = typeof window !== "undefined" && window.remotion_isPlayer;
|
|
1223
|
-
const isRendering = typeof window !== "undefined" && typeof window.process !== "undefined" && typeof window.process.env !== "undefined" && (window.process[getEnvString()][getNodeEnvString()] === "test" || window.process[getEnvString()][getNodeEnvString()] === "production" && typeof window !== "undefined" && typeof window.remotion_puppeteerTimeout !== "undefined");
|
|
1224
|
-
const isStudio = typeof window !== "undefined" && window.remotion_isStudio;
|
|
1225
|
-
const isReadOnlyStudio = typeof window !== "undefined" && window.remotion_isReadOnlyStudio;
|
|
1226
|
-
return {
|
|
1227
|
-
isStudio,
|
|
1228
|
-
isRendering,
|
|
1229
|
-
isPlayer,
|
|
1230
|
-
isReadOnlyStudio,
|
|
1231
|
-
isClientSideRendering: false
|
|
1232
|
-
};
|
|
1233
|
-
};
|
|
1234
1585
|
var logLevels = ["trace", "verbose", "info", "warn", "error"];
|
|
1235
1586
|
var getNumberForLogLevel = (level) => {
|
|
1236
1587
|
return logLevels.indexOf(level);
|
|
@@ -1297,11 +1648,11 @@ var defaultTimeout = 30000;
|
|
|
1297
1648
|
var delayRenderInternal = ({
|
|
1298
1649
|
scope,
|
|
1299
1650
|
environment,
|
|
1300
|
-
label,
|
|
1651
|
+
label: label2,
|
|
1301
1652
|
options
|
|
1302
1653
|
}) => {
|
|
1303
|
-
if (typeof
|
|
1304
|
-
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(
|
|
1654
|
+
if (typeof label2 !== "string" && label2 !== null) {
|
|
1655
|
+
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label2));
|
|
1305
1656
|
}
|
|
1306
1657
|
const handle = Math.random();
|
|
1307
1658
|
scope.remotion_delayRenderHandles.push(handle);
|
|
@@ -1310,12 +1661,12 @@ var delayRenderInternal = ({
|
|
|
1310
1661
|
const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
|
|
1311
1662
|
const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
|
|
1312
1663
|
scope.remotion_delayRenderTimeouts[handle] = {
|
|
1313
|
-
label:
|
|
1664
|
+
label: label2 ?? null,
|
|
1314
1665
|
startTime: Date.now(),
|
|
1315
1666
|
timeout: setTimeout(() => {
|
|
1316
1667
|
const message = [
|
|
1317
1668
|
`A delayRender()`,
|
|
1318
|
-
|
|
1669
|
+
label2 ? `"${label2}"` : null,
|
|
1319
1670
|
`was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
|
|
1320
1671
|
retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
|
|
1321
1672
|
retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
|
|
@@ -1351,10 +1702,10 @@ var continueRenderInternal = ({
|
|
|
1351
1702
|
if (!scope.remotion_delayRenderTimeouts[handle]) {
|
|
1352
1703
|
return false;
|
|
1353
1704
|
}
|
|
1354
|
-
const { label, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
|
|
1705
|
+
const { label: label2, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
|
|
1355
1706
|
clearTimeout(timeout);
|
|
1356
1707
|
const message = [
|
|
1357
|
-
|
|
1708
|
+
label2 ? `"${label2}"` : "A handle",
|
|
1358
1709
|
DELAY_RENDER_CLEAR_TOKEN,
|
|
1359
1710
|
`${Date.now() - startTime}ms`
|
|
1360
1711
|
].filter(truthy).join(" ");
|
|
@@ -1369,47 +1720,41 @@ var continueRenderInternal = ({
|
|
|
1369
1720
|
scope.remotion_renderReady = true;
|
|
1370
1721
|
}
|
|
1371
1722
|
};
|
|
1372
|
-
var LogLevelContext =
|
|
1723
|
+
var LogLevelContext = createContext9({
|
|
1373
1724
|
logLevel: "info",
|
|
1374
1725
|
mountTime: 0
|
|
1375
1726
|
});
|
|
1376
1727
|
var useLogLevel = () => {
|
|
1377
|
-
const { logLevel } =
|
|
1728
|
+
const { logLevel } = React5.useContext(LogLevelContext);
|
|
1378
1729
|
if (logLevel === null) {
|
|
1379
1730
|
throw new Error("useLogLevel must be used within a LogLevelProvider");
|
|
1380
1731
|
}
|
|
1381
1732
|
return logLevel;
|
|
1382
1733
|
};
|
|
1383
1734
|
var useMountTime = () => {
|
|
1384
|
-
const { mountTime } =
|
|
1735
|
+
const { mountTime } = React5.useContext(LogLevelContext);
|
|
1385
1736
|
if (mountTime === null) {
|
|
1386
1737
|
throw new Error("useMountTime must be used within a LogLevelProvider");
|
|
1387
1738
|
}
|
|
1388
1739
|
return mountTime;
|
|
1389
1740
|
};
|
|
1390
|
-
var
|
|
1391
|
-
var useRemotionEnvironment = () => {
|
|
1392
|
-
const context = useContext3(RemotionEnvironmentContext);
|
|
1393
|
-
const [env] = useState(() => getRemotionEnvironment());
|
|
1394
|
-
return context ?? env;
|
|
1395
|
-
};
|
|
1396
|
-
var DelayRenderContextType = createContext5(null);
|
|
1741
|
+
var DelayRenderContextType = createContext10(null);
|
|
1397
1742
|
var useDelayRender = () => {
|
|
1398
1743
|
const environment = useRemotionEnvironment();
|
|
1399
|
-
const scope =
|
|
1744
|
+
const scope = useContext7(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
|
|
1400
1745
|
const logLevel = useLogLevel();
|
|
1401
|
-
const delayRender2 =
|
|
1746
|
+
const delayRender2 = useCallback3((label2, options) => {
|
|
1402
1747
|
if (!scope) {
|
|
1403
1748
|
return Math.random();
|
|
1404
1749
|
}
|
|
1405
1750
|
return delayRenderInternal({
|
|
1406
1751
|
scope,
|
|
1407
1752
|
environment,
|
|
1408
|
-
label:
|
|
1753
|
+
label: label2 ?? null,
|
|
1409
1754
|
options: options ?? {}
|
|
1410
1755
|
});
|
|
1411
1756
|
}, [environment, scope]);
|
|
1412
|
-
const continueRender2 =
|
|
1757
|
+
const continueRender2 = useCallback3((handle) => {
|
|
1413
1758
|
if (!scope) {
|
|
1414
1759
|
return;
|
|
1415
1760
|
}
|
|
@@ -1420,12 +1765,291 @@ var useDelayRender = () => {
|
|
|
1420
1765
|
logLevel
|
|
1421
1766
|
});
|
|
1422
1767
|
}, [environment, logLevel, scope]);
|
|
1423
|
-
const cancelRender2 =
|
|
1768
|
+
const cancelRender2 = useCallback3((err) => {
|
|
1424
1769
|
return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
|
|
1425
1770
|
}, [scope]);
|
|
1426
1771
|
return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
|
|
1427
1772
|
};
|
|
1428
|
-
var
|
|
1773
|
+
var useLazyComponent = ({
|
|
1774
|
+
compProps,
|
|
1775
|
+
componentName,
|
|
1776
|
+
noSuspense
|
|
1777
|
+
}) => {
|
|
1778
|
+
const componentRef = useRef2(null);
|
|
1779
|
+
if ("component" in compProps) {
|
|
1780
|
+
componentRef.current = compProps.component;
|
|
1781
|
+
}
|
|
1782
|
+
const lazy = useMemo6(() => {
|
|
1783
|
+
if ("component" in compProps) {
|
|
1784
|
+
if (typeof document === "undefined" || noSuspense) {
|
|
1785
|
+
return compProps.component;
|
|
1786
|
+
}
|
|
1787
|
+
if (typeof compProps.component === "undefined") {
|
|
1788
|
+
throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
1789
|
+
}
|
|
1790
|
+
const Wrapper = (props) => {
|
|
1791
|
+
const Comp = componentRef.current;
|
|
1792
|
+
return React6.createElement(Comp, props);
|
|
1793
|
+
};
|
|
1794
|
+
return Wrapper;
|
|
1795
|
+
}
|
|
1796
|
+
if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
|
|
1797
|
+
if (typeof compProps.lazyComponent === "undefined") {
|
|
1798
|
+
throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
1799
|
+
}
|
|
1800
|
+
return React6.lazy(compProps.lazyComponent);
|
|
1801
|
+
}
|
|
1802
|
+
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
1803
|
+
}, [compProps.lazyComponent]);
|
|
1804
|
+
return lazy;
|
|
1805
|
+
};
|
|
1806
|
+
var useVideo = () => {
|
|
1807
|
+
const { canvasContent, compositions, currentCompositionMetadata } = useContext8(CompositionManager);
|
|
1808
|
+
const selected = compositions.find((c) => {
|
|
1809
|
+
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
1810
|
+
});
|
|
1811
|
+
const resolved = useResolvedVideoConfig(selected?.id ?? null);
|
|
1812
|
+
return useMemo7(() => {
|
|
1813
|
+
if (!resolved) {
|
|
1814
|
+
return null;
|
|
1815
|
+
}
|
|
1816
|
+
if (resolved.type === "error") {
|
|
1817
|
+
return null;
|
|
1818
|
+
}
|
|
1819
|
+
if (resolved.type === "loading") {
|
|
1820
|
+
return null;
|
|
1821
|
+
}
|
|
1822
|
+
if (!selected) {
|
|
1823
|
+
return null;
|
|
1824
|
+
}
|
|
1825
|
+
return {
|
|
1826
|
+
...resolved.result,
|
|
1827
|
+
defaultProps: selected.defaultProps ?? {},
|
|
1828
|
+
id: selected.id,
|
|
1829
|
+
...currentCompositionMetadata ?? {},
|
|
1830
|
+
component: selected.component
|
|
1831
|
+
};
|
|
1832
|
+
}, [currentCompositionMetadata, resolved, selected]);
|
|
1833
|
+
};
|
|
1834
|
+
var getRegex2 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
1835
|
+
var isCompositionIdValid = (id) => id.match(getRegex2());
|
|
1836
|
+
var validateCompositionId = (id) => {
|
|
1837
|
+
if (!isCompositionIdValid(id)) {
|
|
1838
|
+
throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`);
|
|
1839
|
+
}
|
|
1840
|
+
};
|
|
1841
|
+
var invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex2())}`;
|
|
1842
|
+
var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
1843
|
+
if (!defaultProps) {
|
|
1844
|
+
return;
|
|
1845
|
+
}
|
|
1846
|
+
if (typeof defaultProps !== "object") {
|
|
1847
|
+
throw new Error(`"${name}" must be an object, but you passed a value of type ${typeof defaultProps}`);
|
|
1848
|
+
}
|
|
1849
|
+
if (Array.isArray(defaultProps)) {
|
|
1850
|
+
throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
|
|
1851
|
+
}
|
|
1852
|
+
};
|
|
1853
|
+
var Fallback = () => {
|
|
1854
|
+
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
1855
|
+
useEffect2(() => {
|
|
1856
|
+
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
1857
|
+
return () => continueRender2(fallback);
|
|
1858
|
+
}, [continueRender2, delayRender2]);
|
|
1859
|
+
return null;
|
|
1860
|
+
};
|
|
1861
|
+
var InnerComposition = ({
|
|
1862
|
+
width,
|
|
1863
|
+
height,
|
|
1864
|
+
fps,
|
|
1865
|
+
durationInFrames,
|
|
1866
|
+
id,
|
|
1867
|
+
defaultProps,
|
|
1868
|
+
schema,
|
|
1869
|
+
...compProps
|
|
1870
|
+
}) => {
|
|
1871
|
+
const compManager = useContext9(CompositionSetters);
|
|
1872
|
+
const { registerComposition, unregisterComposition } = compManager;
|
|
1873
|
+
const video = useVideo();
|
|
1874
|
+
const lazy = useLazyComponent({
|
|
1875
|
+
compProps,
|
|
1876
|
+
componentName: "Composition",
|
|
1877
|
+
noSuspense: false
|
|
1878
|
+
});
|
|
1879
|
+
const nonce = useNonce();
|
|
1880
|
+
const isPlayer = useIsPlayer();
|
|
1881
|
+
const environment = useRemotionEnvironment();
|
|
1882
|
+
const canUseComposition = useContext9(CanUseRemotionHooks);
|
|
1883
|
+
if (typeof window !== "undefined") {
|
|
1884
|
+
window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
|
|
1885
|
+
}
|
|
1886
|
+
if (canUseComposition) {
|
|
1887
|
+
if (isPlayer) {
|
|
1888
|
+
throw new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
1889
|
+
}
|
|
1890
|
+
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
1891
|
+
}
|
|
1892
|
+
const { folderName, parentName } = useContext9(FolderContext);
|
|
1893
|
+
const stack = compProps.stack ?? null;
|
|
1894
|
+
useEffect2(() => {
|
|
1895
|
+
if (!id) {
|
|
1896
|
+
throw new Error("No id for composition passed.");
|
|
1897
|
+
}
|
|
1898
|
+
validateCompositionId(id);
|
|
1899
|
+
validateDefaultAndInputProps(defaultProps, "defaultProps", id);
|
|
1900
|
+
registerComposition({
|
|
1901
|
+
durationInFrames: durationInFrames ?? undefined,
|
|
1902
|
+
fps: fps ?? undefined,
|
|
1903
|
+
height: height ?? undefined,
|
|
1904
|
+
width: width ?? undefined,
|
|
1905
|
+
id,
|
|
1906
|
+
folderName,
|
|
1907
|
+
component: lazy,
|
|
1908
|
+
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
1909
|
+
nonce: nonce.get(),
|
|
1910
|
+
parentFolderName: parentName,
|
|
1911
|
+
schema: schema ?? null,
|
|
1912
|
+
calculateMetadata: compProps.calculateMetadata ?? null,
|
|
1913
|
+
stack
|
|
1914
|
+
});
|
|
1915
|
+
return () => {
|
|
1916
|
+
unregisterComposition(id);
|
|
1917
|
+
};
|
|
1918
|
+
}, [
|
|
1919
|
+
durationInFrames,
|
|
1920
|
+
fps,
|
|
1921
|
+
height,
|
|
1922
|
+
lazy,
|
|
1923
|
+
id,
|
|
1924
|
+
folderName,
|
|
1925
|
+
defaultProps,
|
|
1926
|
+
width,
|
|
1927
|
+
nonce,
|
|
1928
|
+
parentName,
|
|
1929
|
+
schema,
|
|
1930
|
+
compProps.calculateMetadata,
|
|
1931
|
+
stack,
|
|
1932
|
+
registerComposition,
|
|
1933
|
+
unregisterComposition
|
|
1934
|
+
]);
|
|
1935
|
+
const resolved = useResolvedVideoConfig(id);
|
|
1936
|
+
if (environment.isStudio && video && video.component === lazy && video.id === id) {
|
|
1937
|
+
const Comp = lazy;
|
|
1938
|
+
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
1939
|
+
return null;
|
|
1940
|
+
}
|
|
1941
|
+
return createPortal(/* @__PURE__ */ jsx7(CanUseRemotionHooksProvider, {
|
|
1942
|
+
children: /* @__PURE__ */ jsx7(Suspense, {
|
|
1943
|
+
fallback: /* @__PURE__ */ jsx7(Loading, {}),
|
|
1944
|
+
children: /* @__PURE__ */ jsx7(Comp, {
|
|
1945
|
+
...resolved.result.props ?? {}
|
|
1946
|
+
})
|
|
1947
|
+
})
|
|
1948
|
+
}), portalNode());
|
|
1949
|
+
}
|
|
1950
|
+
if (environment.isRendering && video && video.component === lazy && video.id === id) {
|
|
1951
|
+
const Comp = lazy;
|
|
1952
|
+
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
1953
|
+
return null;
|
|
1954
|
+
}
|
|
1955
|
+
return createPortal(/* @__PURE__ */ jsx7(CanUseRemotionHooksProvider, {
|
|
1956
|
+
children: /* @__PURE__ */ jsx7(Suspense, {
|
|
1957
|
+
fallback: /* @__PURE__ */ jsx7(Fallback, {}),
|
|
1958
|
+
children: /* @__PURE__ */ jsx7(Comp, {
|
|
1959
|
+
...resolved.result.props ?? {}
|
|
1960
|
+
})
|
|
1961
|
+
})
|
|
1962
|
+
}), portalNode());
|
|
1963
|
+
}
|
|
1964
|
+
return null;
|
|
1965
|
+
};
|
|
1966
|
+
var Composition = (props) => {
|
|
1967
|
+
const { onlyRenderComposition } = useContext9(CompositionSetters);
|
|
1968
|
+
if (onlyRenderComposition && onlyRenderComposition !== props.id) {
|
|
1969
|
+
return null;
|
|
1970
|
+
}
|
|
1971
|
+
return /* @__PURE__ */ jsx7(InnerComposition, {
|
|
1972
|
+
...props
|
|
1973
|
+
});
|
|
1974
|
+
};
|
|
1975
|
+
var componentsToAddStacksTo = [];
|
|
1976
|
+
var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
1977
|
+
var addSequenceStackTraces = (component) => {
|
|
1978
|
+
componentsToAddStacksTo.push(component);
|
|
1979
|
+
};
|
|
1980
|
+
var VERSION = "4.0.443";
|
|
1981
|
+
var checkMultipleRemotionVersions = () => {
|
|
1982
|
+
if (typeof globalThis === "undefined") {
|
|
1983
|
+
return;
|
|
1984
|
+
}
|
|
1985
|
+
const set = () => {
|
|
1986
|
+
globalThis.remotion_imported = VERSION;
|
|
1987
|
+
if (typeof window !== "undefined") {
|
|
1988
|
+
window.remotion_imported = VERSION;
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
1992
|
+
if (alreadyImported) {
|
|
1993
|
+
if (alreadyImported === VERSION) {
|
|
1994
|
+
return;
|
|
1995
|
+
}
|
|
1996
|
+
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
1997
|
+
set();
|
|
1998
|
+
return;
|
|
1999
|
+
}
|
|
2000
|
+
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
2001
|
+
VERSION,
|
|
2002
|
+
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
2003
|
+
].filter(truthy).join(" and ")}. This will cause things to break in an unexpected way.
|
|
2004
|
+
Check 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.`);
|
|
2005
|
+
}
|
|
2006
|
+
set();
|
|
2007
|
+
};
|
|
2008
|
+
var SequenceContext = createContext11(null);
|
|
2009
|
+
var exports_timeline_position_state = {};
|
|
2010
|
+
__export2(exports_timeline_position_state, {
|
|
2011
|
+
useTimelineSetFrame: () => useTimelineSetFrame,
|
|
2012
|
+
useTimelinePosition: () => useTimelinePosition,
|
|
2013
|
+
useTimelineContext: () => useTimelineContext,
|
|
2014
|
+
usePlayingState: () => usePlayingState,
|
|
2015
|
+
useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
|
|
2016
|
+
persistCurrentFrame: () => persistCurrentFrame,
|
|
2017
|
+
getInitialFrameState: () => getInitialFrameState,
|
|
2018
|
+
getFrameForComposition: () => getFrameForComposition
|
|
2019
|
+
});
|
|
2020
|
+
function mulberry32(a) {
|
|
2021
|
+
let t = a + 1831565813;
|
|
2022
|
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
2023
|
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
2024
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
2025
|
+
}
|
|
2026
|
+
function hashCode(str) {
|
|
2027
|
+
let i = 0;
|
|
2028
|
+
let chr = 0;
|
|
2029
|
+
let hash = 0;
|
|
2030
|
+
for (i = 0;i < str.length; i++) {
|
|
2031
|
+
chr = str.charCodeAt(i);
|
|
2032
|
+
hash = (hash << 5) - hash + chr;
|
|
2033
|
+
hash |= 0;
|
|
2034
|
+
}
|
|
2035
|
+
return hash;
|
|
2036
|
+
}
|
|
2037
|
+
var random = (seed, dummy) => {
|
|
2038
|
+
if (dummy !== undefined) {
|
|
2039
|
+
throw new TypeError("random() takes only one argument");
|
|
2040
|
+
}
|
|
2041
|
+
if (seed === null) {
|
|
2042
|
+
return Math.random();
|
|
2043
|
+
}
|
|
2044
|
+
if (typeof seed === "string") {
|
|
2045
|
+
return mulberry32(hashCode(seed));
|
|
2046
|
+
}
|
|
2047
|
+
if (typeof seed === "number") {
|
|
2048
|
+
return mulberry32(seed * 10000000000);
|
|
2049
|
+
}
|
|
2050
|
+
throw new Error("random() argument must be a number or a string");
|
|
2051
|
+
};
|
|
2052
|
+
var SetTimelineContext = createContext12({
|
|
1429
2053
|
setFrame: () => {
|
|
1430
2054
|
throw new Error("default");
|
|
1431
2055
|
},
|
|
@@ -1433,13 +2057,13 @@ var SetTimelineContext = createContext6({
|
|
|
1433
2057
|
throw new Error("default");
|
|
1434
2058
|
}
|
|
1435
2059
|
});
|
|
1436
|
-
var TimelineContext =
|
|
1437
|
-
var AbsoluteTimeContext =
|
|
2060
|
+
var TimelineContext = createContext12(null);
|
|
2061
|
+
var AbsoluteTimeContext = createContext12(null);
|
|
1438
2062
|
var TimelineContextProvider = ({ children, frameState }) => {
|
|
1439
2063
|
const [playing, setPlaying] = useState2(false);
|
|
1440
|
-
const imperativePlaying =
|
|
2064
|
+
const imperativePlaying = useRef3(false);
|
|
1441
2065
|
const [playbackRate, setPlaybackRate] = useState2(1);
|
|
1442
|
-
const audioAndVideoTags =
|
|
2066
|
+
const audioAndVideoTags = useRef3([]);
|
|
1443
2067
|
const [remotionRootId] = useState2(() => String(random(null)));
|
|
1444
2068
|
const [_frame, setFrame] = useState2(() => getInitialFrameState());
|
|
1445
2069
|
const frame = frameState ?? _frame;
|
|
@@ -1470,7 +2094,7 @@ var TimelineContextProvider = ({ children, frameState }) => {
|
|
|
1470
2094
|
window.remotion_isPlayer = false;
|
|
1471
2095
|
}, [continueRender2, delayRender2]);
|
|
1472
2096
|
}
|
|
1473
|
-
const timelineContextValue =
|
|
2097
|
+
const timelineContextValue = useMemo8(() => {
|
|
1474
2098
|
return {
|
|
1475
2099
|
frame,
|
|
1476
2100
|
playing,
|
|
@@ -1481,344 +2105,23 @@ var TimelineContextProvider = ({ children, frameState }) => {
|
|
|
1481
2105
|
audioAndVideoTags
|
|
1482
2106
|
};
|
|
1483
2107
|
}, [frame, playbackRate, playing, remotionRootId]);
|
|
1484
|
-
const setTimelineContextValue =
|
|
2108
|
+
const setTimelineContextValue = useMemo8(() => {
|
|
1485
2109
|
return {
|
|
1486
2110
|
setFrame,
|
|
1487
2111
|
setPlaying
|
|
1488
2112
|
};
|
|
1489
2113
|
}, []);
|
|
1490
|
-
return /* @__PURE__ */
|
|
2114
|
+
return /* @__PURE__ */ jsx8(AbsoluteTimeContext.Provider, {
|
|
1491
2115
|
value: timelineContextValue,
|
|
1492
|
-
children: /* @__PURE__ */
|
|
2116
|
+
children: /* @__PURE__ */ jsx8(TimelineContext.Provider, {
|
|
1493
2117
|
value: timelineContextValue,
|
|
1494
|
-
children: /* @__PURE__ */
|
|
2118
|
+
children: /* @__PURE__ */ jsx8(SetTimelineContext.Provider, {
|
|
1495
2119
|
value: setTimelineContextValue,
|
|
1496
2120
|
children
|
|
1497
2121
|
})
|
|
1498
2122
|
})
|
|
1499
2123
|
});
|
|
1500
2124
|
};
|
|
1501
|
-
var CompositionManager = createContext7({
|
|
1502
|
-
compositions: [],
|
|
1503
|
-
folders: [],
|
|
1504
|
-
currentCompositionMetadata: null,
|
|
1505
|
-
canvasContent: null
|
|
1506
|
-
});
|
|
1507
|
-
var CompositionSetters = createContext7({
|
|
1508
|
-
registerComposition: () => {
|
|
1509
|
-
return;
|
|
1510
|
-
},
|
|
1511
|
-
unregisterComposition: () => {
|
|
1512
|
-
return;
|
|
1513
|
-
},
|
|
1514
|
-
registerFolder: () => {
|
|
1515
|
-
return;
|
|
1516
|
-
},
|
|
1517
|
-
unregisterFolder: () => {
|
|
1518
|
-
return;
|
|
1519
|
-
},
|
|
1520
|
-
setCanvasContent: () => {
|
|
1521
|
-
return;
|
|
1522
|
-
},
|
|
1523
|
-
onlyRenderComposition: null
|
|
1524
|
-
});
|
|
1525
|
-
var getKey = () => {
|
|
1526
|
-
return `remotion_inputPropsOverride` + window.location.origin;
|
|
1527
|
-
};
|
|
1528
|
-
var getInputPropsOverride = () => {
|
|
1529
|
-
if (typeof localStorage === "undefined")
|
|
1530
|
-
return null;
|
|
1531
|
-
const override = localStorage.getItem(getKey());
|
|
1532
|
-
if (!override)
|
|
1533
|
-
return null;
|
|
1534
|
-
return JSON.parse(override);
|
|
1535
|
-
};
|
|
1536
|
-
var setInputPropsOverride = (override) => {
|
|
1537
|
-
if (typeof localStorage === "undefined")
|
|
1538
|
-
return;
|
|
1539
|
-
if (override === null) {
|
|
1540
|
-
localStorage.removeItem(getKey());
|
|
1541
|
-
return;
|
|
1542
|
-
}
|
|
1543
|
-
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
1544
|
-
};
|
|
1545
|
-
var DATE_TOKEN = "remotion-date:";
|
|
1546
|
-
var FILE_TOKEN = "remotion-file:";
|
|
1547
|
-
var serializeJSONWithSpecialTypes = ({
|
|
1548
|
-
data,
|
|
1549
|
-
indent,
|
|
1550
|
-
staticBase
|
|
1551
|
-
}) => {
|
|
1552
|
-
let customDateUsed = false;
|
|
1553
|
-
let customFileUsed = false;
|
|
1554
|
-
let mapUsed = false;
|
|
1555
|
-
let setUsed = false;
|
|
1556
|
-
try {
|
|
1557
|
-
const serializedString = JSON.stringify(data, function(key, value) {
|
|
1558
|
-
const item = this[key];
|
|
1559
|
-
if (item instanceof Date) {
|
|
1560
|
-
customDateUsed = true;
|
|
1561
|
-
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
1562
|
-
}
|
|
1563
|
-
if (item instanceof Map) {
|
|
1564
|
-
mapUsed = true;
|
|
1565
|
-
return value;
|
|
1566
|
-
}
|
|
1567
|
-
if (item instanceof Set) {
|
|
1568
|
-
setUsed = true;
|
|
1569
|
-
return value;
|
|
1570
|
-
}
|
|
1571
|
-
if (typeof item === "string" && staticBase !== null && item.startsWith(staticBase)) {
|
|
1572
|
-
customFileUsed = true;
|
|
1573
|
-
return `${FILE_TOKEN}${item.replace(staticBase + "/", "")}`;
|
|
1574
|
-
}
|
|
1575
|
-
return value;
|
|
1576
|
-
}, indent);
|
|
1577
|
-
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
1578
|
-
} catch (err) {
|
|
1579
|
-
throw new Error("Could not serialize the passed input props to JSON: " + err.message);
|
|
1580
|
-
}
|
|
1581
|
-
};
|
|
1582
|
-
var deserializeJSONWithSpecialTypes = (data) => {
|
|
1583
|
-
return JSON.parse(data, (_, value) => {
|
|
1584
|
-
if (typeof value === "string" && value.startsWith(DATE_TOKEN)) {
|
|
1585
|
-
return new Date(value.replace(DATE_TOKEN, ""));
|
|
1586
|
-
}
|
|
1587
|
-
if (typeof value === "string" && value.startsWith(FILE_TOKEN)) {
|
|
1588
|
-
return `${window.remotion_staticBase}/${value.replace(FILE_TOKEN, "")}`;
|
|
1589
|
-
}
|
|
1590
|
-
return value;
|
|
1591
|
-
});
|
|
1592
|
-
};
|
|
1593
|
-
var serializeThenDeserialize = (props) => {
|
|
1594
|
-
return deserializeJSONWithSpecialTypes(serializeJSONWithSpecialTypes({
|
|
1595
|
-
data: props,
|
|
1596
|
-
indent: 2,
|
|
1597
|
-
staticBase: window.remotion_staticBase
|
|
1598
|
-
}).serializedString);
|
|
1599
|
-
};
|
|
1600
|
-
var serializeThenDeserializeInStudio = (props) => {
|
|
1601
|
-
if (getRemotionEnvironment().isStudio) {
|
|
1602
|
-
return serializeThenDeserialize(props);
|
|
1603
|
-
}
|
|
1604
|
-
return props;
|
|
1605
|
-
};
|
|
1606
|
-
var didWarnSSRImport = false;
|
|
1607
|
-
var warnOnceSSRImport = () => {
|
|
1608
|
-
if (didWarnSSRImport) {
|
|
1609
|
-
return;
|
|
1610
|
-
}
|
|
1611
|
-
didWarnSSRImport = true;
|
|
1612
|
-
console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.");
|
|
1613
|
-
console.warn("To hide this warning, don't call this function on the server:");
|
|
1614
|
-
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
1615
|
-
};
|
|
1616
|
-
var getInputProps = () => {
|
|
1617
|
-
if (typeof window === "undefined") {
|
|
1618
|
-
warnOnceSSRImport();
|
|
1619
|
-
return {};
|
|
1620
|
-
}
|
|
1621
|
-
if (getRemotionEnvironment().isPlayer) {
|
|
1622
|
-
throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");
|
|
1623
|
-
}
|
|
1624
|
-
const override = getInputPropsOverride();
|
|
1625
|
-
if (override) {
|
|
1626
|
-
return override;
|
|
1627
|
-
}
|
|
1628
|
-
if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
|
|
1629
|
-
throw new Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");
|
|
1630
|
-
}
|
|
1631
|
-
const param = window.remotion_inputProps;
|
|
1632
|
-
if (!param) {
|
|
1633
|
-
return {};
|
|
1634
|
-
}
|
|
1635
|
-
const parsed = deserializeJSONWithSpecialTypes(param);
|
|
1636
|
-
return parsed;
|
|
1637
|
-
};
|
|
1638
|
-
var EditorPropsContext = createContext8({
|
|
1639
|
-
props: {},
|
|
1640
|
-
updateProps: () => {
|
|
1641
|
-
throw new Error("Not implemented");
|
|
1642
|
-
}
|
|
1643
|
-
});
|
|
1644
|
-
var timeValueRef = React5.createRef();
|
|
1645
|
-
var EditorPropsProvider = ({ children }) => {
|
|
1646
|
-
const [props, setProps] = React5.useState({});
|
|
1647
|
-
const updateProps = useCallback2(({
|
|
1648
|
-
defaultProps,
|
|
1649
|
-
id,
|
|
1650
|
-
newProps
|
|
1651
|
-
}) => {
|
|
1652
|
-
setProps((prev) => {
|
|
1653
|
-
return {
|
|
1654
|
-
...prev,
|
|
1655
|
-
[id]: typeof newProps === "function" ? newProps(prev[id] ?? defaultProps) : newProps
|
|
1656
|
-
};
|
|
1657
|
-
});
|
|
1658
|
-
}, []);
|
|
1659
|
-
const ctx = useMemo3(() => {
|
|
1660
|
-
return { props, updateProps };
|
|
1661
|
-
}, [props, updateProps]);
|
|
1662
|
-
return /* @__PURE__ */ jsx4(EditorPropsContext.Provider, {
|
|
1663
|
-
value: ctx,
|
|
1664
|
-
children
|
|
1665
|
-
});
|
|
1666
|
-
};
|
|
1667
|
-
function validateDimension(amount, nameOfProp, location) {
|
|
1668
|
-
if (typeof amount !== "number") {
|
|
1669
|
-
throw new Error(`The "${nameOfProp}" prop ${location} must be a number, but you passed a value of type ${typeof amount}`);
|
|
1670
|
-
}
|
|
1671
|
-
if (isNaN(amount)) {
|
|
1672
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must not be NaN, but is NaN.`);
|
|
1673
|
-
}
|
|
1674
|
-
if (!Number.isFinite(amount)) {
|
|
1675
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be finite, but is ${amount}.`);
|
|
1676
|
-
}
|
|
1677
|
-
if (amount % 1 !== 0) {
|
|
1678
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be an integer, but is ${amount}.`);
|
|
1679
|
-
}
|
|
1680
|
-
if (amount <= 0) {
|
|
1681
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be positive, but got ${amount}.`);
|
|
1682
|
-
}
|
|
1683
|
-
}
|
|
1684
|
-
function validateDurationInFrames(durationInFrames, options) {
|
|
1685
|
-
const { allowFloats, component } = options;
|
|
1686
|
-
if (typeof durationInFrames === "undefined") {
|
|
1687
|
-
throw new Error(`The "durationInFrames" prop ${component} is missing.`);
|
|
1688
|
-
}
|
|
1689
|
-
if (typeof durationInFrames !== "number") {
|
|
1690
|
-
throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
|
|
1691
|
-
}
|
|
1692
|
-
if (durationInFrames <= 0) {
|
|
1693
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
1694
|
-
}
|
|
1695
|
-
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
1696
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
1697
|
-
}
|
|
1698
|
-
if (!Number.isFinite(durationInFrames)) {
|
|
1699
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
1700
|
-
}
|
|
1701
|
-
}
|
|
1702
|
-
function validateFps(fps, location, isGif) {
|
|
1703
|
-
if (typeof fps !== "number") {
|
|
1704
|
-
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
1705
|
-
}
|
|
1706
|
-
if (!Number.isFinite(fps)) {
|
|
1707
|
-
throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
|
|
1708
|
-
}
|
|
1709
|
-
if (isNaN(fps)) {
|
|
1710
|
-
throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
|
|
1711
|
-
}
|
|
1712
|
-
if (fps <= 0) {
|
|
1713
|
-
throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
|
|
1714
|
-
}
|
|
1715
|
-
if (isGif && fps > 50) {
|
|
1716
|
-
throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
var ResolveCompositionContext = createContext9(null);
|
|
1720
|
-
var resolveCompositionsRef = createRef();
|
|
1721
|
-
var needsResolution = (composition) => {
|
|
1722
|
-
return Boolean(composition.calculateMetadata);
|
|
1723
|
-
};
|
|
1724
|
-
var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
1725
|
-
const context = useContext5(ResolveCompositionContext);
|
|
1726
|
-
const { props: allEditorProps } = useContext5(EditorPropsContext);
|
|
1727
|
-
const { compositions, canvasContent, currentCompositionMetadata } = useContext5(CompositionManager);
|
|
1728
|
-
const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
1729
|
-
const compositionId = preferredCompositionId ?? currentComposition;
|
|
1730
|
-
const composition = compositions.find((c) => c.id === compositionId);
|
|
1731
|
-
const selectedEditorProps = useMemo4(() => {
|
|
1732
|
-
return composition ? allEditorProps[composition.id] ?? {} : {};
|
|
1733
|
-
}, [allEditorProps, composition]);
|
|
1734
|
-
const env = useRemotionEnvironment();
|
|
1735
|
-
return useMemo4(() => {
|
|
1736
|
-
if (!composition) {
|
|
1737
|
-
return null;
|
|
1738
|
-
}
|
|
1739
|
-
if (currentCompositionMetadata) {
|
|
1740
|
-
return {
|
|
1741
|
-
type: "success",
|
|
1742
|
-
result: {
|
|
1743
|
-
...currentCompositionMetadata,
|
|
1744
|
-
id: composition.id,
|
|
1745
|
-
defaultProps: composition.defaultProps ?? {}
|
|
1746
|
-
}
|
|
1747
|
-
};
|
|
1748
|
-
}
|
|
1749
|
-
if (!needsResolution(composition)) {
|
|
1750
|
-
validateDurationInFrames(composition.durationInFrames, {
|
|
1751
|
-
allowFloats: false,
|
|
1752
|
-
component: `in <Composition id="${composition.id}">`
|
|
1753
|
-
});
|
|
1754
|
-
validateFps(composition.fps, `in <Composition id="${composition.id}">`, false);
|
|
1755
|
-
validateDimension(composition.width, "width", `in <Composition id="${composition.id}">`);
|
|
1756
|
-
validateDimension(composition.height, "height", `in <Composition id="${composition.id}">`);
|
|
1757
|
-
return {
|
|
1758
|
-
type: "success",
|
|
1759
|
-
result: {
|
|
1760
|
-
width: composition.width,
|
|
1761
|
-
height: composition.height,
|
|
1762
|
-
fps: composition.fps,
|
|
1763
|
-
id: composition.id,
|
|
1764
|
-
durationInFrames: composition.durationInFrames,
|
|
1765
|
-
defaultProps: composition.defaultProps ?? {},
|
|
1766
|
-
props: {
|
|
1767
|
-
...composition.defaultProps ?? {},
|
|
1768
|
-
...selectedEditorProps ?? {},
|
|
1769
|
-
...typeof window === "undefined" || env.isPlayer || !window.remotion_inputProps ? {} : getInputProps() ?? {}
|
|
1770
|
-
},
|
|
1771
|
-
defaultCodec: null,
|
|
1772
|
-
defaultOutName: null,
|
|
1773
|
-
defaultVideoImageFormat: null,
|
|
1774
|
-
defaultPixelFormat: null,
|
|
1775
|
-
defaultProResProfile: null
|
|
1776
|
-
}
|
|
1777
|
-
};
|
|
1778
|
-
}
|
|
1779
|
-
if (!context) {
|
|
1780
|
-
return null;
|
|
1781
|
-
}
|
|
1782
|
-
if (!context[composition.id]) {
|
|
1783
|
-
return null;
|
|
1784
|
-
}
|
|
1785
|
-
return context[composition.id];
|
|
1786
|
-
}, [
|
|
1787
|
-
composition,
|
|
1788
|
-
context,
|
|
1789
|
-
currentCompositionMetadata,
|
|
1790
|
-
selectedEditorProps,
|
|
1791
|
-
env.isPlayer
|
|
1792
|
-
]);
|
|
1793
|
-
};
|
|
1794
|
-
var useVideo = () => {
|
|
1795
|
-
const { canvasContent, compositions, currentCompositionMetadata } = useContext6(CompositionManager);
|
|
1796
|
-
const selected = compositions.find((c) => {
|
|
1797
|
-
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
1798
|
-
});
|
|
1799
|
-
const resolved = useResolvedVideoConfig(selected?.id ?? null);
|
|
1800
|
-
return useMemo5(() => {
|
|
1801
|
-
if (!resolved) {
|
|
1802
|
-
return null;
|
|
1803
|
-
}
|
|
1804
|
-
if (resolved.type === "error") {
|
|
1805
|
-
return null;
|
|
1806
|
-
}
|
|
1807
|
-
if (resolved.type === "loading") {
|
|
1808
|
-
return null;
|
|
1809
|
-
}
|
|
1810
|
-
if (!selected) {
|
|
1811
|
-
return null;
|
|
1812
|
-
}
|
|
1813
|
-
return {
|
|
1814
|
-
...resolved.result,
|
|
1815
|
-
defaultProps: selected.defaultProps ?? {},
|
|
1816
|
-
id: selected.id,
|
|
1817
|
-
...currentCompositionMetadata ?? {},
|
|
1818
|
-
component: selected.component
|
|
1819
|
-
};
|
|
1820
|
-
}, [currentCompositionMetadata, resolved, selected]);
|
|
1821
|
-
};
|
|
1822
2125
|
var makeKey = () => {
|
|
1823
2126
|
return `remotion.time-all`;
|
|
1824
2127
|
};
|
|
@@ -1851,7 +2154,7 @@ var useTimelinePositionFromContext = (state) => {
|
|
|
1851
2154
|
return Math.min(videoConfig.durationInFrames - 1, unclamped);
|
|
1852
2155
|
};
|
|
1853
2156
|
var useTimelineContext = () => {
|
|
1854
|
-
const state =
|
|
2157
|
+
const state = useContext10(TimelineContext);
|
|
1855
2158
|
if (state === null) {
|
|
1856
2159
|
throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
1857
2160
|
}
|
|
@@ -1862,30 +2165,23 @@ var useTimelinePosition = () => {
|
|
|
1862
2165
|
return useTimelinePositionFromContext(state);
|
|
1863
2166
|
};
|
|
1864
2167
|
var useAbsoluteTimelinePosition = () => {
|
|
1865
|
-
const state =
|
|
2168
|
+
const state = useContext10(AbsoluteTimeContext);
|
|
1866
2169
|
if (state === null) {
|
|
1867
2170
|
throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
1868
2171
|
}
|
|
1869
2172
|
return useTimelinePositionFromContext(state);
|
|
1870
2173
|
};
|
|
1871
2174
|
var useTimelineSetFrame = () => {
|
|
1872
|
-
const { setFrame } =
|
|
2175
|
+
const { setFrame } = useContext10(SetTimelineContext);
|
|
1873
2176
|
return setFrame;
|
|
1874
2177
|
};
|
|
1875
2178
|
var usePlayingState = () => {
|
|
1876
2179
|
const { playing, imperativePlaying } = useTimelineContext();
|
|
1877
|
-
const { setPlaying } =
|
|
1878
|
-
return
|
|
1879
|
-
};
|
|
1880
|
-
var CanUseRemotionHooks = createContext10(false);
|
|
1881
|
-
var CanUseRemotionHooksProvider = ({ children }) => {
|
|
1882
|
-
return /* @__PURE__ */ jsx5(CanUseRemotionHooks.Provider, {
|
|
1883
|
-
value: true,
|
|
1884
|
-
children
|
|
1885
|
-
});
|
|
2180
|
+
const { setPlaying } = useContext10(SetTimelineContext);
|
|
2181
|
+
return useMemo9(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
|
|
1886
2182
|
};
|
|
1887
2183
|
var useCurrentFrame = () => {
|
|
1888
|
-
const canUseRemotionHooks =
|
|
2184
|
+
const canUseRemotionHooks = useContext11(CanUseRemotionHooks);
|
|
1889
2185
|
const env = useRemotionEnvironment();
|
|
1890
2186
|
if (!canUseRemotionHooks) {
|
|
1891
2187
|
if (env.isPlayer) {
|
|
@@ -1894,17 +2190,17 @@ var useCurrentFrame = () => {
|
|
|
1894
2190
|
throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
|
|
1895
2191
|
}
|
|
1896
2192
|
const frame = useTimelinePosition();
|
|
1897
|
-
const context =
|
|
2193
|
+
const context = useContext11(SequenceContext);
|
|
1898
2194
|
const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
|
|
1899
2195
|
return frame - contextOffset;
|
|
1900
2196
|
};
|
|
1901
2197
|
var useUnsafeVideoConfig = () => {
|
|
1902
|
-
const context =
|
|
2198
|
+
const context = useContext12(SequenceContext);
|
|
1903
2199
|
const ctxWidth = context?.width ?? null;
|
|
1904
2200
|
const ctxHeight = context?.height ?? null;
|
|
1905
2201
|
const ctxDuration = context?.durationInFrames ?? null;
|
|
1906
2202
|
const video = useVideo();
|
|
1907
|
-
return
|
|
2203
|
+
return useMemo10(() => {
|
|
1908
2204
|
if (!video) {
|
|
1909
2205
|
return null;
|
|
1910
2206
|
}
|
|
@@ -1940,7 +2236,7 @@ var useUnsafeVideoConfig = () => {
|
|
|
1940
2236
|
};
|
|
1941
2237
|
var useVideoConfig = () => {
|
|
1942
2238
|
const videoConfig = useUnsafeVideoConfig();
|
|
1943
|
-
const context =
|
|
2239
|
+
const context = useContext13(CanUseRemotionHooks);
|
|
1944
2240
|
const isPlayer = useIsPlayer();
|
|
1945
2241
|
if (!videoConfig) {
|
|
1946
2242
|
if (typeof window !== "undefined" && window.remotion_isPlayer || isPlayer) {
|
|
@@ -1976,7 +2272,7 @@ var Freeze = ({
|
|
|
1976
2272
|
if (!Number.isFinite(frameToFreeze)) {
|
|
1977
2273
|
throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frameToFreeze}.`);
|
|
1978
2274
|
}
|
|
1979
|
-
const isActive =
|
|
2275
|
+
const isActive = useMemo11(() => {
|
|
1980
2276
|
if (typeof active === "boolean") {
|
|
1981
2277
|
return active;
|
|
1982
2278
|
}
|
|
@@ -1985,9 +2281,9 @@ var Freeze = ({
|
|
|
1985
2281
|
}
|
|
1986
2282
|
}, [active, frame]);
|
|
1987
2283
|
const timelineContext = useTimelineContext();
|
|
1988
|
-
const sequenceContext =
|
|
2284
|
+
const sequenceContext = useContext14(SequenceContext);
|
|
1989
2285
|
const relativeFrom = sequenceContext?.relativeFrom ?? 0;
|
|
1990
|
-
const timelineValue =
|
|
2286
|
+
const timelineValue = useMemo11(() => {
|
|
1991
2287
|
if (!isActive) {
|
|
1992
2288
|
return timelineContext;
|
|
1993
2289
|
}
|
|
@@ -2002,7 +2298,7 @@ var Freeze = ({
|
|
|
2002
2298
|
}
|
|
2003
2299
|
};
|
|
2004
2300
|
}, [isActive, timelineContext, videoConfig.id, frameToFreeze, relativeFrom]);
|
|
2005
|
-
const newSequenceContext =
|
|
2301
|
+
const newSequenceContext = useMemo11(() => {
|
|
2006
2302
|
if (!sequenceContext) {
|
|
2007
2303
|
return null;
|
|
2008
2304
|
}
|
|
@@ -2014,53 +2310,19 @@ var Freeze = ({
|
|
|
2014
2310
|
cumulatedFrom: 0
|
|
2015
2311
|
};
|
|
2016
2312
|
}, [sequenceContext, isActive]);
|
|
2017
|
-
return /* @__PURE__ */
|
|
2313
|
+
return /* @__PURE__ */ jsx9(TimelineContext.Provider, {
|
|
2018
2314
|
value: timelineValue,
|
|
2019
|
-
children: /* @__PURE__ */
|
|
2315
|
+
children: /* @__PURE__ */ jsx9(SequenceContext.Provider, {
|
|
2020
2316
|
value: newSequenceContext,
|
|
2021
2317
|
children
|
|
2022
2318
|
})
|
|
2023
2319
|
});
|
|
2024
2320
|
};
|
|
2025
|
-
var
|
|
2026
|
-
getNonce: () => 0
|
|
2027
|
-
});
|
|
2028
|
-
var fastRefreshNonce = 0;
|
|
2029
|
-
try {
|
|
2030
|
-
if (typeof __webpack_module__ !== "undefined") {
|
|
2031
|
-
if (__webpack_module__.hot) {
|
|
2032
|
-
__webpack_module__.hot.addStatusHandler((status) => {
|
|
2033
|
-
if (status === "idle") {
|
|
2034
|
-
fastRefreshNonce++;
|
|
2035
|
-
}
|
|
2036
|
-
});
|
|
2037
|
-
}
|
|
2038
|
-
}
|
|
2039
|
-
} catch {}
|
|
2040
|
-
var useNonce = () => {
|
|
2041
|
-
const context = useContext12(NonceContext);
|
|
2042
|
-
const nonce = context.getNonce();
|
|
2043
|
-
const nonceRef = useRef2(nonce);
|
|
2044
|
-
nonceRef.current = nonce;
|
|
2045
|
-
const history = useRef2([[fastRefreshNonce, nonce]]);
|
|
2046
|
-
const get = useCallback3(() => {
|
|
2047
|
-
if (fastRefreshNonce !== history.current[history.current.length - 1][0]) {
|
|
2048
|
-
history.current = [
|
|
2049
|
-
...history.current,
|
|
2050
|
-
[fastRefreshNonce, nonceRef.current]
|
|
2051
|
-
];
|
|
2052
|
-
}
|
|
2053
|
-
return history.current;
|
|
2054
|
-
}, [history]);
|
|
2055
|
-
return useMemo9(() => {
|
|
2056
|
-
return { get };
|
|
2057
|
-
}, [get]);
|
|
2058
|
-
};
|
|
2059
|
-
var PremountContext = createContext12({
|
|
2321
|
+
var PremountContext = createContext13({
|
|
2060
2322
|
premountFramesRemaining: 0,
|
|
2061
2323
|
playing: false
|
|
2062
2324
|
});
|
|
2063
|
-
var SequenceManager =
|
|
2325
|
+
var SequenceManager = React10.createContext({
|
|
2064
2326
|
registerSequence: () => {
|
|
2065
2327
|
throw new Error("SequenceManagerContext not initialized");
|
|
2066
2328
|
},
|
|
@@ -2069,13 +2331,13 @@ var SequenceManager = React8.createContext({
|
|
|
2069
2331
|
},
|
|
2070
2332
|
sequences: []
|
|
2071
2333
|
});
|
|
2072
|
-
var SequenceVisibilityToggleContext =
|
|
2334
|
+
var SequenceVisibilityToggleContext = React10.createContext({
|
|
2073
2335
|
hidden: {},
|
|
2074
2336
|
setHidden: () => {
|
|
2075
2337
|
throw new Error("SequenceVisibilityToggle not initialized");
|
|
2076
2338
|
}
|
|
2077
2339
|
});
|
|
2078
|
-
var VisualModeOverridesContext =
|
|
2340
|
+
var VisualModeOverridesContext = React10.createContext({
|
|
2079
2341
|
dragOverrides: {},
|
|
2080
2342
|
setDragOverrides: () => {
|
|
2081
2343
|
throw new Error("VisualModeOverridesContext not initialized");
|
|
@@ -2093,7 +2355,7 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
2093
2355
|
const [sequences, setSequences] = useState3([]);
|
|
2094
2356
|
const [hidden, setHidden] = useState3({});
|
|
2095
2357
|
const [dragOverrides, setControlOverrides] = useState3({});
|
|
2096
|
-
const controlOverridesRef =
|
|
2358
|
+
const controlOverridesRef = useRef4(dragOverrides);
|
|
2097
2359
|
controlOverridesRef.current = dragOverrides;
|
|
2098
2360
|
const [codeValues, setCodeValuesMapState] = useState3({});
|
|
2099
2361
|
const setDragOverrides = useCallback4((sequenceId, key, value) => {
|
|
@@ -2139,20 +2401,20 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
2139
2401
|
const unregisterSequence = useCallback4((seq) => {
|
|
2140
2402
|
setSequences((seqs) => seqs.filter((s) => s.id !== seq));
|
|
2141
2403
|
}, []);
|
|
2142
|
-
const sequenceContext =
|
|
2404
|
+
const sequenceContext = useMemo12(() => {
|
|
2143
2405
|
return {
|
|
2144
2406
|
registerSequence,
|
|
2145
2407
|
sequences,
|
|
2146
2408
|
unregisterSequence
|
|
2147
2409
|
};
|
|
2148
2410
|
}, [registerSequence, sequences, unregisterSequence]);
|
|
2149
|
-
const hiddenContext =
|
|
2411
|
+
const hiddenContext = useMemo12(() => {
|
|
2150
2412
|
return {
|
|
2151
2413
|
hidden,
|
|
2152
2414
|
setHidden
|
|
2153
2415
|
};
|
|
2154
2416
|
}, [hidden]);
|
|
2155
|
-
const overrideContext =
|
|
2417
|
+
const overrideContext = useMemo12(() => {
|
|
2156
2418
|
return {
|
|
2157
2419
|
visualModeEnabled,
|
|
2158
2420
|
dragOverrides,
|
|
@@ -2169,11 +2431,11 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
2169
2431
|
codeValues,
|
|
2170
2432
|
setCodeValues
|
|
2171
2433
|
]);
|
|
2172
|
-
return /* @__PURE__ */
|
|
2434
|
+
return /* @__PURE__ */ jsx10(SequenceManager.Provider, {
|
|
2173
2435
|
value: sequenceContext,
|
|
2174
|
-
children: /* @__PURE__ */
|
|
2436
|
+
children: /* @__PURE__ */ jsx10(SequenceVisibilityToggleContext.Provider, {
|
|
2175
2437
|
value: hiddenContext,
|
|
2176
|
-
children: /* @__PURE__ */
|
|
2438
|
+
children: /* @__PURE__ */ jsx10(VisualModeOverridesContext.Provider, {
|
|
2177
2439
|
value: overrideContext,
|
|
2178
2440
|
children
|
|
2179
2441
|
})
|
|
@@ -2198,7 +2460,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2198
2460
|
}, ref) => {
|
|
2199
2461
|
const { layout = "absolute-fill" } = other;
|
|
2200
2462
|
const [id] = useState4(() => String(Math.random()));
|
|
2201
|
-
const parentSequence =
|
|
2463
|
+
const parentSequence = useContext15(SequenceContext);
|
|
2202
2464
|
const { rootId } = useTimelineContext();
|
|
2203
2465
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
2204
2466
|
const nonce = useNonce();
|
|
@@ -2224,15 +2486,15 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2224
2486
|
const videoConfig = useVideoConfig();
|
|
2225
2487
|
const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - from, durationInFrames) : durationInFrames;
|
|
2226
2488
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
2227
|
-
const { registerSequence, unregisterSequence } =
|
|
2228
|
-
const { hidden } =
|
|
2229
|
-
const premounting =
|
|
2489
|
+
const { registerSequence, unregisterSequence } = useContext15(SequenceManager);
|
|
2490
|
+
const { hidden } = useContext15(SequenceVisibilityToggleContext);
|
|
2491
|
+
const premounting = useMemo13(() => {
|
|
2230
2492
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
2231
2493
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
2232
|
-
const postmounting =
|
|
2494
|
+
const postmounting = useMemo13(() => {
|
|
2233
2495
|
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
2234
2496
|
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
2235
|
-
const contextValue =
|
|
2497
|
+
const contextValue = useMemo13(() => {
|
|
2236
2498
|
return {
|
|
2237
2499
|
cumulatedFrom,
|
|
2238
2500
|
relativeFrom: from,
|
|
@@ -2259,12 +2521,12 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2259
2521
|
premountDisplay,
|
|
2260
2522
|
postmountDisplay
|
|
2261
2523
|
]);
|
|
2262
|
-
const timelineClipName =
|
|
2524
|
+
const timelineClipName = useMemo13(() => {
|
|
2263
2525
|
return name ?? "";
|
|
2264
2526
|
}, [name]);
|
|
2265
2527
|
const env = useRemotionEnvironment();
|
|
2266
2528
|
const inheritedStack = other?.stack ?? null;
|
|
2267
|
-
|
|
2529
|
+
useEffect3(() => {
|
|
2268
2530
|
if (!env.isStudio) {
|
|
2269
2531
|
return;
|
|
2270
2532
|
}
|
|
@@ -2311,7 +2573,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2311
2573
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
2312
2574
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
2313
2575
|
const styleIfThere = other.layout === "none" ? undefined : other.style;
|
|
2314
|
-
const defaultStyle =
|
|
2576
|
+
const defaultStyle = useMemo13(() => {
|
|
2315
2577
|
return {
|
|
2316
2578
|
flexDirection: undefined,
|
|
2317
2579
|
...width ? { width } : {},
|
|
@@ -2326,9 +2588,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2326
2588
|
if (isSequenceHidden) {
|
|
2327
2589
|
return null;
|
|
2328
2590
|
}
|
|
2329
|
-
return /* @__PURE__ */
|
|
2591
|
+
return /* @__PURE__ */ jsx11(SequenceContext.Provider, {
|
|
2330
2592
|
value: contextValue,
|
|
2331
|
-
children: content === null ? null : other.layout === "none" ? content : /* @__PURE__ */
|
|
2593
|
+
children: content === null ? null : other.layout === "none" ? content : /* @__PURE__ */ jsx11(AbsoluteFill, {
|
|
2332
2594
|
ref,
|
|
2333
2595
|
style: defaultStyle,
|
|
2334
2596
|
className: other.className,
|
|
@@ -2338,7 +2600,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2338
2600
|
};
|
|
2339
2601
|
var RegularSequence = forwardRef2(RegularSequenceRefForwardingFunction);
|
|
2340
2602
|
var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
2341
|
-
const parentPremountContext =
|
|
2603
|
+
const parentPremountContext = useContext15(PremountContext);
|
|
2342
2604
|
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
2343
2605
|
if (props.layout === "none") {
|
|
2344
2606
|
throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
|
|
@@ -2358,7 +2620,7 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
2358
2620
|
const postmountingActive = frame > endThreshold && frame <= endThreshold + postmountFor;
|
|
2359
2621
|
const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
|
|
2360
2622
|
const isFreezingActive = premountingActive || postmountingActive;
|
|
2361
|
-
const style =
|
|
2623
|
+
const style = useMemo13(() => {
|
|
2362
2624
|
return {
|
|
2363
2625
|
...passedStyle,
|
|
2364
2626
|
opacity: premountingActive || postmountingActive ? 0 : 1,
|
|
@@ -2375,18 +2637,18 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
2375
2637
|
]);
|
|
2376
2638
|
const { playing } = useTimelineContext();
|
|
2377
2639
|
const premountFramesRemaining = premountingActive ? from - frame : 0;
|
|
2378
|
-
const premountContextValue =
|
|
2640
|
+
const premountContextValue = useMemo13(() => {
|
|
2379
2641
|
return {
|
|
2380
2642
|
premountFramesRemaining,
|
|
2381
2643
|
playing: parentPremountContext.playing || playing
|
|
2382
2644
|
};
|
|
2383
2645
|
}, [premountFramesRemaining, parentPremountContext.playing, playing]);
|
|
2384
|
-
return /* @__PURE__ */
|
|
2646
|
+
return /* @__PURE__ */ jsx11(PremountContext.Provider, {
|
|
2385
2647
|
value: premountContextValue,
|
|
2386
|
-
children: /* @__PURE__ */
|
|
2648
|
+
children: /* @__PURE__ */ jsx11(Freeze, {
|
|
2387
2649
|
frame: freezeFrame,
|
|
2388
2650
|
active: isFreezingActive,
|
|
2389
|
-
children: /* @__PURE__ */
|
|
2651
|
+
children: /* @__PURE__ */ jsx11(Sequence, {
|
|
2390
2652
|
ref,
|
|
2391
2653
|
from,
|
|
2392
2654
|
durationInFrames,
|
|
@@ -2407,14 +2669,14 @@ var SequenceRefForwardingFunction = (props, ref) => {
|
|
|
2407
2669
|
if (props.layout !== "none" && !env.isRendering) {
|
|
2408
2670
|
const effectivePremountFor = ENABLE_V5_BREAKING_CHANGES ? props.premountFor ?? fps : props.premountFor;
|
|
2409
2671
|
if (effectivePremountFor || props.postmountFor) {
|
|
2410
|
-
return /* @__PURE__ */
|
|
2672
|
+
return /* @__PURE__ */ jsx11(PremountedPostmountedSequence, {
|
|
2411
2673
|
ref,
|
|
2412
2674
|
...props,
|
|
2413
2675
|
premountFor: effectivePremountFor
|
|
2414
2676
|
});
|
|
2415
2677
|
}
|
|
2416
2678
|
}
|
|
2417
|
-
return /* @__PURE__ */
|
|
2679
|
+
return /* @__PURE__ */ jsx11(RegularSequence, {
|
|
2418
2680
|
...props,
|
|
2419
2681
|
ref
|
|
2420
2682
|
});
|
|
@@ -2469,7 +2731,7 @@ var calcArgs = (fit, frameSize, canvasSize) => {
|
|
|
2469
2731
|
}
|
|
2470
2732
|
};
|
|
2471
2733
|
var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
|
|
2472
|
-
const canvasRef =
|
|
2734
|
+
const canvasRef = useRef5(null);
|
|
2473
2735
|
const draw = useCallback5((imageData) => {
|
|
2474
2736
|
const canvas = canvasRef.current;
|
|
2475
2737
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
@@ -2509,13 +2771,13 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref
|
|
|
2509
2771
|
}
|
|
2510
2772
|
};
|
|
2511
2773
|
}, [draw]);
|
|
2512
|
-
return /* @__PURE__ */
|
|
2774
|
+
return /* @__PURE__ */ jsx12("canvas", {
|
|
2513
2775
|
ref: canvasRef,
|
|
2514
2776
|
className,
|
|
2515
2777
|
style
|
|
2516
2778
|
});
|
|
2517
2779
|
};
|
|
2518
|
-
var Canvas =
|
|
2780
|
+
var Canvas = React12.forwardRef(CanvasRefForwardingFunction);
|
|
2519
2781
|
var CACHE_SIZE = 5;
|
|
2520
2782
|
var getActualTime = ({
|
|
2521
2783
|
loopBehavior,
|
|
@@ -2672,8 +2934,8 @@ var AnimatedImage = forwardRef3(({
|
|
|
2672
2934
|
fit = "fill",
|
|
2673
2935
|
...props
|
|
2674
2936
|
}, canvasRef) => {
|
|
2675
|
-
const mountState =
|
|
2676
|
-
|
|
2937
|
+
const mountState = useRef6({ isMounted: true });
|
|
2938
|
+
useEffect4(() => {
|
|
2677
2939
|
const { current } = mountState;
|
|
2678
2940
|
current.isMounted = true;
|
|
2679
2941
|
return () => {
|
|
@@ -2687,9 +2949,9 @@ var AnimatedImage = forwardRef3(({
|
|
|
2687
2949
|
const frame = useCurrentFrame();
|
|
2688
2950
|
const { fps } = useVideoConfig();
|
|
2689
2951
|
const currentTime = frame / playbackRate / fps;
|
|
2690
|
-
const currentTimeRef =
|
|
2952
|
+
const currentTimeRef = useRef6(currentTime);
|
|
2691
2953
|
currentTimeRef.current = currentTime;
|
|
2692
|
-
const ref =
|
|
2954
|
+
const ref = useRef6(null);
|
|
2693
2955
|
useImperativeHandle2(canvasRef, () => {
|
|
2694
2956
|
const c = ref.current?.getCanvas();
|
|
2695
2957
|
if (!c) {
|
|
@@ -2698,7 +2960,7 @@ var AnimatedImage = forwardRef3(({
|
|
|
2698
2960
|
return c;
|
|
2699
2961
|
}, []);
|
|
2700
2962
|
const [initialLoopBehavior] = useState5(() => loopBehavior);
|
|
2701
|
-
|
|
2963
|
+
useEffect4(() => {
|
|
2702
2964
|
const controller = new AbortController;
|
|
2703
2965
|
decodeImage({
|
|
2704
2966
|
resolvedSrc,
|
|
@@ -2761,7 +3023,7 @@ var AnimatedImage = forwardRef3(({
|
|
|
2761
3023
|
continueRender2,
|
|
2762
3024
|
delayRender2
|
|
2763
3025
|
]);
|
|
2764
|
-
return /* @__PURE__ */
|
|
3026
|
+
return /* @__PURE__ */ jsx13(Canvas, {
|
|
2765
3027
|
ref,
|
|
2766
3028
|
width,
|
|
2767
3029
|
height,
|
|
@@ -2798,7 +3060,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
2798
3060
|
}
|
|
2799
3061
|
validateContent(artifact.content);
|
|
2800
3062
|
};
|
|
2801
|
-
var RenderAssetManager =
|
|
3063
|
+
var RenderAssetManager = createContext14({
|
|
2802
3064
|
registerRenderAsset: () => {
|
|
2803
3065
|
return;
|
|
2804
3066
|
},
|
|
@@ -2809,7 +3071,7 @@ var RenderAssetManager = createContext13({
|
|
|
2809
3071
|
});
|
|
2810
3072
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
2811
3073
|
const [renderAssets, setRenderAssets] = useState6([]);
|
|
2812
|
-
const renderAssetsRef =
|
|
3074
|
+
const renderAssetsRef = useRef7([]);
|
|
2813
3075
|
const registerRenderAsset = useCallback6((renderAsset) => {
|
|
2814
3076
|
validateRenderAsset(renderAsset);
|
|
2815
3077
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
@@ -2841,21 +3103,21 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
2841
3103
|
};
|
|
2842
3104
|
}
|
|
2843
3105
|
}, []);
|
|
2844
|
-
const contextValue =
|
|
3106
|
+
const contextValue = useMemo14(() => {
|
|
2845
3107
|
return {
|
|
2846
3108
|
registerRenderAsset,
|
|
2847
3109
|
unregisterRenderAsset,
|
|
2848
3110
|
renderAssets
|
|
2849
3111
|
};
|
|
2850
3112
|
}, [renderAssets, registerRenderAsset, unregisterRenderAsset]);
|
|
2851
|
-
return /* @__PURE__ */
|
|
3113
|
+
return /* @__PURE__ */ jsx14(RenderAssetManager.Provider, {
|
|
2852
3114
|
value: contextValue,
|
|
2853
3115
|
children
|
|
2854
3116
|
});
|
|
2855
3117
|
};
|
|
2856
3118
|
var ArtifactThumbnail = Symbol("Thumbnail");
|
|
2857
3119
|
var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
2858
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
3120
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext16(RenderAssetManager);
|
|
2859
3121
|
const env = useRemotionEnvironment();
|
|
2860
3122
|
const frame = useCurrentFrame();
|
|
2861
3123
|
const [id] = useState7(() => {
|
|
@@ -2936,9 +3198,9 @@ var calculateMediaDuration = ({
|
|
|
2936
3198
|
const actualDuration = duration / playbackRate;
|
|
2937
3199
|
return Math.floor(actualDuration);
|
|
2938
3200
|
};
|
|
2939
|
-
var LoopContext =
|
|
3201
|
+
var LoopContext = createContext15(null);
|
|
2940
3202
|
var useLoop = () => {
|
|
2941
|
-
return
|
|
3203
|
+
return React13.useContext(LoopContext);
|
|
2942
3204
|
};
|
|
2943
3205
|
var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
|
|
2944
3206
|
const currentFrame = useCurrentFrame();
|
|
@@ -2963,22 +3225,22 @@ var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) =>
|
|
|
2963
3225
|
const iteration = Math.floor(currentFrame / durationInFrames);
|
|
2964
3226
|
const start = iteration * durationInFrames;
|
|
2965
3227
|
const from = Math.min(start, maxFrame);
|
|
2966
|
-
const loopDisplay =
|
|
3228
|
+
const loopDisplay = useMemo15(() => {
|
|
2967
3229
|
return {
|
|
2968
3230
|
numberOfTimes: Math.min(compDuration / durationInFrames, times),
|
|
2969
3231
|
startOffset: -from,
|
|
2970
3232
|
durationInFrames
|
|
2971
3233
|
};
|
|
2972
3234
|
}, [compDuration, durationInFrames, from, times]);
|
|
2973
|
-
const loopContext =
|
|
3235
|
+
const loopContext = useMemo15(() => {
|
|
2974
3236
|
return {
|
|
2975
3237
|
iteration: Math.floor(currentFrame / durationInFrames),
|
|
2976
3238
|
durationInFrames
|
|
2977
3239
|
};
|
|
2978
3240
|
}, [currentFrame, durationInFrames]);
|
|
2979
|
-
return /* @__PURE__ */
|
|
3241
|
+
return /* @__PURE__ */ jsx15(LoopContext.Provider, {
|
|
2980
3242
|
value: loopContext,
|
|
2981
|
-
children: /* @__PURE__ */
|
|
3243
|
+
children: /* @__PURE__ */ jsx15(Sequence, {
|
|
2982
3244
|
durationInFrames,
|
|
2983
3245
|
from,
|
|
2984
3246
|
name: name ?? "<Loop>",
|
|
@@ -2999,7 +3261,7 @@ var playbackLogging = ({
|
|
|
2999
3261
|
const tags = [mountTime ? Date.now() - mountTime + "ms " : null, tag].filter(Boolean).join(" ");
|
|
3000
3262
|
Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
|
|
3001
3263
|
};
|
|
3002
|
-
var PreloadContext =
|
|
3264
|
+
var PreloadContext = createContext16({});
|
|
3003
3265
|
var preloads = {};
|
|
3004
3266
|
var updaters = [];
|
|
3005
3267
|
var setPreloads = (updater) => {
|
|
@@ -3008,7 +3270,7 @@ var setPreloads = (updater) => {
|
|
|
3008
3270
|
};
|
|
3009
3271
|
var PrefetchProvider = ({ children }) => {
|
|
3010
3272
|
const [_preloads, _setPreloads] = useState8(() => preloads);
|
|
3011
|
-
|
|
3273
|
+
useEffect5(() => {
|
|
3012
3274
|
const updaterFunction = () => {
|
|
3013
3275
|
_setPreloads(preloads);
|
|
3014
3276
|
};
|
|
@@ -3017,7 +3279,7 @@ var PrefetchProvider = ({ children }) => {
|
|
|
3017
3279
|
updaters = updaters.filter((u) => u !== updaterFunction);
|
|
3018
3280
|
};
|
|
3019
3281
|
}, []);
|
|
3020
|
-
return /* @__PURE__ */
|
|
3282
|
+
return /* @__PURE__ */ jsx16(PreloadContext.Provider, {
|
|
3021
3283
|
value: _preloads,
|
|
3022
3284
|
children
|
|
3023
3285
|
});
|
|
@@ -3037,7 +3299,7 @@ var getSrcWithoutHash = (src) => {
|
|
|
3037
3299
|
return src.slice(0, hashIndex);
|
|
3038
3300
|
};
|
|
3039
3301
|
var usePreload = (src) => {
|
|
3040
|
-
const preloads2 =
|
|
3302
|
+
const preloads2 = useContext17(PreloadContext);
|
|
3041
3303
|
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
3042
3304
|
const withoutHashFragment = getSrcWithoutHash(src);
|
|
3043
3305
|
if (!preloads2[withoutHashFragment]) {
|
|
@@ -3320,7 +3582,7 @@ var durationReducer = (state, action) => {
|
|
|
3320
3582
|
return state;
|
|
3321
3583
|
}
|
|
3322
3584
|
};
|
|
3323
|
-
var DurationsContext =
|
|
3585
|
+
var DurationsContext = createContext17({
|
|
3324
3586
|
durations: {},
|
|
3325
3587
|
setDurations: () => {
|
|
3326
3588
|
throw new Error("context missing");
|
|
@@ -3328,13 +3590,13 @@ var DurationsContext = createContext16({
|
|
|
3328
3590
|
});
|
|
3329
3591
|
var DurationsContextProvider = ({ children }) => {
|
|
3330
3592
|
const [durations, setDurations] = useReducer(durationReducer, {});
|
|
3331
|
-
const value =
|
|
3593
|
+
const value = useMemo16(() => {
|
|
3332
3594
|
return {
|
|
3333
3595
|
durations,
|
|
3334
3596
|
setDurations
|
|
3335
3597
|
};
|
|
3336
3598
|
}, [durations]);
|
|
3337
|
-
return /* @__PURE__ */
|
|
3599
|
+
return /* @__PURE__ */ jsx17(DurationsContext.Provider, {
|
|
3338
3600
|
value,
|
|
3339
3601
|
children
|
|
3340
3602
|
});
|
|
@@ -3462,7 +3724,7 @@ var useSingletonAudioContext = ({
|
|
|
3462
3724
|
audioEnabled
|
|
3463
3725
|
}) => {
|
|
3464
3726
|
const env = useRemotionEnvironment();
|
|
3465
|
-
const audioContext =
|
|
3727
|
+
const audioContext = useMemo17(() => {
|
|
3466
3728
|
if (env.isRendering) {
|
|
3467
3729
|
return null;
|
|
3468
3730
|
}
|
|
@@ -3506,9 +3768,9 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
3506
3768
|
}
|
|
3507
3769
|
return true;
|
|
3508
3770
|
};
|
|
3509
|
-
var SharedAudioContext =
|
|
3771
|
+
var SharedAudioContext = createContext18(null);
|
|
3510
3772
|
var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHint, audioEnabled }) => {
|
|
3511
|
-
const audios =
|
|
3773
|
+
const audios = useRef8([]);
|
|
3512
3774
|
const [initialNumberOfAudioTags] = useState9(numberOfAudioTags);
|
|
3513
3775
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
3514
3776
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
@@ -3519,9 +3781,9 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3519
3781
|
latencyHint: audioLatencyHint,
|
|
3520
3782
|
audioEnabled
|
|
3521
3783
|
});
|
|
3522
|
-
const audioSyncAnchor =
|
|
3523
|
-
const prevEndTimes =
|
|
3524
|
-
const scheduleAudioNode =
|
|
3784
|
+
const audioSyncAnchor = useMemo18(() => ({ value: 0 }), []);
|
|
3785
|
+
const prevEndTimes = useRef8({ scheduledEndTime: null, mediaEndTime: null });
|
|
3786
|
+
const scheduleAudioNode = useMemo18(() => {
|
|
3525
3787
|
return ({
|
|
3526
3788
|
node,
|
|
3527
3789
|
mediaTimestamp,
|
|
@@ -3576,7 +3838,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3576
3838
|
};
|
|
3577
3839
|
};
|
|
3578
3840
|
}, [audioContext, logLevel]);
|
|
3579
|
-
const refs =
|
|
3841
|
+
const refs = useMemo18(() => {
|
|
3580
3842
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
3581
3843
|
const ref = createRef2();
|
|
3582
3844
|
return {
|
|
@@ -3589,7 +3851,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3589
3851
|
};
|
|
3590
3852
|
});
|
|
3591
3853
|
}, [audioContext, numberOfAudioTags]);
|
|
3592
|
-
const effectToUse =
|
|
3854
|
+
const effectToUse = React16.useInsertionEffect ?? React16.useLayoutEffect;
|
|
3593
3855
|
effectToUse(() => {
|
|
3594
3856
|
return () => {
|
|
3595
3857
|
requestAnimationFrame(() => {
|
|
@@ -3599,7 +3861,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3599
3861
|
});
|
|
3600
3862
|
};
|
|
3601
3863
|
}, [refs]);
|
|
3602
|
-
const takenAudios =
|
|
3864
|
+
const takenAudios = useRef8(new Array(numberOfAudioTags).fill(false));
|
|
3603
3865
|
const rerenderAudios = useCallback7(() => {
|
|
3604
3866
|
refs.forEach(({ ref, id }) => {
|
|
3605
3867
|
const data = audios.current?.find((a) => a.id === id);
|
|
@@ -3715,7 +3977,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3715
3977
|
});
|
|
3716
3978
|
audioContext?.resume();
|
|
3717
3979
|
}, [audioContext, logLevel, mountTime, refs, env.isPlayer]);
|
|
3718
|
-
const value =
|
|
3980
|
+
const value = useMemo18(() => {
|
|
3719
3981
|
return {
|
|
3720
3982
|
registerAudio,
|
|
3721
3983
|
unregisterAudio,
|
|
@@ -3736,11 +3998,11 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3736
3998
|
audioSyncAnchor,
|
|
3737
3999
|
scheduleAudioNode
|
|
3738
4000
|
]);
|
|
3739
|
-
return /* @__PURE__ */
|
|
4001
|
+
return /* @__PURE__ */ jsxs22(SharedAudioContext.Provider, {
|
|
3740
4002
|
value,
|
|
3741
4003
|
children: [
|
|
3742
4004
|
refs.map(({ id, ref }) => {
|
|
3743
|
-
return /* @__PURE__ */
|
|
4005
|
+
return /* @__PURE__ */ jsx18("audio", {
|
|
3744
4006
|
ref,
|
|
3745
4007
|
preload: "metadata",
|
|
3746
4008
|
src: EMPTY_AUDIO
|
|
@@ -3756,12 +4018,12 @@ var useSharedAudio = ({
|
|
|
3756
4018
|
premounting,
|
|
3757
4019
|
postmounting
|
|
3758
4020
|
}) => {
|
|
3759
|
-
const ctx =
|
|
4021
|
+
const ctx = useContext18(SharedAudioContext);
|
|
3760
4022
|
const [elem] = useState9(() => {
|
|
3761
4023
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
3762
4024
|
return ctx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
3763
4025
|
}
|
|
3764
|
-
const el =
|
|
4026
|
+
const el = React16.createRef();
|
|
3765
4027
|
const mediaElementSourceNode = ctx?.audioContext ? makeSharedElementSourceNode({
|
|
3766
4028
|
audioContext: ctx.audioContext,
|
|
3767
4029
|
ref: el
|
|
@@ -3780,7 +4042,7 @@ var useSharedAudio = ({
|
|
|
3780
4042
|
}
|
|
3781
4043
|
};
|
|
3782
4044
|
});
|
|
3783
|
-
const effectToUse =
|
|
4045
|
+
const effectToUse = React16.useInsertionEffect ?? React16.useLayoutEffect;
|
|
3784
4046
|
if (typeof document !== "undefined") {
|
|
3785
4047
|
effectToUse(() => {
|
|
3786
4048
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
@@ -3887,9 +4149,9 @@ var useAppendVideoFragment = ({
|
|
|
3887
4149
|
duration: initialDuration,
|
|
3888
4150
|
fps
|
|
3889
4151
|
}) => {
|
|
3890
|
-
const actualFromRef =
|
|
3891
|
-
const actualDuration =
|
|
3892
|
-
const actualSrc =
|
|
4152
|
+
const actualFromRef = useRef9(initialActualFrom);
|
|
4153
|
+
const actualDuration = useRef9(initialDuration);
|
|
4154
|
+
const actualSrc = useRef9(initialActualSrc);
|
|
3893
4155
|
if (!isSubsetOfDuration({
|
|
3894
4156
|
prevStartFrom: actualFromRef.current,
|
|
3895
4157
|
newStartFrom: initialActualFrom,
|
|
@@ -3926,10 +4188,10 @@ var useVolume = ({
|
|
|
3926
4188
|
source,
|
|
3927
4189
|
shouldUseWebAudioApi
|
|
3928
4190
|
}) => {
|
|
3929
|
-
const audioStuffRef =
|
|
3930
|
-
const currentVolumeRef =
|
|
4191
|
+
const audioStuffRef = useRef10(null);
|
|
4192
|
+
const currentVolumeRef = useRef10(volume);
|
|
3931
4193
|
currentVolumeRef.current = volume;
|
|
3932
|
-
const sharedAudioContext =
|
|
4194
|
+
const sharedAudioContext = useContext19(SharedAudioContext);
|
|
3933
4195
|
if (!sharedAudioContext) {
|
|
3934
4196
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
3935
4197
|
}
|
|
@@ -3984,7 +4246,7 @@ var useVolume = ({
|
|
|
3984
4246
|
return audioStuffRef;
|
|
3985
4247
|
};
|
|
3986
4248
|
var useMediaStartsAt = () => {
|
|
3987
|
-
const parentSequence =
|
|
4249
|
+
const parentSequence = useContext20(SequenceContext);
|
|
3988
4250
|
const startsAt = Math.min(0, parentSequence?.relativeFrom ?? 0);
|
|
3989
4251
|
return startsAt;
|
|
3990
4252
|
};
|
|
@@ -4049,7 +4311,7 @@ var useBasicMediaInTimeline = ({
|
|
|
4049
4311
|
throw new Error("No src passed");
|
|
4050
4312
|
}
|
|
4051
4313
|
const startsAt = useMediaStartsAt();
|
|
4052
|
-
const parentSequence =
|
|
4314
|
+
const parentSequence = useContext21(SequenceContext);
|
|
4053
4315
|
const videoConfig = useVideoConfig();
|
|
4054
4316
|
const [initialVolume] = useState10(() => volume);
|
|
4055
4317
|
const mediaDuration = calculateMediaDuration({
|
|
@@ -4059,7 +4321,7 @@ var useBasicMediaInTimeline = ({
|
|
|
4059
4321
|
trimAfter
|
|
4060
4322
|
});
|
|
4061
4323
|
const duration = parentSequence ? Math.min(parentSequence.durationInFrames, mediaDuration) : mediaDuration;
|
|
4062
|
-
const volumes =
|
|
4324
|
+
const volumes = useMemo19(() => {
|
|
4063
4325
|
if (typeof volume === "number") {
|
|
4064
4326
|
return volume;
|
|
4065
4327
|
}
|
|
@@ -4071,7 +4333,7 @@ var useBasicMediaInTimeline = ({
|
|
|
4071
4333
|
});
|
|
4072
4334
|
}).join(",");
|
|
4073
4335
|
}, [duration, startsAt, volume, mediaVolume]);
|
|
4074
|
-
|
|
4336
|
+
useEffect6(() => {
|
|
4075
4337
|
if (typeof volume === "number" && volume !== initialVolume) {
|
|
4076
4338
|
warnOnce2(`Remotion: The ${mediaType} with src ${src} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`);
|
|
4077
4339
|
}
|
|
@@ -4098,10 +4360,11 @@ var useImageInTimeline = ({
|
|
|
4098
4360
|
showInTimeline,
|
|
4099
4361
|
premountDisplay,
|
|
4100
4362
|
postmountDisplay,
|
|
4101
|
-
loopDisplay
|
|
4363
|
+
loopDisplay,
|
|
4364
|
+
controls
|
|
4102
4365
|
}) => {
|
|
4103
|
-
const parentSequence =
|
|
4104
|
-
const { registerSequence, unregisterSequence } =
|
|
4366
|
+
const parentSequence = useContext21(SequenceContext);
|
|
4367
|
+
const { registerSequence, unregisterSequence } = useContext21(SequenceManager);
|
|
4105
4368
|
const { duration, nonce, rootId, isStudio, finalDisplayName } = useBasicMediaInTimeline({
|
|
4106
4369
|
volume: undefined,
|
|
4107
4370
|
mediaVolume: 0,
|
|
@@ -4112,7 +4375,7 @@ var useImageInTimeline = ({
|
|
|
4112
4375
|
trimBefore: undefined,
|
|
4113
4376
|
playbackRate: 1
|
|
4114
4377
|
});
|
|
4115
|
-
|
|
4378
|
+
useEffect6(() => {
|
|
4116
4379
|
if (!src) {
|
|
4117
4380
|
throw new Error("No src passed");
|
|
4118
4381
|
}
|
|
@@ -4137,7 +4400,7 @@ var useImageInTimeline = ({
|
|
|
4137
4400
|
stack,
|
|
4138
4401
|
premountDisplay,
|
|
4139
4402
|
postmountDisplay,
|
|
4140
|
-
controls
|
|
4403
|
+
controls
|
|
4141
4404
|
});
|
|
4142
4405
|
return () => {
|
|
4143
4406
|
unregisterSequence(id);
|
|
@@ -4157,7 +4420,8 @@ var useImageInTimeline = ({
|
|
|
4157
4420
|
isStudio,
|
|
4158
4421
|
loopDisplay,
|
|
4159
4422
|
rootId,
|
|
4160
|
-
finalDisplayName
|
|
4423
|
+
finalDisplayName,
|
|
4424
|
+
controls
|
|
4161
4425
|
]);
|
|
4162
4426
|
};
|
|
4163
4427
|
var useMediaInTimeline = ({
|
|
@@ -4174,9 +4438,9 @@ var useMediaInTimeline = ({
|
|
|
4174
4438
|
postmountDisplay,
|
|
4175
4439
|
loopDisplay
|
|
4176
4440
|
}) => {
|
|
4177
|
-
const parentSequence =
|
|
4441
|
+
const parentSequence = useContext21(SequenceContext);
|
|
4178
4442
|
const startsAt = useMediaStartsAt();
|
|
4179
|
-
const { registerSequence, unregisterSequence } =
|
|
4443
|
+
const { registerSequence, unregisterSequence } = useContext21(SequenceManager);
|
|
4180
4444
|
const {
|
|
4181
4445
|
volumes,
|
|
4182
4446
|
duration,
|
|
@@ -4195,7 +4459,7 @@ var useMediaInTimeline = ({
|
|
|
4195
4459
|
trimBefore: undefined,
|
|
4196
4460
|
playbackRate
|
|
4197
4461
|
});
|
|
4198
|
-
|
|
4462
|
+
useEffect6(() => {
|
|
4199
4463
|
if (!src) {
|
|
4200
4464
|
throw new Error("No src passed");
|
|
4201
4465
|
}
|
|
@@ -4258,7 +4522,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
4258
4522
|
const [onResumeCallbacks, setOnResumeCallbacks] = useState11([]);
|
|
4259
4523
|
const env = useRemotionEnvironment();
|
|
4260
4524
|
const rendering = env.isRendering;
|
|
4261
|
-
const buffering =
|
|
4525
|
+
const buffering = useRef11(false);
|
|
4262
4526
|
const addBlock = useCallback8((block) => {
|
|
4263
4527
|
if (rendering) {
|
|
4264
4528
|
return {
|
|
@@ -4296,7 +4560,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
4296
4560
|
}
|
|
4297
4561
|
};
|
|
4298
4562
|
}, []);
|
|
4299
|
-
|
|
4563
|
+
useEffect7(() => {
|
|
4300
4564
|
if (rendering) {
|
|
4301
4565
|
return;
|
|
4302
4566
|
}
|
|
@@ -4326,22 +4590,22 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
4326
4590
|
}
|
|
4327
4591
|
}, [blocks]);
|
|
4328
4592
|
}
|
|
4329
|
-
return
|
|
4593
|
+
return useMemo20(() => {
|
|
4330
4594
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
4331
4595
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
4332
4596
|
};
|
|
4333
|
-
var BufferingContextReact =
|
|
4597
|
+
var BufferingContextReact = React17.createContext(null);
|
|
4334
4598
|
var BufferingProvider = ({ children }) => {
|
|
4335
|
-
const { logLevel, mountTime } =
|
|
4599
|
+
const { logLevel, mountTime } = useContext22(LogLevelContext);
|
|
4336
4600
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
|
|
4337
|
-
return /* @__PURE__ */
|
|
4601
|
+
return /* @__PURE__ */ jsx19(BufferingContextReact.Provider, {
|
|
4338
4602
|
value: bufferManager,
|
|
4339
4603
|
children
|
|
4340
4604
|
});
|
|
4341
4605
|
};
|
|
4342
4606
|
var useIsPlayerBuffering = (bufferManager) => {
|
|
4343
4607
|
const [isBuffering, setIsBuffering] = useState11(bufferManager.buffering.current);
|
|
4344
|
-
|
|
4608
|
+
useEffect7(() => {
|
|
4345
4609
|
const onBuffer = () => {
|
|
4346
4610
|
setIsBuffering(true);
|
|
4347
4611
|
};
|
|
@@ -4362,9 +4626,9 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
4362
4626
|
return isBuffering;
|
|
4363
4627
|
};
|
|
4364
4628
|
var useBufferState = () => {
|
|
4365
|
-
const buffer =
|
|
4629
|
+
const buffer = useContext23(BufferingContextReact);
|
|
4366
4630
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
4367
|
-
return
|
|
4631
|
+
return useMemo21(() => ({
|
|
4368
4632
|
delayPlayback: () => {
|
|
4369
4633
|
if (!addBlock) {
|
|
4370
4634
|
throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
|
|
@@ -4388,7 +4652,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
4388
4652
|
logLevel,
|
|
4389
4653
|
mountTime
|
|
4390
4654
|
}) => {
|
|
4391
|
-
const bufferingRef =
|
|
4655
|
+
const bufferingRef = useRef12(false);
|
|
4392
4656
|
const { delayPlayback } = useBufferState();
|
|
4393
4657
|
const bufferUntilFirstFrame = useCallback9((requestedTime) => {
|
|
4394
4658
|
if (mediaType !== "video") {
|
|
@@ -4461,7 +4725,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
4461
4725
|
onVariableFpsVideoDetected,
|
|
4462
4726
|
pauseWhenBuffering
|
|
4463
4727
|
]);
|
|
4464
|
-
return
|
|
4728
|
+
return useMemo22(() => {
|
|
4465
4729
|
return {
|
|
4466
4730
|
isBuffering: () => bufferingRef.current,
|
|
4467
4731
|
bufferUntilFirstFrame
|
|
@@ -4469,7 +4733,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
4469
4733
|
}, [bufferUntilFirstFrame]);
|
|
4470
4734
|
};
|
|
4471
4735
|
var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
|
|
4472
|
-
const lastUpdate =
|
|
4736
|
+
const lastUpdate = React18.useRef({
|
|
4473
4737
|
time: mediaRef.current?.currentTime ?? 0,
|
|
4474
4738
|
lastUpdate: performance.now()
|
|
4475
4739
|
});
|
|
@@ -4510,7 +4774,7 @@ var useMediaBuffering = ({
|
|
|
4510
4774
|
}) => {
|
|
4511
4775
|
const buffer = useBufferState();
|
|
4512
4776
|
const [isBuffering, setIsBuffering] = useState12(false);
|
|
4513
|
-
|
|
4777
|
+
useEffect8(() => {
|
|
4514
4778
|
let cleanupFns = [];
|
|
4515
4779
|
const { current } = element;
|
|
4516
4780
|
if (!current) {
|
|
@@ -4642,8 +4906,8 @@ var useRequestVideoCallbackTime = ({
|
|
|
4642
4906
|
lastSeek,
|
|
4643
4907
|
onVariableFpsVideoDetected
|
|
4644
4908
|
}) => {
|
|
4645
|
-
const currentTime =
|
|
4646
|
-
|
|
4909
|
+
const currentTime = useRef13(null);
|
|
4910
|
+
useEffect9(() => {
|
|
4647
4911
|
const { current } = mediaRef;
|
|
4648
4912
|
if (current) {
|
|
4649
4913
|
currentTime.current = {
|
|
@@ -4867,17 +5131,17 @@ var useMediaPlayback = ({
|
|
|
4867
5131
|
const frame = useCurrentFrame();
|
|
4868
5132
|
const absoluteFrame = useTimelinePosition();
|
|
4869
5133
|
const [playing] = usePlayingState();
|
|
4870
|
-
const buffering =
|
|
5134
|
+
const buffering = useContext24(BufferingContextReact);
|
|
4871
5135
|
const { fps } = useVideoConfig();
|
|
4872
5136
|
const mediaStartsAt = useMediaStartsAt();
|
|
4873
|
-
const lastSeekDueToShift =
|
|
4874
|
-
const lastSeek =
|
|
5137
|
+
const lastSeekDueToShift = useRef14(null);
|
|
5138
|
+
const lastSeek = useRef14(null);
|
|
4875
5139
|
const logLevel = useLogLevel();
|
|
4876
5140
|
const mountTime = useMountTime();
|
|
4877
5141
|
if (!buffering) {
|
|
4878
5142
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
4879
5143
|
}
|
|
4880
|
-
const isVariableFpsVideoMap =
|
|
5144
|
+
const isVariableFpsVideoMap = useRef14({});
|
|
4881
5145
|
const onVariableFpsVideoDetected = useCallback10(() => {
|
|
4882
5146
|
if (!src) {
|
|
4883
5147
|
return;
|
|
@@ -4929,7 +5193,7 @@ var useMediaPlayback = ({
|
|
|
4929
5193
|
return acceptableTimeshift ?? defaultAcceptableTimeshift;
|
|
4930
5194
|
})();
|
|
4931
5195
|
const isPlayerBuffering = useIsPlayerBuffering(buffering);
|
|
4932
|
-
|
|
5196
|
+
useEffect10(() => {
|
|
4933
5197
|
if (mediaRef.current?.paused) {
|
|
4934
5198
|
return;
|
|
4935
5199
|
}
|
|
@@ -4974,7 +5238,7 @@ var useMediaPlayback = ({
|
|
|
4974
5238
|
mediaRef.current.playbackRate = playbackRateToSet;
|
|
4975
5239
|
}
|
|
4976
5240
|
}, [mediaRef, playbackRate]);
|
|
4977
|
-
|
|
5241
|
+
useEffect10(() => {
|
|
4978
5242
|
const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
|
|
4979
5243
|
if (!mediaRef.current) {
|
|
4980
5244
|
throw new Error(`No ${mediaType} ref found`);
|
|
@@ -5103,7 +5367,7 @@ var useMediaTag = ({
|
|
|
5103
5367
|
const logLevel = useLogLevel();
|
|
5104
5368
|
const mountTime = useMountTime();
|
|
5105
5369
|
const env = useRemotionEnvironment();
|
|
5106
|
-
|
|
5370
|
+
useEffect11(() => {
|
|
5107
5371
|
const tag = {
|
|
5108
5372
|
id,
|
|
5109
5373
|
play: (reason) => {
|
|
@@ -5142,11 +5406,11 @@ var useMediaTag = ({
|
|
|
5142
5406
|
env.isPlayer
|
|
5143
5407
|
]);
|
|
5144
5408
|
};
|
|
5145
|
-
var MediaVolumeContext =
|
|
5409
|
+
var MediaVolumeContext = createContext19({
|
|
5146
5410
|
mediaMuted: false,
|
|
5147
5411
|
mediaVolume: 1
|
|
5148
5412
|
});
|
|
5149
|
-
var SetMediaVolumeContext =
|
|
5413
|
+
var SetMediaVolumeContext = createContext19({
|
|
5150
5414
|
setMediaMuted: () => {
|
|
5151
5415
|
throw new Error("default");
|
|
5152
5416
|
},
|
|
@@ -5155,16 +5419,16 @@ var SetMediaVolumeContext = createContext18({
|
|
|
5155
5419
|
}
|
|
5156
5420
|
});
|
|
5157
5421
|
var useMediaVolumeState = () => {
|
|
5158
|
-
const { mediaVolume } =
|
|
5159
|
-
const { setMediaVolume } =
|
|
5160
|
-
return
|
|
5422
|
+
const { mediaVolume } = useContext25(MediaVolumeContext);
|
|
5423
|
+
const { setMediaVolume } = useContext25(SetMediaVolumeContext);
|
|
5424
|
+
return useMemo23(() => {
|
|
5161
5425
|
return [mediaVolume, setMediaVolume];
|
|
5162
5426
|
}, [mediaVolume, setMediaVolume]);
|
|
5163
5427
|
};
|
|
5164
5428
|
var useMediaMutedState = () => {
|
|
5165
|
-
const { mediaMuted } =
|
|
5166
|
-
const { setMediaMuted } =
|
|
5167
|
-
return
|
|
5429
|
+
const { mediaMuted } = useContext25(MediaVolumeContext);
|
|
5430
|
+
const { setMediaMuted } = useContext25(SetMediaVolumeContext);
|
|
5431
|
+
return useMemo23(() => {
|
|
5168
5432
|
return [mediaMuted, setMediaMuted];
|
|
5169
5433
|
}, [mediaMuted, setMediaMuted]);
|
|
5170
5434
|
};
|
|
@@ -5213,12 +5477,12 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5213
5477
|
const [mediaVolume] = useMediaVolumeState();
|
|
5214
5478
|
const [mediaMuted] = useMediaMutedState();
|
|
5215
5479
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
5216
|
-
const { hidden } =
|
|
5480
|
+
const { hidden } = useContext26(SequenceVisibilityToggleContext);
|
|
5217
5481
|
if (!src) {
|
|
5218
5482
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
5219
5483
|
}
|
|
5220
5484
|
const preloadedSrc = usePreload(src);
|
|
5221
|
-
const sequenceContext =
|
|
5485
|
+
const sequenceContext = useContext26(SequenceContext);
|
|
5222
5486
|
const [timelineId] = useState13(() => String(Math.random()));
|
|
5223
5487
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
5224
5488
|
const userPreferredVolume = evaluateVolume({
|
|
@@ -5232,7 +5496,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5232
5496
|
requestsVideoFrame: false,
|
|
5233
5497
|
isClientSideRendering: false
|
|
5234
5498
|
});
|
|
5235
|
-
const propsToPass =
|
|
5499
|
+
const propsToPass = useMemo24(() => {
|
|
5236
5500
|
return {
|
|
5237
5501
|
muted: muted || mediaMuted || isSequenceHidden || userPreferredVolume <= 0,
|
|
5238
5502
|
src: preloadedSrc,
|
|
@@ -5250,7 +5514,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5250
5514
|
userPreferredVolume,
|
|
5251
5515
|
crossOriginValue
|
|
5252
5516
|
]);
|
|
5253
|
-
const id =
|
|
5517
|
+
const id = useMemo24(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
|
|
5254
5518
|
src,
|
|
5255
5519
|
sequenceContext?.relativeFrom,
|
|
5256
5520
|
sequenceContext?.cumulatedFrom,
|
|
@@ -5309,7 +5573,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5309
5573
|
volume: userPreferredVolume,
|
|
5310
5574
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
5311
5575
|
});
|
|
5312
|
-
const effectToUse =
|
|
5576
|
+
const effectToUse = React19.useInsertionEffect ?? React19.useLayoutEffect;
|
|
5313
5577
|
effectToUse(() => {
|
|
5314
5578
|
return () => {
|
|
5315
5579
|
requestAnimationFrame(() => {
|
|
@@ -5320,9 +5584,9 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5320
5584
|
useImperativeHandle4(ref, () => {
|
|
5321
5585
|
return audioRef.current;
|
|
5322
5586
|
}, [audioRef]);
|
|
5323
|
-
const currentOnDurationCallback =
|
|
5587
|
+
const currentOnDurationCallback = useRef15(onDuration);
|
|
5324
5588
|
currentOnDurationCallback.current = onDuration;
|
|
5325
|
-
|
|
5589
|
+
useEffect12(() => {
|
|
5326
5590
|
const { current } = audioRef;
|
|
5327
5591
|
if (!current) {
|
|
5328
5592
|
return;
|
|
@@ -5342,7 +5606,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5342
5606
|
if (initialShouldPreMountAudioElements) {
|
|
5343
5607
|
return null;
|
|
5344
5608
|
}
|
|
5345
|
-
return /* @__PURE__ */
|
|
5609
|
+
return /* @__PURE__ */ jsx20("audio", {
|
|
5346
5610
|
ref: audioRef,
|
|
5347
5611
|
preload: "metadata",
|
|
5348
5612
|
crossOrigin: crossOriginValue,
|
|
@@ -5351,7 +5615,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5351
5615
|
};
|
|
5352
5616
|
var AudioForPreview = forwardRef4(AudioForDevelopmentForwardRefFunction);
|
|
5353
5617
|
var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
5354
|
-
const audioRef =
|
|
5618
|
+
const audioRef = useRef16(null);
|
|
5355
5619
|
const {
|
|
5356
5620
|
volume: volumeProp,
|
|
5357
5621
|
playbackRate,
|
|
@@ -5373,10 +5637,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
5373
5637
|
const absoluteFrame = useTimelinePosition();
|
|
5374
5638
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
5375
5639
|
const frame = useCurrentFrame();
|
|
5376
|
-
const sequenceContext =
|
|
5377
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
5640
|
+
const sequenceContext = useContext27(SequenceContext);
|
|
5641
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext27(RenderAssetManager);
|
|
5378
5642
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
5379
|
-
const id =
|
|
5643
|
+
const id = useMemo25(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
5380
5644
|
props.src,
|
|
5381
5645
|
sequenceContext?.relativeFrom,
|
|
5382
5646
|
sequenceContext?.cumulatedFrom,
|
|
@@ -5391,7 +5655,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
5391
5655
|
useImperativeHandle5(ref, () => {
|
|
5392
5656
|
return audioRef.current;
|
|
5393
5657
|
}, []);
|
|
5394
|
-
|
|
5658
|
+
useEffect13(() => {
|
|
5395
5659
|
if (!props.src) {
|
|
5396
5660
|
throw new Error("No src passed");
|
|
5397
5661
|
}
|
|
@@ -5475,7 +5739,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
5475
5739
|
if (!needsToRenderAudioTag) {
|
|
5476
5740
|
return null;
|
|
5477
5741
|
}
|
|
5478
|
-
return /* @__PURE__ */
|
|
5742
|
+
return /* @__PURE__ */ jsx21("audio", {
|
|
5479
5743
|
ref: audioRef,
|
|
5480
5744
|
...nativeProps,
|
|
5481
5745
|
onError: onNativeError
|
|
@@ -5483,7 +5747,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
5483
5747
|
};
|
|
5484
5748
|
var AudioForRendering = forwardRef5(AudioForRenderingRefForwardingFunction);
|
|
5485
5749
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
5486
|
-
const audioContext =
|
|
5750
|
+
const audioContext = useContext28(SharedAudioContext);
|
|
5487
5751
|
const {
|
|
5488
5752
|
startFrom,
|
|
5489
5753
|
endAt,
|
|
@@ -5502,7 +5766,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5502
5766
|
if (environment.isClientSideRendering) {
|
|
5503
5767
|
throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
5504
5768
|
}
|
|
5505
|
-
const { durations, setDurations } =
|
|
5769
|
+
const { durations, setDurations } = useContext28(DurationsContext);
|
|
5506
5770
|
if (typeof props.src !== "string") {
|
|
5507
5771
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
5508
5772
|
}
|
|
@@ -5534,14 +5798,14 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5534
5798
|
});
|
|
5535
5799
|
if (loop && durationFetched !== undefined) {
|
|
5536
5800
|
if (!Number.isFinite(durationFetched)) {
|
|
5537
|
-
return /* @__PURE__ */
|
|
5801
|
+
return /* @__PURE__ */ jsx222(Html5Audio, {
|
|
5538
5802
|
...propsOtherThanLoop,
|
|
5539
5803
|
ref,
|
|
5540
5804
|
_remotionInternalNativeLoopPassed: true
|
|
5541
5805
|
});
|
|
5542
5806
|
}
|
|
5543
5807
|
const duration = durationFetched * fps;
|
|
5544
|
-
return /* @__PURE__ */
|
|
5808
|
+
return /* @__PURE__ */ jsx222(Loop, {
|
|
5545
5809
|
layout: "none",
|
|
5546
5810
|
durationInFrames: calculateMediaDuration({
|
|
5547
5811
|
trimAfter: trimAfterValue,
|
|
@@ -5549,7 +5813,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5549
5813
|
playbackRate: props.playbackRate ?? 1,
|
|
5550
5814
|
trimBefore: trimBeforeValue
|
|
5551
5815
|
}),
|
|
5552
|
-
children: /* @__PURE__ */
|
|
5816
|
+
children: /* @__PURE__ */ jsx222(Html5Audio, {
|
|
5553
5817
|
...propsOtherThanLoop,
|
|
5554
5818
|
ref,
|
|
5555
5819
|
_remotionInternalNativeLoopPassed: true
|
|
@@ -5557,13 +5821,13 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5557
5821
|
});
|
|
5558
5822
|
}
|
|
5559
5823
|
if (typeof trimBeforeValue !== "undefined" || typeof trimAfterValue !== "undefined") {
|
|
5560
|
-
return /* @__PURE__ */
|
|
5824
|
+
return /* @__PURE__ */ jsx222(Sequence, {
|
|
5561
5825
|
layout: "none",
|
|
5562
5826
|
from: 0 - (trimBeforeValue ?? 0),
|
|
5563
5827
|
showInTimeline: false,
|
|
5564
5828
|
durationInFrames: trimAfterValue,
|
|
5565
5829
|
name,
|
|
5566
|
-
children: /* @__PURE__ */
|
|
5830
|
+
children: /* @__PURE__ */ jsx222(Html5Audio, {
|
|
5567
5831
|
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
5568
5832
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
5569
5833
|
...otherProps,
|
|
@@ -5573,7 +5837,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5573
5837
|
}
|
|
5574
5838
|
validateMediaProps({ playbackRate: props.playbackRate, volume: props.volume }, "Html5Audio");
|
|
5575
5839
|
if (environment.isRendering) {
|
|
5576
|
-
return /* @__PURE__ */
|
|
5840
|
+
return /* @__PURE__ */ jsx222(AudioForRendering, {
|
|
5577
5841
|
onDuration,
|
|
5578
5842
|
...props,
|
|
5579
5843
|
ref,
|
|
@@ -5581,7 +5845,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5581
5845
|
_remotionInternalNeedsDurationCalculation: Boolean(loop)
|
|
5582
5846
|
});
|
|
5583
5847
|
}
|
|
5584
|
-
return /* @__PURE__ */
|
|
5848
|
+
return /* @__PURE__ */ jsx222(AudioForPreview, {
|
|
5585
5849
|
_remotionInternalNativeLoopPassed: props._remotionInternalNativeLoopPassed ?? false,
|
|
5586
5850
|
_remotionInternalStack: stack ?? null,
|
|
5587
5851
|
shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0,
|
|
@@ -5597,266 +5861,6 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5597
5861
|
var Html5Audio = forwardRef6(AudioRefForwardingFunction);
|
|
5598
5862
|
addSequenceStackTraces(Html5Audio);
|
|
5599
5863
|
var Audio = Html5Audio;
|
|
5600
|
-
var getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
5601
|
-
var invalidFolderNameErrorMessage = `Folder name must match ${String(getRegex())}`;
|
|
5602
|
-
var FolderContext = createContext19({
|
|
5603
|
-
folderName: null,
|
|
5604
|
-
parentName: null
|
|
5605
|
-
});
|
|
5606
|
-
var rotate = {
|
|
5607
|
-
transform: `rotate(90deg)`
|
|
5608
|
-
};
|
|
5609
|
-
var ICON_SIZE = 40;
|
|
5610
|
-
var label = {
|
|
5611
|
-
color: "white",
|
|
5612
|
-
fontSize: 14,
|
|
5613
|
-
fontFamily: "sans-serif"
|
|
5614
|
-
};
|
|
5615
|
-
var container = {
|
|
5616
|
-
justifyContent: "center",
|
|
5617
|
-
alignItems: "center"
|
|
5618
|
-
};
|
|
5619
|
-
var Loading = () => {
|
|
5620
|
-
return /* @__PURE__ */ jsxs22(AbsoluteFill, {
|
|
5621
|
-
style: container,
|
|
5622
|
-
id: "remotion-comp-loading",
|
|
5623
|
-
children: [
|
|
5624
|
-
/* @__PURE__ */ jsx21("style", {
|
|
5625
|
-
type: "text/css",
|
|
5626
|
-
children: `
|
|
5627
|
-
@keyframes anim {
|
|
5628
|
-
from {
|
|
5629
|
-
opacity: 0
|
|
5630
|
-
}
|
|
5631
|
-
to {
|
|
5632
|
-
opacity: 1
|
|
5633
|
-
}
|
|
5634
|
-
}
|
|
5635
|
-
#remotion-comp-loading {
|
|
5636
|
-
animation: anim 2s;
|
|
5637
|
-
animation-fill-mode: forwards;
|
|
5638
|
-
}
|
|
5639
|
-
`
|
|
5640
|
-
}),
|
|
5641
|
-
/* @__PURE__ */ jsx21("svg", {
|
|
5642
|
-
width: ICON_SIZE,
|
|
5643
|
-
height: ICON_SIZE,
|
|
5644
|
-
viewBox: "-100 -100 400 400",
|
|
5645
|
-
style: rotate,
|
|
5646
|
-
children: /* @__PURE__ */ jsx21("path", {
|
|
5647
|
-
fill: "#555",
|
|
5648
|
-
stroke: "#555",
|
|
5649
|
-
strokeWidth: "100",
|
|
5650
|
-
strokeLinejoin: "round",
|
|
5651
|
-
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"
|
|
5652
|
-
})
|
|
5653
|
-
}),
|
|
5654
|
-
/* @__PURE__ */ jsxs22("p", {
|
|
5655
|
-
style: label,
|
|
5656
|
-
children: [
|
|
5657
|
-
"Resolving ",
|
|
5658
|
-
"<Suspense>",
|
|
5659
|
-
"..."
|
|
5660
|
-
]
|
|
5661
|
-
})
|
|
5662
|
-
]
|
|
5663
|
-
});
|
|
5664
|
-
};
|
|
5665
|
-
var _portalNode = null;
|
|
5666
|
-
var portalNode = () => {
|
|
5667
|
-
if (!_portalNode) {
|
|
5668
|
-
if (typeof document === "undefined") {
|
|
5669
|
-
throw new Error("Tried to call an API that only works in the browser from outside the browser");
|
|
5670
|
-
}
|
|
5671
|
-
_portalNode = document.createElement("div");
|
|
5672
|
-
_portalNode.style.position = "absolute";
|
|
5673
|
-
_portalNode.style.top = "0px";
|
|
5674
|
-
_portalNode.style.left = "0px";
|
|
5675
|
-
_portalNode.style.right = "0px";
|
|
5676
|
-
_portalNode.style.bottom = "0px";
|
|
5677
|
-
_portalNode.style.width = "100%";
|
|
5678
|
-
_portalNode.style.height = "100%";
|
|
5679
|
-
_portalNode.style.display = "flex";
|
|
5680
|
-
_portalNode.style.flexDirection = "column";
|
|
5681
|
-
const containerNode = document.createElement("div");
|
|
5682
|
-
containerNode.style.position = "fixed";
|
|
5683
|
-
containerNode.style.top = -999999 + "px";
|
|
5684
|
-
containerNode.appendChild(_portalNode);
|
|
5685
|
-
document.body.appendChild(containerNode);
|
|
5686
|
-
}
|
|
5687
|
-
return _portalNode;
|
|
5688
|
-
};
|
|
5689
|
-
var useLazyComponent = ({
|
|
5690
|
-
compProps,
|
|
5691
|
-
componentName,
|
|
5692
|
-
noSuspense
|
|
5693
|
-
}) => {
|
|
5694
|
-
const componentRef = useRef16(null);
|
|
5695
|
-
if ("component" in compProps) {
|
|
5696
|
-
componentRef.current = compProps.component;
|
|
5697
|
-
}
|
|
5698
|
-
const lazy = useMemo25(() => {
|
|
5699
|
-
if ("component" in compProps) {
|
|
5700
|
-
if (typeof document === "undefined" || noSuspense) {
|
|
5701
|
-
return compProps.component;
|
|
5702
|
-
}
|
|
5703
|
-
if (typeof compProps.component === "undefined") {
|
|
5704
|
-
throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
5705
|
-
}
|
|
5706
|
-
const Wrapper = (props2) => {
|
|
5707
|
-
const Comp = componentRef.current;
|
|
5708
|
-
return React20.createElement(Comp, props2);
|
|
5709
|
-
};
|
|
5710
|
-
return Wrapper;
|
|
5711
|
-
}
|
|
5712
|
-
if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
|
|
5713
|
-
if (typeof compProps.lazyComponent === "undefined") {
|
|
5714
|
-
throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
5715
|
-
}
|
|
5716
|
-
return React20.lazy(compProps.lazyComponent);
|
|
5717
|
-
}
|
|
5718
|
-
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
5719
|
-
}, [compProps.lazyComponent]);
|
|
5720
|
-
return lazy;
|
|
5721
|
-
};
|
|
5722
|
-
var getRegex2 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
5723
|
-
var isCompositionIdValid = (id) => id.match(getRegex2());
|
|
5724
|
-
var validateCompositionId = (id) => {
|
|
5725
|
-
if (!isCompositionIdValid(id)) {
|
|
5726
|
-
throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`);
|
|
5727
|
-
}
|
|
5728
|
-
};
|
|
5729
|
-
var invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex2())}`;
|
|
5730
|
-
var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
5731
|
-
if (!defaultProps) {
|
|
5732
|
-
return;
|
|
5733
|
-
}
|
|
5734
|
-
if (typeof defaultProps !== "object") {
|
|
5735
|
-
throw new Error(`"${name}" must be an object, but you passed a value of type ${typeof defaultProps}`);
|
|
5736
|
-
}
|
|
5737
|
-
if (Array.isArray(defaultProps)) {
|
|
5738
|
-
throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
|
|
5739
|
-
}
|
|
5740
|
-
};
|
|
5741
|
-
var Fallback = () => {
|
|
5742
|
-
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
5743
|
-
useEffect13(() => {
|
|
5744
|
-
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
5745
|
-
return () => continueRender2(fallback);
|
|
5746
|
-
}, [continueRender2, delayRender2]);
|
|
5747
|
-
return null;
|
|
5748
|
-
};
|
|
5749
|
-
var InnerComposition = ({
|
|
5750
|
-
width,
|
|
5751
|
-
height,
|
|
5752
|
-
fps,
|
|
5753
|
-
durationInFrames,
|
|
5754
|
-
id,
|
|
5755
|
-
defaultProps,
|
|
5756
|
-
schema,
|
|
5757
|
-
...compProps
|
|
5758
|
-
}) => {
|
|
5759
|
-
const compManager = useContext28(CompositionSetters);
|
|
5760
|
-
const { registerComposition, unregisterComposition } = compManager;
|
|
5761
|
-
const video = useVideo();
|
|
5762
|
-
const lazy = useLazyComponent({
|
|
5763
|
-
compProps,
|
|
5764
|
-
componentName: "Composition",
|
|
5765
|
-
noSuspense: false
|
|
5766
|
-
});
|
|
5767
|
-
const nonce = useNonce();
|
|
5768
|
-
const isPlayer = useIsPlayer();
|
|
5769
|
-
const environment = useRemotionEnvironment();
|
|
5770
|
-
const canUseComposition = useContext28(CanUseRemotionHooks);
|
|
5771
|
-
if (typeof window !== "undefined") {
|
|
5772
|
-
window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
|
|
5773
|
-
}
|
|
5774
|
-
if (canUseComposition) {
|
|
5775
|
-
if (isPlayer) {
|
|
5776
|
-
throw new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
5777
|
-
}
|
|
5778
|
-
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
5779
|
-
}
|
|
5780
|
-
const { folderName, parentName } = useContext28(FolderContext);
|
|
5781
|
-
useEffect13(() => {
|
|
5782
|
-
if (!id) {
|
|
5783
|
-
throw new Error("No id for composition passed.");
|
|
5784
|
-
}
|
|
5785
|
-
validateCompositionId(id);
|
|
5786
|
-
validateDefaultAndInputProps(defaultProps, "defaultProps", id);
|
|
5787
|
-
registerComposition({
|
|
5788
|
-
durationInFrames: durationInFrames ?? undefined,
|
|
5789
|
-
fps: fps ?? undefined,
|
|
5790
|
-
height: height ?? undefined,
|
|
5791
|
-
width: width ?? undefined,
|
|
5792
|
-
id,
|
|
5793
|
-
folderName,
|
|
5794
|
-
component: lazy,
|
|
5795
|
-
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
5796
|
-
nonce: nonce.get(),
|
|
5797
|
-
parentFolderName: parentName,
|
|
5798
|
-
schema: schema ?? null,
|
|
5799
|
-
calculateMetadata: compProps.calculateMetadata ?? null
|
|
5800
|
-
});
|
|
5801
|
-
return () => {
|
|
5802
|
-
unregisterComposition(id);
|
|
5803
|
-
};
|
|
5804
|
-
}, [
|
|
5805
|
-
durationInFrames,
|
|
5806
|
-
fps,
|
|
5807
|
-
height,
|
|
5808
|
-
lazy,
|
|
5809
|
-
id,
|
|
5810
|
-
folderName,
|
|
5811
|
-
defaultProps,
|
|
5812
|
-
width,
|
|
5813
|
-
nonce,
|
|
5814
|
-
parentName,
|
|
5815
|
-
schema,
|
|
5816
|
-
compProps.calculateMetadata,
|
|
5817
|
-
registerComposition,
|
|
5818
|
-
unregisterComposition
|
|
5819
|
-
]);
|
|
5820
|
-
const resolved = useResolvedVideoConfig(id);
|
|
5821
|
-
if (environment.isStudio && video && video.component === lazy && video.id === id) {
|
|
5822
|
-
const Comp = lazy;
|
|
5823
|
-
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
5824
|
-
return null;
|
|
5825
|
-
}
|
|
5826
|
-
return createPortal(/* @__PURE__ */ jsx222(CanUseRemotionHooksProvider, {
|
|
5827
|
-
children: /* @__PURE__ */ jsx222(Suspense, {
|
|
5828
|
-
fallback: /* @__PURE__ */ jsx222(Loading, {}),
|
|
5829
|
-
children: /* @__PURE__ */ jsx222(Comp, {
|
|
5830
|
-
...resolved.result.props ?? {}
|
|
5831
|
-
})
|
|
5832
|
-
})
|
|
5833
|
-
}), portalNode());
|
|
5834
|
-
}
|
|
5835
|
-
if (environment.isRendering && video && video.component === lazy && video.id === id) {
|
|
5836
|
-
const Comp = lazy;
|
|
5837
|
-
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
5838
|
-
return null;
|
|
5839
|
-
}
|
|
5840
|
-
return createPortal(/* @__PURE__ */ jsx222(CanUseRemotionHooksProvider, {
|
|
5841
|
-
children: /* @__PURE__ */ jsx222(Suspense, {
|
|
5842
|
-
fallback: /* @__PURE__ */ jsx222(Fallback, {}),
|
|
5843
|
-
children: /* @__PURE__ */ jsx222(Comp, {
|
|
5844
|
-
...resolved.result.props ?? {}
|
|
5845
|
-
})
|
|
5846
|
-
})
|
|
5847
|
-
}), portalNode());
|
|
5848
|
-
}
|
|
5849
|
-
return null;
|
|
5850
|
-
};
|
|
5851
|
-
var Composition = (props2) => {
|
|
5852
|
-
const { onlyRenderComposition } = useContext28(CompositionSetters);
|
|
5853
|
-
if (onlyRenderComposition && onlyRenderComposition !== props2.id) {
|
|
5854
|
-
return null;
|
|
5855
|
-
}
|
|
5856
|
-
return /* @__PURE__ */ jsx222(InnerComposition, {
|
|
5857
|
-
...props2
|
|
5858
|
-
});
|
|
5859
|
-
};
|
|
5860
5864
|
var kSplineTableSize = 11;
|
|
5861
5865
|
var kSampleStepSize = 1 / (kSplineTableSize - 1);
|
|
5862
5866
|
var IFrameRefForwarding = ({
|
|
@@ -5892,10 +5896,192 @@ var IFrameRefForwarding = ({
|
|
|
5892
5896
|
});
|
|
5893
5897
|
};
|
|
5894
5898
|
var IFrame = forwardRef7(IFrameRefForwarding);
|
|
5899
|
+
var getEffectiveVisualModeValue = ({
|
|
5900
|
+
codeValue,
|
|
5901
|
+
runtimeValue,
|
|
5902
|
+
dragOverrideValue,
|
|
5903
|
+
defaultValue,
|
|
5904
|
+
shouldResortToDefaultValueIfUndefined = false
|
|
5905
|
+
}) => {
|
|
5906
|
+
if (dragOverrideValue !== undefined) {
|
|
5907
|
+
return dragOverrideValue;
|
|
5908
|
+
}
|
|
5909
|
+
if (!codeValue) {
|
|
5910
|
+
return runtimeValue;
|
|
5911
|
+
}
|
|
5912
|
+
if (!codeValue.canUpdate) {
|
|
5913
|
+
return runtimeValue;
|
|
5914
|
+
}
|
|
5915
|
+
if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
|
|
5916
|
+
return defaultValue;
|
|
5917
|
+
}
|
|
5918
|
+
return codeValue.codeValue;
|
|
5919
|
+
};
|
|
5920
|
+
var useSchema = (schema, currentValue) => {
|
|
5921
|
+
const env = useRemotionEnvironment();
|
|
5922
|
+
const earlyReturn = useMemo26(() => {
|
|
5923
|
+
if (!env.isStudio || env.isReadOnlyStudio) {
|
|
5924
|
+
return {
|
|
5925
|
+
controls: undefined,
|
|
5926
|
+
values: currentValue ?? {}
|
|
5927
|
+
};
|
|
5928
|
+
}
|
|
5929
|
+
return;
|
|
5930
|
+
}, [env.isStudio, env.isReadOnlyStudio, currentValue]);
|
|
5931
|
+
if (earlyReturn) {
|
|
5932
|
+
return earlyReturn;
|
|
5933
|
+
}
|
|
5934
|
+
const [overrideId] = useState15(() => String(Math.random()));
|
|
5935
|
+
const {
|
|
5936
|
+
visualModeEnabled,
|
|
5937
|
+
dragOverrides: overrides,
|
|
5938
|
+
codeValues
|
|
5939
|
+
} = useContext29(VisualModeOverridesContext);
|
|
5940
|
+
const controls = useMemo26(() => {
|
|
5941
|
+
if (!visualModeEnabled) {
|
|
5942
|
+
return;
|
|
5943
|
+
}
|
|
5944
|
+
if (schema === null || currentValue === null) {
|
|
5945
|
+
return;
|
|
5946
|
+
}
|
|
5947
|
+
return {
|
|
5948
|
+
schema,
|
|
5949
|
+
currentValue,
|
|
5950
|
+
overrideId
|
|
5951
|
+
};
|
|
5952
|
+
}, [schema, currentValue, overrideId, visualModeEnabled]);
|
|
5953
|
+
return useMemo26(() => {
|
|
5954
|
+
if (controls === undefined || currentValue === null || schema === null || !visualModeEnabled) {
|
|
5955
|
+
return {
|
|
5956
|
+
controls: undefined,
|
|
5957
|
+
values: currentValue ?? {}
|
|
5958
|
+
};
|
|
5959
|
+
}
|
|
5960
|
+
const overrideValues = overrides[overrideId] ?? {};
|
|
5961
|
+
const propStatus = codeValues[overrideId];
|
|
5962
|
+
const currentValueKeys = Object.keys(currentValue);
|
|
5963
|
+
const keysToUpdate = [...new Set(currentValueKeys)];
|
|
5964
|
+
const merged = {};
|
|
5965
|
+
for (const key of keysToUpdate) {
|
|
5966
|
+
const codeValueStatus = propStatus?.[key] ?? null;
|
|
5967
|
+
merged[key] = getEffectiveVisualModeValue({
|
|
5968
|
+
codeValue: codeValueStatus,
|
|
5969
|
+
runtimeValue: currentValue[key],
|
|
5970
|
+
dragOverrideValue: overrideValues[key],
|
|
5971
|
+
defaultValue: schema[key]?.default,
|
|
5972
|
+
shouldResortToDefaultValueIfUndefined: false
|
|
5973
|
+
});
|
|
5974
|
+
}
|
|
5975
|
+
return {
|
|
5976
|
+
controls,
|
|
5977
|
+
values: merged
|
|
5978
|
+
};
|
|
5979
|
+
}, [
|
|
5980
|
+
controls,
|
|
5981
|
+
currentValue,
|
|
5982
|
+
overrideId,
|
|
5983
|
+
overrides,
|
|
5984
|
+
codeValues,
|
|
5985
|
+
schema,
|
|
5986
|
+
visualModeEnabled
|
|
5987
|
+
]);
|
|
5988
|
+
};
|
|
5989
|
+
var getNestedValue = (obj, key) => {
|
|
5990
|
+
const parts = key.split(".");
|
|
5991
|
+
let current = obj;
|
|
5992
|
+
for (const part of parts) {
|
|
5993
|
+
if (current === null || current === undefined || typeof current !== "object")
|
|
5994
|
+
return;
|
|
5995
|
+
current = current[part];
|
|
5996
|
+
}
|
|
5997
|
+
return current;
|
|
5998
|
+
};
|
|
5999
|
+
var mergeValues = (props2, values, schemaKeys) => {
|
|
6000
|
+
const merged = { ...props2 };
|
|
6001
|
+
for (const key of schemaKeys) {
|
|
6002
|
+
const value = values[key];
|
|
6003
|
+
const parts = key.split(".");
|
|
6004
|
+
if (parts.length === 1) {
|
|
6005
|
+
merged[key] = value;
|
|
6006
|
+
continue;
|
|
6007
|
+
}
|
|
6008
|
+
let current = merged;
|
|
6009
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
6010
|
+
const part = parts[i];
|
|
6011
|
+
if (typeof current[part] === "object" && current[part] !== null) {
|
|
6012
|
+
current[part] = { ...current[part] };
|
|
6013
|
+
} else {
|
|
6014
|
+
current[part] = {};
|
|
6015
|
+
}
|
|
6016
|
+
current = current[part];
|
|
6017
|
+
}
|
|
6018
|
+
current[parts[parts.length - 1]] = value;
|
|
6019
|
+
}
|
|
6020
|
+
return merged;
|
|
6021
|
+
};
|
|
6022
|
+
var wrapInSchema = (Component, schema) => {
|
|
6023
|
+
const schemaKeys = Object.keys(schema);
|
|
6024
|
+
const Wrapped = forwardRef8((props2, ref) => {
|
|
6025
|
+
const env = useRemotionEnvironment();
|
|
6026
|
+
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
6027
|
+
return React23.createElement(Component, {
|
|
6028
|
+
...props2,
|
|
6029
|
+
controls: null,
|
|
6030
|
+
ref
|
|
6031
|
+
});
|
|
6032
|
+
}
|
|
6033
|
+
const schemaInput = useMemo27(() => {
|
|
6034
|
+
const input = {};
|
|
6035
|
+
for (const key of schemaKeys) {
|
|
6036
|
+
input[key] = getNestedValue(props2, key);
|
|
6037
|
+
}
|
|
6038
|
+
return input;
|
|
6039
|
+
}, schemaKeys.map((key) => getNestedValue(props2, key)));
|
|
6040
|
+
const { controls, values } = useSchema(schema, schemaInput);
|
|
6041
|
+
const mergedProps = mergeValues(props2, values, schemaKeys);
|
|
6042
|
+
return React23.createElement(Component, {
|
|
6043
|
+
...mergedProps,
|
|
6044
|
+
controls,
|
|
6045
|
+
ref
|
|
6046
|
+
});
|
|
6047
|
+
});
|
|
6048
|
+
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
6049
|
+
return Wrapped;
|
|
6050
|
+
};
|
|
5895
6051
|
function exponentialBackoff(errorCount) {
|
|
5896
6052
|
return 1000 * 2 ** (errorCount - 1);
|
|
5897
6053
|
}
|
|
5898
|
-
var
|
|
6054
|
+
var imgSchema = {
|
|
6055
|
+
"style.translate": {
|
|
6056
|
+
type: "translate",
|
|
6057
|
+
step: 1,
|
|
6058
|
+
default: "0px 0px",
|
|
6059
|
+
description: "Position"
|
|
6060
|
+
},
|
|
6061
|
+
"style.scale": {
|
|
6062
|
+
type: "number",
|
|
6063
|
+
min: 0.05,
|
|
6064
|
+
max: 100,
|
|
6065
|
+
step: 0.01,
|
|
6066
|
+
default: 1,
|
|
6067
|
+
description: "Scale"
|
|
6068
|
+
},
|
|
6069
|
+
"style.rotate": {
|
|
6070
|
+
type: "rotation",
|
|
6071
|
+
step: 1,
|
|
6072
|
+
default: "0deg",
|
|
6073
|
+
description: "Rotation"
|
|
6074
|
+
},
|
|
6075
|
+
"style.opacity": {
|
|
6076
|
+
type: "number",
|
|
6077
|
+
min: 0,
|
|
6078
|
+
max: 1,
|
|
6079
|
+
step: 0.01,
|
|
6080
|
+
default: 1,
|
|
6081
|
+
description: "Opacity"
|
|
6082
|
+
}
|
|
6083
|
+
};
|
|
6084
|
+
var ImgInner = ({
|
|
5899
6085
|
onError,
|
|
5900
6086
|
maxRetries = 2,
|
|
5901
6087
|
src,
|
|
@@ -5907,13 +6093,15 @@ var ImgRefForwarding = ({
|
|
|
5907
6093
|
showInTimeline,
|
|
5908
6094
|
name,
|
|
5909
6095
|
stack,
|
|
6096
|
+
ref,
|
|
6097
|
+
controls,
|
|
5910
6098
|
...props2
|
|
5911
|
-
}
|
|
6099
|
+
}) => {
|
|
5912
6100
|
const imageRef = useRef17(null);
|
|
5913
6101
|
const errors = useRef17({});
|
|
5914
6102
|
const { delayPlayback } = useBufferState();
|
|
5915
|
-
const sequenceContext =
|
|
5916
|
-
const [timelineId] =
|
|
6103
|
+
const sequenceContext = useContext30(SequenceContext);
|
|
6104
|
+
const [timelineId] = useState16(() => String(Math.random()));
|
|
5917
6105
|
if (!src) {
|
|
5918
6106
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
5919
6107
|
}
|
|
@@ -5932,7 +6120,8 @@ var ImgRefForwarding = ({
|
|
|
5932
6120
|
showInTimeline: showInTimeline ?? true,
|
|
5933
6121
|
premountDisplay: sequenceContext?.premountDisplay ?? null,
|
|
5934
6122
|
postmountDisplay: sequenceContext?.postmountDisplay ?? null,
|
|
5935
|
-
loopDisplay: undefined
|
|
6123
|
+
loopDisplay: undefined,
|
|
6124
|
+
controls: controls ?? null
|
|
5936
6125
|
});
|
|
5937
6126
|
const actualSrc = usePreload(src);
|
|
5938
6127
|
const retryIn = useCallback13((timeout) => {
|
|
@@ -6055,9 +6244,9 @@ var ImgRefForwarding = ({
|
|
|
6055
6244
|
decoding: "sync"
|
|
6056
6245
|
});
|
|
6057
6246
|
};
|
|
6058
|
-
var Img =
|
|
6247
|
+
var Img = wrapInSchema(ImgInner, imgSchema);
|
|
6059
6248
|
addSequenceStackTraces(Img);
|
|
6060
|
-
var compositionsRef =
|
|
6249
|
+
var compositionsRef = React25.createRef();
|
|
6061
6250
|
var CompositionManagerProvider = ({
|
|
6062
6251
|
children,
|
|
6063
6252
|
onlyRenderComposition,
|
|
@@ -6065,9 +6254,9 @@ var CompositionManagerProvider = ({
|
|
|
6065
6254
|
initialCompositions,
|
|
6066
6255
|
initialCanvasContent
|
|
6067
6256
|
}) => {
|
|
6068
|
-
const [folders, setFolders] =
|
|
6069
|
-
const [canvasContent, setCanvasContent] =
|
|
6070
|
-
const [compositions, setCompositions] =
|
|
6257
|
+
const [folders, setFolders] = useState17([]);
|
|
6258
|
+
const [canvasContent, setCanvasContent] = useState17(initialCanvasContent);
|
|
6259
|
+
const [compositions, setCompositions] = useState17(initialCompositions);
|
|
6071
6260
|
const currentcompositionsRef = useRef18(compositions);
|
|
6072
6261
|
const updateCompositions = useCallback14((updateComps) => {
|
|
6073
6262
|
setCompositions((comps) => {
|
|
@@ -6111,7 +6300,7 @@ var CompositionManagerProvider = ({
|
|
|
6111
6300
|
getCompositions: () => currentcompositionsRef.current
|
|
6112
6301
|
};
|
|
6113
6302
|
}, []);
|
|
6114
|
-
const compositionManagerSetters =
|
|
6303
|
+
const compositionManagerSetters = useMemo28(() => {
|
|
6115
6304
|
return {
|
|
6116
6305
|
registerComposition,
|
|
6117
6306
|
unregisterComposition,
|
|
@@ -6127,7 +6316,7 @@ var CompositionManagerProvider = ({
|
|
|
6127
6316
|
unregisterFolder,
|
|
6128
6317
|
onlyRenderComposition
|
|
6129
6318
|
]);
|
|
6130
|
-
const compositionManagerContextValue =
|
|
6319
|
+
const compositionManagerContextValue = useMemo28(() => {
|
|
6131
6320
|
return {
|
|
6132
6321
|
compositions,
|
|
6133
6322
|
folders,
|
|
@@ -6201,32 +6390,11 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
6201
6390
|
}
|
|
6202
6391
|
`;
|
|
6203
6392
|
};
|
|
6204
|
-
var getEffectiveVisualModeValue = ({
|
|
6205
|
-
codeValue,
|
|
6206
|
-
runtimeValue,
|
|
6207
|
-
dragOverrideValue,
|
|
6208
|
-
defaultValue,
|
|
6209
|
-
shouldResortToDefaultValueIfUndefined = false
|
|
6210
|
-
}) => {
|
|
6211
|
-
if (dragOverrideValue !== undefined) {
|
|
6212
|
-
return dragOverrideValue;
|
|
6213
|
-
}
|
|
6214
|
-
if (!codeValue) {
|
|
6215
|
-
return runtimeValue;
|
|
6216
|
-
}
|
|
6217
|
-
if (!codeValue.canUpdate) {
|
|
6218
|
-
return runtimeValue;
|
|
6219
|
-
}
|
|
6220
|
-
if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
|
|
6221
|
-
return defaultValue;
|
|
6222
|
-
}
|
|
6223
|
-
return codeValue.codeValue;
|
|
6224
|
-
};
|
|
6225
6393
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
6226
6394
|
var getPreviewDomElement = () => {
|
|
6227
6395
|
return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
|
|
6228
6396
|
};
|
|
6229
|
-
var MaxMediaCacheSizeContext =
|
|
6397
|
+
var MaxMediaCacheSizeContext = React26.createContext(null);
|
|
6230
6398
|
var Root = null;
|
|
6231
6399
|
var listeners = [];
|
|
6232
6400
|
var getRoot = () => {
|
|
@@ -6246,7 +6414,7 @@ var waitForRoot = (fn) => {
|
|
|
6246
6414
|
};
|
|
6247
6415
|
var MediaEnabledContext = createContext20(null);
|
|
6248
6416
|
var useVideoEnabled = () => {
|
|
6249
|
-
const context =
|
|
6417
|
+
const context = useContext31(MediaEnabledContext);
|
|
6250
6418
|
if (!context) {
|
|
6251
6419
|
return window.remotion_videoEnabled;
|
|
6252
6420
|
}
|
|
@@ -6256,7 +6424,7 @@ var useVideoEnabled = () => {
|
|
|
6256
6424
|
return context.videoEnabled;
|
|
6257
6425
|
};
|
|
6258
6426
|
var useAudioEnabled = () => {
|
|
6259
|
-
const context =
|
|
6427
|
+
const context = useContext31(MediaEnabledContext);
|
|
6260
6428
|
if (!context) {
|
|
6261
6429
|
return window.remotion_audioEnabled;
|
|
6262
6430
|
}
|
|
@@ -6270,7 +6438,7 @@ var MediaEnabledProvider = ({
|
|
|
6270
6438
|
videoEnabled,
|
|
6271
6439
|
audioEnabled
|
|
6272
6440
|
}) => {
|
|
6273
|
-
const value =
|
|
6441
|
+
const value = useMemo29(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
6274
6442
|
return /* @__PURE__ */ jsx26(MediaEnabledContext.Provider, {
|
|
6275
6443
|
value,
|
|
6276
6444
|
children
|
|
@@ -6286,13 +6454,13 @@ var RemotionRootContexts = ({
|
|
|
6286
6454
|
frameState,
|
|
6287
6455
|
visualModeEnabled
|
|
6288
6456
|
}) => {
|
|
6289
|
-
const nonceContext =
|
|
6457
|
+
const nonceContext = useMemo30(() => {
|
|
6290
6458
|
let counter = 0;
|
|
6291
6459
|
return {
|
|
6292
6460
|
getNonce: () => counter++
|
|
6293
6461
|
};
|
|
6294
6462
|
}, []);
|
|
6295
|
-
const logging =
|
|
6463
|
+
const logging = useMemo30(() => {
|
|
6296
6464
|
return { logLevel, mountTime: Date.now() };
|
|
6297
6465
|
}, [logLevel]);
|
|
6298
6466
|
return /* @__PURE__ */ jsx27(LogLevelContext.Provider, {
|
|
@@ -6491,7 +6659,7 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
6491
6659
|
};
|
|
6492
6660
|
}
|
|
6493
6661
|
};
|
|
6494
|
-
var SequenceStackTracesUpdateContext =
|
|
6662
|
+
var SequenceStackTracesUpdateContext = React28.createContext(() => {});
|
|
6495
6663
|
var getEnvVariables = () => {
|
|
6496
6664
|
if (getRemotionEnvironment().isRendering) {
|
|
6497
6665
|
const param = window.remotion_envVariables;
|
|
@@ -6517,7 +6685,7 @@ var setupEnvVariables = () => {
|
|
|
6517
6685
|
window.process.env[key] = env[key];
|
|
6518
6686
|
});
|
|
6519
6687
|
};
|
|
6520
|
-
var CurrentScaleContext =
|
|
6688
|
+
var CurrentScaleContext = React29.createContext(null);
|
|
6521
6689
|
var PreviewSizeContext = createContext21({
|
|
6522
6690
|
setSize: () => {
|
|
6523
6691
|
return;
|
|
@@ -6541,75 +6709,6 @@ var calculateScale = ({
|
|
|
6541
6709
|
}
|
|
6542
6710
|
return Number(previewSize);
|
|
6543
6711
|
};
|
|
6544
|
-
var useSchema = (schema, currentValue) => {
|
|
6545
|
-
const env = useRemotionEnvironment();
|
|
6546
|
-
const earlyReturn = useMemo29(() => {
|
|
6547
|
-
if (!env.isStudio || env.isReadOnlyStudio) {
|
|
6548
|
-
return {
|
|
6549
|
-
controls: undefined,
|
|
6550
|
-
values: currentValue ?? {}
|
|
6551
|
-
};
|
|
6552
|
-
}
|
|
6553
|
-
return;
|
|
6554
|
-
}, [env.isStudio, env.isReadOnlyStudio, currentValue]);
|
|
6555
|
-
if (earlyReturn) {
|
|
6556
|
-
return earlyReturn;
|
|
6557
|
-
}
|
|
6558
|
-
const [overrideId] = useState17(() => String(Math.random()));
|
|
6559
|
-
const {
|
|
6560
|
-
visualModeEnabled,
|
|
6561
|
-
dragOverrides: overrides,
|
|
6562
|
-
codeValues
|
|
6563
|
-
} = useContext31(VisualModeOverridesContext);
|
|
6564
|
-
const controls = useMemo29(() => {
|
|
6565
|
-
if (!visualModeEnabled) {
|
|
6566
|
-
return;
|
|
6567
|
-
}
|
|
6568
|
-
if (schema === null || currentValue === null) {
|
|
6569
|
-
return;
|
|
6570
|
-
}
|
|
6571
|
-
return {
|
|
6572
|
-
schema,
|
|
6573
|
-
currentValue,
|
|
6574
|
-
overrideId
|
|
6575
|
-
};
|
|
6576
|
-
}, [schema, currentValue, overrideId, visualModeEnabled]);
|
|
6577
|
-
return useMemo29(() => {
|
|
6578
|
-
if (controls === undefined || currentValue === null || schema === null || !visualModeEnabled) {
|
|
6579
|
-
return {
|
|
6580
|
-
controls: undefined,
|
|
6581
|
-
values: currentValue ?? {}
|
|
6582
|
-
};
|
|
6583
|
-
}
|
|
6584
|
-
const overrideValues = overrides[overrideId] ?? {};
|
|
6585
|
-
const propStatus = codeValues[overrideId];
|
|
6586
|
-
const currentValueKeys = Object.keys(currentValue);
|
|
6587
|
-
const keysToUpdate = [...new Set(currentValueKeys)];
|
|
6588
|
-
const merged = {};
|
|
6589
|
-
for (const key of keysToUpdate) {
|
|
6590
|
-
const codeValueStatus = propStatus?.[key] ?? null;
|
|
6591
|
-
merged[key] = getEffectiveVisualModeValue({
|
|
6592
|
-
codeValue: codeValueStatus,
|
|
6593
|
-
runtimeValue: currentValue[key],
|
|
6594
|
-
dragOverrideValue: overrideValues[key],
|
|
6595
|
-
defaultValue: schema[key]?.default,
|
|
6596
|
-
shouldResortToDefaultValueIfUndefined: false
|
|
6597
|
-
});
|
|
6598
|
-
}
|
|
6599
|
-
return {
|
|
6600
|
-
controls,
|
|
6601
|
-
values: merged
|
|
6602
|
-
};
|
|
6603
|
-
}, [
|
|
6604
|
-
controls,
|
|
6605
|
-
currentValue,
|
|
6606
|
-
overrideId,
|
|
6607
|
-
overrides,
|
|
6608
|
-
codeValues,
|
|
6609
|
-
schema,
|
|
6610
|
-
visualModeEnabled
|
|
6611
|
-
]);
|
|
6612
|
-
};
|
|
6613
6712
|
var useSequenceControlOverride = (key) => {
|
|
6614
6713
|
const seqContext = useContext32(SequenceContext);
|
|
6615
6714
|
const { dragOverrides: overrides } = useContext32(VisualModeOverridesContext);
|
|
@@ -6655,7 +6754,7 @@ var OffthreadVideoForRendering = ({
|
|
|
6655
6754
|
if (!src) {
|
|
6656
6755
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
6657
6756
|
}
|
|
6658
|
-
const id =
|
|
6757
|
+
const id = useMemo31(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
6659
6758
|
src,
|
|
6660
6759
|
sequenceContext?.cumulatedFrom,
|
|
6661
6760
|
sequenceContext?.relativeFrom,
|
|
@@ -6710,14 +6809,14 @@ var OffthreadVideoForRendering = ({
|
|
|
6710
6809
|
sequenceContext?.relativeFrom,
|
|
6711
6810
|
audioStreamIndex
|
|
6712
6811
|
]);
|
|
6713
|
-
const currentTime =
|
|
6812
|
+
const currentTime = useMemo31(() => {
|
|
6714
6813
|
return getExpectedMediaFrameUncorrected({
|
|
6715
6814
|
frame,
|
|
6716
6815
|
playbackRate: playbackRate || 1,
|
|
6717
6816
|
startFrom: -mediaStartsAt
|
|
6718
6817
|
}) / videoConfig.fps;
|
|
6719
6818
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
6720
|
-
const actualSrc =
|
|
6819
|
+
const actualSrc = useMemo31(() => {
|
|
6721
6820
|
return getOffthreadVideoSource({
|
|
6722
6821
|
src,
|
|
6723
6822
|
currentTime,
|
|
@@ -6805,7 +6904,7 @@ var OffthreadVideoForRendering = ({
|
|
|
6805
6904
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
6806
6905
|
}
|
|
6807
6906
|
}, [imageSrc, onError]);
|
|
6808
|
-
const className =
|
|
6907
|
+
const className = useMemo31(() => {
|
|
6809
6908
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
6810
6909
|
}, [props2.className]);
|
|
6811
6910
|
const onImageFrame = useCallback15((img) => {
|
|
@@ -6859,7 +6958,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6859
6958
|
throw new Error("SharedAudioContext not found");
|
|
6860
6959
|
}
|
|
6861
6960
|
const videoRef = useRef19(null);
|
|
6862
|
-
const sharedSource =
|
|
6961
|
+
const sharedSource = useMemo32(() => {
|
|
6863
6962
|
if (!context.audioContext) {
|
|
6864
6963
|
return null;
|
|
6865
6964
|
}
|
|
@@ -6868,7 +6967,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6868
6967
|
ref: videoRef
|
|
6869
6968
|
});
|
|
6870
6969
|
}, [context.audioContext]);
|
|
6871
|
-
const effectToUse =
|
|
6970
|
+
const effectToUse = React31.useInsertionEffect ?? React31.useLayoutEffect;
|
|
6872
6971
|
effectToUse(() => {
|
|
6873
6972
|
return () => {
|
|
6874
6973
|
requestAnimationFrame(() => {
|
|
@@ -7045,7 +7144,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
7045
7144
|
current.preload = "auto";
|
|
7046
7145
|
}
|
|
7047
7146
|
}, []);
|
|
7048
|
-
const actualStyle =
|
|
7147
|
+
const actualStyle = useMemo32(() => {
|
|
7049
7148
|
return {
|
|
7050
7149
|
...style,
|
|
7051
7150
|
opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
|
|
@@ -7226,68 +7325,6 @@ var OffthreadVideo = ({
|
|
|
7226
7325
|
};
|
|
7227
7326
|
addSequenceStackTraces(OffthreadVideo);
|
|
7228
7327
|
var WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged";
|
|
7229
|
-
var getNestedValue = (obj, key) => {
|
|
7230
|
-
const parts = key.split(".");
|
|
7231
|
-
let current = obj;
|
|
7232
|
-
for (const part of parts) {
|
|
7233
|
-
if (current === null || current === undefined || typeof current !== "object")
|
|
7234
|
-
return;
|
|
7235
|
-
current = current[part];
|
|
7236
|
-
}
|
|
7237
|
-
return current;
|
|
7238
|
-
};
|
|
7239
|
-
var mergeValues = (props2, values, schemaKeys) => {
|
|
7240
|
-
const merged = { ...props2 };
|
|
7241
|
-
for (const key of schemaKeys) {
|
|
7242
|
-
const value = values[key];
|
|
7243
|
-
const parts = key.split(".");
|
|
7244
|
-
if (parts.length === 1) {
|
|
7245
|
-
merged[key] = value;
|
|
7246
|
-
continue;
|
|
7247
|
-
}
|
|
7248
|
-
let current = merged;
|
|
7249
|
-
for (let i = 0;i < parts.length - 1; i++) {
|
|
7250
|
-
const part = parts[i];
|
|
7251
|
-
if (typeof current[part] === "object" && current[part] !== null) {
|
|
7252
|
-
current[part] = { ...current[part] };
|
|
7253
|
-
} else {
|
|
7254
|
-
current[part] = {};
|
|
7255
|
-
}
|
|
7256
|
-
current = current[part];
|
|
7257
|
-
}
|
|
7258
|
-
current[parts[parts.length - 1]] = value;
|
|
7259
|
-
}
|
|
7260
|
-
return merged;
|
|
7261
|
-
};
|
|
7262
|
-
var wrapInSchema = (Component, schema) => {
|
|
7263
|
-
const schemaKeys = Object.keys(schema);
|
|
7264
|
-
const Wrapped = forwardRef10((props2, ref) => {
|
|
7265
|
-
const env = useRemotionEnvironment();
|
|
7266
|
-
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
7267
|
-
return React32.createElement(Component, {
|
|
7268
|
-
...props2,
|
|
7269
|
-
controls: null,
|
|
7270
|
-
ref
|
|
7271
|
-
});
|
|
7272
|
-
}
|
|
7273
|
-
const schemaInput = useMemo32(() => {
|
|
7274
|
-
const input = {};
|
|
7275
|
-
for (const key of schemaKeys) {
|
|
7276
|
-
input[key] = getNestedValue(props2, key);
|
|
7277
|
-
}
|
|
7278
|
-
return input;
|
|
7279
|
-
}, schemaKeys.map((key) => getNestedValue(props2, key)));
|
|
7280
|
-
const { controls, values } = useSchema(schema, schemaInput);
|
|
7281
|
-
const mergedProps = mergeValues(props2, values, schemaKeys);
|
|
7282
|
-
return React32.createElement(Component, {
|
|
7283
|
-
...mergedProps,
|
|
7284
|
-
controls,
|
|
7285
|
-
ref
|
|
7286
|
-
});
|
|
7287
|
-
});
|
|
7288
|
-
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
7289
|
-
return Wrapped;
|
|
7290
|
-
};
|
|
7291
7328
|
function useRemotionContexts() {
|
|
7292
7329
|
const compositionManagerCtx = React33.useContext(CompositionManager);
|
|
7293
7330
|
const timelineContext = React33.useContext(TimelineContext);
|
|
@@ -7536,7 +7573,7 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
|
7536
7573
|
children
|
|
7537
7574
|
});
|
|
7538
7575
|
};
|
|
7539
|
-
var SeriesSequence =
|
|
7576
|
+
var SeriesSequence = forwardRef10(SeriesSequenceRefForwardingFunction);
|
|
7540
7577
|
var Series = (props2) => {
|
|
7541
7578
|
const childrenValue = useMemo34(() => {
|
|
7542
7579
|
let startFrame = 0;
|
|
@@ -7592,19 +7629,17 @@ var Series = (props2) => {
|
|
|
7592
7629
|
});
|
|
7593
7630
|
});
|
|
7594
7631
|
}, [props2.children]);
|
|
7595
|
-
if (ENABLE_V5_BREAKING_CHANGES) {
|
|
7596
|
-
return /* @__PURE__ */ jsx33(IsInsideSeriesContainer, {
|
|
7597
|
-
children: /* @__PURE__ */ jsx33(Sequence, {
|
|
7598
|
-
...props2,
|
|
7599
|
-
children: childrenValue
|
|
7600
|
-
})
|
|
7601
|
-
});
|
|
7602
|
-
}
|
|
7603
7632
|
return /* @__PURE__ */ jsx33(IsInsideSeriesContainer, {
|
|
7604
|
-
children:
|
|
7633
|
+
children: /* @__PURE__ */ jsx33(Sequence, {
|
|
7634
|
+
layout: "none",
|
|
7635
|
+
name: "<Series>",
|
|
7636
|
+
...props2,
|
|
7637
|
+
children: childrenValue
|
|
7638
|
+
})
|
|
7605
7639
|
});
|
|
7606
7640
|
};
|
|
7607
7641
|
Series.Sequence = SeriesSequence;
|
|
7642
|
+
addSequenceStackTraces(Series);
|
|
7608
7643
|
addSequenceStackTraces(SeriesSequence);
|
|
7609
7644
|
var validateSpringDuration = (dur) => {
|
|
7610
7645
|
if (typeof dur === "undefined") {
|
|
@@ -8260,7 +8295,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
8260
8295
|
...props2
|
|
8261
8296
|
});
|
|
8262
8297
|
};
|
|
8263
|
-
var VideoForRendering =
|
|
8298
|
+
var VideoForRendering = forwardRef11(VideoForRenderingForwardFunction);
|
|
8264
8299
|
var VideoForwardingFunction = (props2, ref) => {
|
|
8265
8300
|
const {
|
|
8266
8301
|
startFrom,
|
|
@@ -8365,7 +8400,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
8365
8400
|
onAutoPlayError: onAutoPlayError ?? undefined
|
|
8366
8401
|
});
|
|
8367
8402
|
};
|
|
8368
|
-
var Html5Video =
|
|
8403
|
+
var Html5Video = forwardRef12(VideoForwardingFunction);
|
|
8369
8404
|
addSequenceStackTraces(Html5Video);
|
|
8370
8405
|
checkMultipleRemotionVersions();
|
|
8371
8406
|
var proxyObj = {};
|
|
@@ -8390,6 +8425,7 @@ var Config = new Proxy(proxyObj, {
|
|
|
8390
8425
|
});
|
|
8391
8426
|
Sequence.displayName = "Sequence";
|
|
8392
8427
|
addSequenceStackTraces(Sequence);
|
|
8428
|
+
addSequenceStackTraces(Composition);
|
|
8393
8429
|
|
|
8394
8430
|
// src/components/team/TeamCards.tsx
|
|
8395
8431
|
import { jsx as jsx36, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -10148,7 +10184,7 @@ var getDefaultConfig = () => {
|
|
|
10148
10184
|
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
10149
10185
|
|
|
10150
10186
|
// ../design/dist/esm/index.mjs
|
|
10151
|
-
import
|
|
10187
|
+
import React7, { useEffect as useEffect18, useMemo as useMemo39, useState as useState20 } from "react";
|
|
10152
10188
|
|
|
10153
10189
|
// ../paths/dist/esm/index.mjs
|
|
10154
10190
|
var cutLInstruction = ({
|
|
@@ -12914,7 +12950,7 @@ var PathInternals = {
|
|
|
12914
12950
|
};
|
|
12915
12951
|
|
|
12916
12952
|
// ../shapes/dist/esm/index.mjs
|
|
12917
|
-
import
|
|
12953
|
+
import React2, { useMemo as useMemo38 } from "react";
|
|
12918
12954
|
import { version } from "react-dom";
|
|
12919
12955
|
import { jsx as jsx40, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
12920
12956
|
import { jsx as jsx210 } from "react/jsx-runtime";
|
|
@@ -12983,7 +13019,7 @@ var RenderSvg = ({
|
|
|
12983
13019
|
}
|
|
12984
13020
|
const prevX = prevInstruction.x;
|
|
12985
13021
|
const prevY = prevInstruction.y;
|
|
12986
|
-
return /* @__PURE__ */ jsxs5(
|
|
13022
|
+
return /* @__PURE__ */ jsxs5(React2.Fragment, {
|
|
12987
13023
|
children: [
|
|
12988
13024
|
/* @__PURE__ */ jsx40("path", {
|
|
12989
13025
|
d: `M ${prevX} ${prevY} ${i.cp1x} ${i.cp1y}`,
|
|
@@ -14505,47 +14541,47 @@ import * as ReactDOM4 from "react-dom";
|
|
|
14505
14541
|
import React9 from "react";
|
|
14506
14542
|
import * as React62 from "react";
|
|
14507
14543
|
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
14508
|
-
import * as
|
|
14509
|
-
import * as
|
|
14544
|
+
import * as React72 from "react";
|
|
14545
|
+
import * as React8 from "react";
|
|
14510
14546
|
import { Fragment as Fragment3, jsx as jsx132 } from "react/jsx-runtime";
|
|
14511
14547
|
import { jsx as jsx142 } from "react/jsx-runtime";
|
|
14512
14548
|
import * as React102 from "react";
|
|
14513
14549
|
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
14514
|
-
import * as
|
|
14515
|
-
import * as
|
|
14550
|
+
import * as React14 from "react";
|
|
14551
|
+
import * as React11 from "react";
|
|
14516
14552
|
import * as ReactDOM from "react-dom";
|
|
14517
14553
|
import { jsx as jsx162 } from "react/jsx-runtime";
|
|
14518
|
-
import * as
|
|
14519
|
-
import * as
|
|
14554
|
+
import * as React122 from "react";
|
|
14555
|
+
import * as React132 from "react";
|
|
14520
14556
|
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
14521
|
-
import * as
|
|
14557
|
+
import * as React15 from "react";
|
|
14522
14558
|
import * as React162 from "react";
|
|
14523
14559
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
14524
|
-
import * as
|
|
14560
|
+
import * as React182 from "react";
|
|
14525
14561
|
import * as React172 from "react";
|
|
14526
14562
|
import * as React22 from "react";
|
|
14527
|
-
import * as
|
|
14563
|
+
import * as React192 from "react";
|
|
14528
14564
|
import { useLayoutEffect as useLayoutEffect32, useEffect as useEffect82 } from "react";
|
|
14529
14565
|
import * as ReactDOM2 from "react-dom";
|
|
14530
|
-
import * as
|
|
14566
|
+
import * as React20 from "react";
|
|
14531
14567
|
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
14532
14568
|
import * as React21 from "react";
|
|
14533
14569
|
import { jsx as jsx202 } from "react/jsx-runtime";
|
|
14534
|
-
import * as
|
|
14570
|
+
import * as React232 from "react";
|
|
14535
14571
|
import ReactDOM3 from "react-dom";
|
|
14536
14572
|
import { jsx as jsx213 } from "react/jsx-runtime";
|
|
14537
|
-
import * as
|
|
14573
|
+
import * as React24 from "react";
|
|
14538
14574
|
import * as React252 from "react";
|
|
14539
|
-
import * as
|
|
14575
|
+
import * as React262 from "react";
|
|
14540
14576
|
import { jsx as jsx223 } from "react/jsx-runtime";
|
|
14541
14577
|
import * as React332 from "react";
|
|
14542
|
-
import * as
|
|
14578
|
+
import * as React292 from "react";
|
|
14543
14579
|
import { useState as useState112 } from "react";
|
|
14544
|
-
import * as
|
|
14580
|
+
import * as React27 from "react";
|
|
14545
14581
|
import * as React282 from "react";
|
|
14546
|
-
import * as
|
|
14547
|
-
import * as
|
|
14548
|
-
import * as
|
|
14582
|
+
import * as React32 from "react";
|
|
14583
|
+
import * as React312 from "react";
|
|
14584
|
+
import * as React30 from "react";
|
|
14549
14585
|
import { Fragment as Fragment62, jsx as jsx232, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
14550
14586
|
import { forwardRef as forwardRef132, createElement as createElement7 } from "react";
|
|
14551
14587
|
import { forwardRef as forwardRef122, createElement as createElement6 } from "react";
|
|
@@ -14600,7 +14636,7 @@ var getChildNodeFrom = (htmlElement) => {
|
|
|
14600
14636
|
return childNode;
|
|
14601
14637
|
};
|
|
14602
14638
|
var useHoverTransforms = (ref, disabled) => {
|
|
14603
|
-
const [state, setState] =
|
|
14639
|
+
const [state, setState] = React7.useState({
|
|
14604
14640
|
progress: 0,
|
|
14605
14641
|
isActive: false
|
|
14606
14642
|
});
|
|
@@ -14612,7 +14648,7 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
14612
14648
|
eventTarget.dispatchEvent(new Event("enabled"));
|
|
14613
14649
|
}
|
|
14614
14650
|
}, [disabled, eventTarget]);
|
|
14615
|
-
|
|
14651
|
+
React7.useEffect(() => {
|
|
14616
14652
|
const element = ref.current;
|
|
14617
14653
|
if (!element)
|
|
14618
14654
|
return;
|
|
@@ -14687,8 +14723,8 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
14687
14723
|
return state;
|
|
14688
14724
|
};
|
|
14689
14725
|
var useClickTransforms = (ref) => {
|
|
14690
|
-
const [hoverProgress, setHoverProgress] =
|
|
14691
|
-
|
|
14726
|
+
const [hoverProgress, setHoverProgress] = React7.useState(0);
|
|
14727
|
+
React7.useEffect(() => {
|
|
14692
14728
|
const element = getChildNodeFrom(ref.current);
|
|
14693
14729
|
if (!element) {
|
|
14694
14730
|
return;
|
|
@@ -15240,45 +15276,45 @@ function composeRefs(...refs) {
|
|
|
15240
15276
|
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
15241
15277
|
}
|
|
15242
15278
|
function useComposedRefs(...refs) {
|
|
15243
|
-
return
|
|
15279
|
+
return React72.useCallback(composeRefs(...refs), refs);
|
|
15244
15280
|
}
|
|
15245
|
-
var Slot =
|
|
15281
|
+
var Slot = React8.forwardRef((props, forwardedRef) => {
|
|
15246
15282
|
const { children, ...slotProps } = props;
|
|
15247
|
-
const childrenArray =
|
|
15283
|
+
const childrenArray = React8.Children.toArray(children);
|
|
15248
15284
|
const slottable = childrenArray.find(isSlottable);
|
|
15249
15285
|
if (slottable) {
|
|
15250
15286
|
const newElement = slottable.props.children;
|
|
15251
15287
|
const newChildren = childrenArray.map((child) => {
|
|
15252
15288
|
if (child === slottable) {
|
|
15253
|
-
if (
|
|
15254
|
-
return
|
|
15255
|
-
return
|
|
15289
|
+
if (React8.Children.count(newElement) > 1)
|
|
15290
|
+
return React8.Children.only(null);
|
|
15291
|
+
return React8.isValidElement(newElement) ? newElement.props.children : null;
|
|
15256
15292
|
} else {
|
|
15257
15293
|
return child;
|
|
15258
15294
|
}
|
|
15259
15295
|
});
|
|
15260
|
-
return /* @__PURE__ */ jsx132(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
15296
|
+
return /* @__PURE__ */ jsx132(SlotClone, { ...slotProps, ref: forwardedRef, children: React8.isValidElement(newElement) ? React8.cloneElement(newElement, undefined, newChildren) : null });
|
|
15261
15297
|
}
|
|
15262
15298
|
return /* @__PURE__ */ jsx132(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
15263
15299
|
});
|
|
15264
15300
|
Slot.displayName = "Slot";
|
|
15265
|
-
var SlotClone =
|
|
15301
|
+
var SlotClone = React8.forwardRef((props, forwardedRef) => {
|
|
15266
15302
|
const { children, ...slotProps } = props;
|
|
15267
|
-
if (
|
|
15303
|
+
if (React8.isValidElement(children)) {
|
|
15268
15304
|
const childrenRef = getElementRef(children);
|
|
15269
|
-
return
|
|
15305
|
+
return React8.cloneElement(children, {
|
|
15270
15306
|
...mergeProps(slotProps, children.props),
|
|
15271
15307
|
ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef
|
|
15272
15308
|
});
|
|
15273
15309
|
}
|
|
15274
|
-
return
|
|
15310
|
+
return React8.Children.count(children) > 1 ? React8.Children.only(null) : null;
|
|
15275
15311
|
});
|
|
15276
15312
|
SlotClone.displayName = "SlotClone";
|
|
15277
15313
|
var Slottable = ({ children }) => {
|
|
15278
15314
|
return /* @__PURE__ */ jsx132(Fragment3, { children });
|
|
15279
15315
|
};
|
|
15280
15316
|
function isSlottable(child) {
|
|
15281
|
-
return
|
|
15317
|
+
return React8.isValidElement(child) && child.type === Slottable;
|
|
15282
15318
|
}
|
|
15283
15319
|
function mergeProps(slotProps, childProps) {
|
|
15284
15320
|
const overrideProps = { ...childProps };
|
|
@@ -15392,7 +15428,7 @@ var NODES = [
|
|
|
15392
15428
|
"ul"
|
|
15393
15429
|
];
|
|
15394
15430
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
15395
|
-
const Node2 =
|
|
15431
|
+
const Node2 = React11.forwardRef((props, forwardedRef) => {
|
|
15396
15432
|
const { asChild, ...primitiveProps } = props;
|
|
15397
15433
|
const Comp = asChild ? Slot : node;
|
|
15398
15434
|
if (typeof window !== "undefined") {
|
|
@@ -15408,15 +15444,15 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
15408
15444
|
ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
15409
15445
|
}
|
|
15410
15446
|
function useCallbackRef(callback) {
|
|
15411
|
-
const callbackRef =
|
|
15412
|
-
|
|
15447
|
+
const callbackRef = React122.useRef(callback);
|
|
15448
|
+
React122.useEffect(() => {
|
|
15413
15449
|
callbackRef.current = callback;
|
|
15414
15450
|
});
|
|
15415
|
-
return
|
|
15451
|
+
return React122.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
15416
15452
|
}
|
|
15417
15453
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
15418
15454
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
15419
|
-
|
|
15455
|
+
React132.useEffect(() => {
|
|
15420
15456
|
const handleKeyDown = (event) => {
|
|
15421
15457
|
if (event.key === "Escape") {
|
|
15422
15458
|
onEscapeKeyDown(event);
|
|
@@ -15431,12 +15467,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
15431
15467
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
15432
15468
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
15433
15469
|
var originalBodyPointerEvents;
|
|
15434
|
-
var DismissableLayerContext =
|
|
15470
|
+
var DismissableLayerContext = React14.createContext({
|
|
15435
15471
|
layers: /* @__PURE__ */ new Set,
|
|
15436
15472
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set,
|
|
15437
15473
|
branches: /* @__PURE__ */ new Set
|
|
15438
15474
|
});
|
|
15439
|
-
var DismissableLayer =
|
|
15475
|
+
var DismissableLayer = React14.forwardRef((props, forwardedRef) => {
|
|
15440
15476
|
const {
|
|
15441
15477
|
disableOutsidePointerEvents = false,
|
|
15442
15478
|
onEscapeKeyDown,
|
|
@@ -15446,10 +15482,10 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
15446
15482
|
onDismiss,
|
|
15447
15483
|
...layerProps
|
|
15448
15484
|
} = props;
|
|
15449
|
-
const context =
|
|
15450
|
-
const [node, setNode] =
|
|
15485
|
+
const context = React14.useContext(DismissableLayerContext);
|
|
15486
|
+
const [node, setNode] = React14.useState(null);
|
|
15451
15487
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
15452
|
-
const [, force] =
|
|
15488
|
+
const [, force] = React14.useState({});
|
|
15453
15489
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
15454
15490
|
const layers = Array.from(context.layers);
|
|
15455
15491
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -15487,7 +15523,7 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
15487
15523
|
onDismiss();
|
|
15488
15524
|
}
|
|
15489
15525
|
}, ownerDocument);
|
|
15490
|
-
|
|
15526
|
+
React14.useEffect(() => {
|
|
15491
15527
|
if (!node)
|
|
15492
15528
|
return;
|
|
15493
15529
|
if (disableOutsidePointerEvents) {
|
|
@@ -15505,7 +15541,7 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
15505
15541
|
}
|
|
15506
15542
|
};
|
|
15507
15543
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
15508
|
-
|
|
15544
|
+
React14.useEffect(() => {
|
|
15509
15545
|
return () => {
|
|
15510
15546
|
if (!node)
|
|
15511
15547
|
return;
|
|
@@ -15514,7 +15550,7 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
15514
15550
|
dispatchUpdate();
|
|
15515
15551
|
};
|
|
15516
15552
|
}, [node, context]);
|
|
15517
|
-
|
|
15553
|
+
React14.useEffect(() => {
|
|
15518
15554
|
const handleUpdate = () => force({});
|
|
15519
15555
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
15520
15556
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -15533,11 +15569,11 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
15533
15569
|
});
|
|
15534
15570
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
15535
15571
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
15536
|
-
var DismissableLayerBranch =
|
|
15537
|
-
const context =
|
|
15538
|
-
const ref =
|
|
15572
|
+
var DismissableLayerBranch = React14.forwardRef((props, forwardedRef) => {
|
|
15573
|
+
const context = React14.useContext(DismissableLayerContext);
|
|
15574
|
+
const ref = React14.useRef(null);
|
|
15539
15575
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
15540
|
-
|
|
15576
|
+
React14.useEffect(() => {
|
|
15541
15577
|
const node = ref.current;
|
|
15542
15578
|
if (node) {
|
|
15543
15579
|
context.branches.add(node);
|
|
@@ -15551,9 +15587,9 @@ var DismissableLayerBranch = React142.forwardRef((props, forwardedRef) => {
|
|
|
15551
15587
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
15552
15588
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
15553
15589
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
15554
|
-
const isPointerInsideReactTreeRef =
|
|
15555
|
-
const handleClickRef =
|
|
15556
|
-
|
|
15590
|
+
const isPointerInsideReactTreeRef = React14.useRef(false);
|
|
15591
|
+
const handleClickRef = React14.useRef(() => {});
|
|
15592
|
+
React14.useEffect(() => {
|
|
15557
15593
|
const handlePointerDown = (event) => {
|
|
15558
15594
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
15559
15595
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -15588,8 +15624,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
15588
15624
|
}
|
|
15589
15625
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
15590
15626
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
15591
|
-
const isFocusInsideReactTreeRef =
|
|
15592
|
-
|
|
15627
|
+
const isFocusInsideReactTreeRef = React14.useRef(false);
|
|
15628
|
+
React14.useEffect(() => {
|
|
15593
15629
|
const handleFocus = (event) => {
|
|
15594
15630
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
15595
15631
|
const eventDetail = { originalEvent: event };
|
|
@@ -15623,7 +15659,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
15623
15659
|
}
|
|
15624
15660
|
var count = 0;
|
|
15625
15661
|
function useFocusGuards() {
|
|
15626
|
-
|
|
15662
|
+
React15.useEffect(() => {
|
|
15627
15663
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
15628
15664
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
15629
15665
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -15859,12 +15895,12 @@ function removeLinks(items) {
|
|
|
15859
15895
|
return items.filter((item) => item.tagName !== "A");
|
|
15860
15896
|
}
|
|
15861
15897
|
var useLayoutEffect22 = Boolean(globalThis?.document) ? React172.useLayoutEffect : () => {};
|
|
15862
|
-
var useReactId =
|
|
15898
|
+
var useReactId = React182["useId".toString()] || (() => {
|
|
15863
15899
|
return;
|
|
15864
15900
|
});
|
|
15865
15901
|
var count2 = 0;
|
|
15866
15902
|
function useId(deterministicId) {
|
|
15867
|
-
const [id, setId] =
|
|
15903
|
+
const [id, setId] = React182.useState(useReactId());
|
|
15868
15904
|
useLayoutEffect22(() => {
|
|
15869
15905
|
if (!deterministicId)
|
|
15870
15906
|
setId((reactId) => reactId ?? String(count2++));
|
|
@@ -17443,7 +17479,7 @@ function roundByDPR(element, value) {
|
|
|
17443
17479
|
return Math.round(value * dpr) / dpr;
|
|
17444
17480
|
}
|
|
17445
17481
|
function useLatestRef(value) {
|
|
17446
|
-
const ref =
|
|
17482
|
+
const ref = React192.useRef(value);
|
|
17447
17483
|
index(() => {
|
|
17448
17484
|
ref.current = value;
|
|
17449
17485
|
});
|
|
@@ -17466,7 +17502,7 @@ function useFloating(options) {
|
|
|
17466
17502
|
whileElementsMounted,
|
|
17467
17503
|
open
|
|
17468
17504
|
} = options;
|
|
17469
|
-
const [data, setData] =
|
|
17505
|
+
const [data, setData] = React192.useState({
|
|
17470
17506
|
x: 0,
|
|
17471
17507
|
y: 0,
|
|
17472
17508
|
strategy,
|
|
@@ -17474,19 +17510,19 @@ function useFloating(options) {
|
|
|
17474
17510
|
middlewareData: {},
|
|
17475
17511
|
isPositioned: false
|
|
17476
17512
|
});
|
|
17477
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
17513
|
+
const [latestMiddleware, setLatestMiddleware] = React192.useState(middleware);
|
|
17478
17514
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
17479
17515
|
setLatestMiddleware(middleware);
|
|
17480
17516
|
}
|
|
17481
|
-
const [_reference, _setReference] =
|
|
17482
|
-
const [_floating, _setFloating] =
|
|
17483
|
-
const setReference =
|
|
17517
|
+
const [_reference, _setReference] = React192.useState(null);
|
|
17518
|
+
const [_floating, _setFloating] = React192.useState(null);
|
|
17519
|
+
const setReference = React192.useCallback((node) => {
|
|
17484
17520
|
if (node !== referenceRef.current) {
|
|
17485
17521
|
referenceRef.current = node;
|
|
17486
17522
|
_setReference(node);
|
|
17487
17523
|
}
|
|
17488
17524
|
}, []);
|
|
17489
|
-
const setFloating =
|
|
17525
|
+
const setFloating = React192.useCallback((node) => {
|
|
17490
17526
|
if (node !== floatingRef.current) {
|
|
17491
17527
|
floatingRef.current = node;
|
|
17492
17528
|
_setFloating(node);
|
|
@@ -17494,13 +17530,13 @@ function useFloating(options) {
|
|
|
17494
17530
|
}, []);
|
|
17495
17531
|
const referenceEl = externalReference || _reference;
|
|
17496
17532
|
const floatingEl = externalFloating || _floating;
|
|
17497
|
-
const referenceRef =
|
|
17498
|
-
const floatingRef =
|
|
17499
|
-
const dataRef =
|
|
17533
|
+
const referenceRef = React192.useRef(null);
|
|
17534
|
+
const floatingRef = React192.useRef(null);
|
|
17535
|
+
const dataRef = React192.useRef(data);
|
|
17500
17536
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
17501
17537
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
17502
17538
|
const platformRef = useLatestRef(platform2);
|
|
17503
|
-
const update =
|
|
17539
|
+
const update = React192.useCallback(() => {
|
|
17504
17540
|
if (!referenceRef.current || !floatingRef.current) {
|
|
17505
17541
|
return;
|
|
17506
17542
|
}
|
|
@@ -17534,7 +17570,7 @@ function useFloating(options) {
|
|
|
17534
17570
|
}));
|
|
17535
17571
|
}
|
|
17536
17572
|
}, [open]);
|
|
17537
|
-
const isMountedRef =
|
|
17573
|
+
const isMountedRef = React192.useRef(false);
|
|
17538
17574
|
index(() => {
|
|
17539
17575
|
isMountedRef.current = true;
|
|
17540
17576
|
return () => {
|
|
@@ -17553,17 +17589,17 @@ function useFloating(options) {
|
|
|
17553
17589
|
update();
|
|
17554
17590
|
}
|
|
17555
17591
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
17556
|
-
const refs =
|
|
17592
|
+
const refs = React192.useMemo(() => ({
|
|
17557
17593
|
reference: referenceRef,
|
|
17558
17594
|
floating: floatingRef,
|
|
17559
17595
|
setReference,
|
|
17560
17596
|
setFloating
|
|
17561
17597
|
}), [setReference, setFloating]);
|
|
17562
|
-
const elements =
|
|
17598
|
+
const elements = React192.useMemo(() => ({
|
|
17563
17599
|
reference: referenceEl,
|
|
17564
17600
|
floating: floatingEl
|
|
17565
17601
|
}), [referenceEl, floatingEl]);
|
|
17566
|
-
const floatingStyles =
|
|
17602
|
+
const floatingStyles = React192.useMemo(() => {
|
|
17567
17603
|
const initialStyles = {
|
|
17568
17604
|
position: strategy,
|
|
17569
17605
|
left: 0,
|
|
@@ -17589,7 +17625,7 @@ function useFloating(options) {
|
|
|
17589
17625
|
top: y
|
|
17590
17626
|
};
|
|
17591
17627
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
17592
|
-
return
|
|
17628
|
+
return React192.useMemo(() => ({
|
|
17593
17629
|
...data,
|
|
17594
17630
|
update,
|
|
17595
17631
|
refs,
|
|
@@ -17657,7 +17693,7 @@ var arrow3 = (options, deps) => ({
|
|
|
17657
17693
|
options: [options, deps]
|
|
17658
17694
|
});
|
|
17659
17695
|
var NAME = "Arrow";
|
|
17660
|
-
var Arrow =
|
|
17696
|
+
var Arrow = React20.forwardRef((props, forwardedRef) => {
|
|
17661
17697
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
17662
17698
|
return /* @__PURE__ */ jsx192(Primitive.svg, {
|
|
17663
17699
|
...arrowProps,
|
|
@@ -17938,9 +17974,9 @@ var Anchor = PopperAnchor;
|
|
|
17938
17974
|
var Content = PopperContent;
|
|
17939
17975
|
var Arrow2 = PopperArrow;
|
|
17940
17976
|
var PORTAL_NAME = "Portal";
|
|
17941
|
-
var Portal =
|
|
17977
|
+
var Portal = React232.forwardRef((props, forwardedRef) => {
|
|
17942
17978
|
const { container: containerProp, ...portalProps } = props;
|
|
17943
|
-
const [mounted, setMounted] =
|
|
17979
|
+
const [mounted, setMounted] = React232.useState(false);
|
|
17944
17980
|
useLayoutEffect22(() => setMounted(true), []);
|
|
17945
17981
|
const container22 = containerProp || mounted && globalThis?.document?.body;
|
|
17946
17982
|
return container22 ? ReactDOM3.createPortal(/* @__PURE__ */ jsx213(Primitive.div, { ...portalProps, ref: forwardedRef }), container22) : null;
|
|
@@ -17955,7 +17991,7 @@ function useControllableState({
|
|
|
17955
17991
|
const isControlled = prop !== undefined;
|
|
17956
17992
|
const value = isControlled ? prop : uncontrolledProp;
|
|
17957
17993
|
const handleChange = useCallbackRef(onChange);
|
|
17958
|
-
const setValue =
|
|
17994
|
+
const setValue = React24.useCallback((nextValue) => {
|
|
17959
17995
|
if (isControlled) {
|
|
17960
17996
|
const setter = nextValue;
|
|
17961
17997
|
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
@@ -17971,11 +18007,11 @@ function useUncontrolledState({
|
|
|
17971
18007
|
defaultProp,
|
|
17972
18008
|
onChange
|
|
17973
18009
|
}) {
|
|
17974
|
-
const uncontrolledState =
|
|
18010
|
+
const uncontrolledState = React24.useState(defaultProp);
|
|
17975
18011
|
const [value] = uncontrolledState;
|
|
17976
|
-
const prevValueRef =
|
|
18012
|
+
const prevValueRef = React24.useRef(value);
|
|
17977
18013
|
const handleChange = useCallbackRef(onChange);
|
|
17978
|
-
|
|
18014
|
+
React24.useEffect(() => {
|
|
17979
18015
|
if (prevValueRef.current !== value) {
|
|
17980
18016
|
handleChange(value);
|
|
17981
18017
|
prevValueRef.current = value;
|
|
@@ -17994,7 +18030,7 @@ function usePrevious(value) {
|
|
|
17994
18030
|
}, [value]);
|
|
17995
18031
|
}
|
|
17996
18032
|
var NAME2 = "VisuallyHidden";
|
|
17997
|
-
var VisuallyHidden =
|
|
18033
|
+
var VisuallyHidden = React262.forwardRef((props, forwardedRef) => {
|
|
17998
18034
|
return /* @__PURE__ */ jsx223(Primitive.span, {
|
|
17999
18035
|
...props,
|
|
18000
18036
|
ref: forwardedRef,
|
|
@@ -18202,7 +18238,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
18202
18238
|
ref.callback = callback;
|
|
18203
18239
|
return ref.facade;
|
|
18204
18240
|
}
|
|
18205
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
18241
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React27.useLayoutEffect : React27.useEffect;
|
|
18206
18242
|
var currentValues = new WeakMap;
|
|
18207
18243
|
function useMergeRefs(refs, defaultValue) {
|
|
18208
18244
|
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
@@ -18335,9 +18371,9 @@ var effectCar = createSidecarMedium();
|
|
|
18335
18371
|
var nothing = function() {
|
|
18336
18372
|
return;
|
|
18337
18373
|
};
|
|
18338
|
-
var RemoveScroll =
|
|
18339
|
-
var ref =
|
|
18340
|
-
var _a =
|
|
18374
|
+
var RemoveScroll = React292.forwardRef(function(props, parentRef) {
|
|
18375
|
+
var ref = React292.useRef(null);
|
|
18376
|
+
var _a = React292.useState({
|
|
18341
18377
|
onScrollCapture: nothing,
|
|
18342
18378
|
onWheelCapture: nothing,
|
|
18343
18379
|
onTouchMoveCapture: nothing
|
|
@@ -18346,7 +18382,7 @@ var RemoveScroll = React29.forwardRef(function(props, parentRef) {
|
|
|
18346
18382
|
var SideCar2 = sideCar;
|
|
18347
18383
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
18348
18384
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
18349
|
-
return
|
|
18385
|
+
return React292.createElement(React292.Fragment, null, enabled && React292.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }), forwardProps ? React292.cloneElement(React292.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React292.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children));
|
|
18350
18386
|
});
|
|
18351
18387
|
RemoveScroll.defaultProps = {
|
|
18352
18388
|
enabled: true,
|
|
@@ -18414,7 +18450,7 @@ var stylesheetSingleton = function() {
|
|
|
18414
18450
|
var styleHookSingleton = function() {
|
|
18415
18451
|
var sheet = stylesheetSingleton();
|
|
18416
18452
|
return function(styles, isDynamic) {
|
|
18417
|
-
|
|
18453
|
+
React30.useEffect(function() {
|
|
18418
18454
|
sheet.add(styles);
|
|
18419
18455
|
return function() {
|
|
18420
18456
|
sheet.remove();
|
|
@@ -18519,7 +18555,7 @@ var getCurrentUseCounter = function() {
|
|
|
18519
18555
|
return isFinite(counter) ? counter : 0;
|
|
18520
18556
|
};
|
|
18521
18557
|
var useLockAttribute = function() {
|
|
18522
|
-
|
|
18558
|
+
React312.useEffect(function() {
|
|
18523
18559
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
18524
18560
|
return function() {
|
|
18525
18561
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -18534,10 +18570,10 @@ var useLockAttribute = function() {
|
|
|
18534
18570
|
var RemoveScrollBar = function(_a) {
|
|
18535
18571
|
var { noRelative, noImportant, gapMode: _b } = _a, gapMode = _b === undefined ? "margin" : _b;
|
|
18536
18572
|
useLockAttribute();
|
|
18537
|
-
var gap =
|
|
18573
|
+
var gap = React312.useMemo(function() {
|
|
18538
18574
|
return getGapWidth(gapMode);
|
|
18539
18575
|
}, [gapMode]);
|
|
18540
|
-
return
|
|
18576
|
+
return React312.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
18541
18577
|
};
|
|
18542
18578
|
var passiveSupported = false;
|
|
18543
18579
|
if (typeof window !== "undefined") {
|
|
@@ -18664,16 +18700,16 @@ var generateStyle = function(id) {
|
|
|
18664
18700
|
var idCounter = 0;
|
|
18665
18701
|
var lockStack = [];
|
|
18666
18702
|
function RemoveScrollSideCar(props) {
|
|
18667
|
-
var shouldPreventQueue =
|
|
18668
|
-
var touchStartRef =
|
|
18669
|
-
var activeAxis =
|
|
18670
|
-
var id =
|
|
18671
|
-
var Style2 =
|
|
18672
|
-
var lastProps =
|
|
18673
|
-
|
|
18703
|
+
var shouldPreventQueue = React32.useRef([]);
|
|
18704
|
+
var touchStartRef = React32.useRef([0, 0]);
|
|
18705
|
+
var activeAxis = React32.useRef();
|
|
18706
|
+
var id = React32.useState(idCounter++)[0];
|
|
18707
|
+
var Style2 = React32.useState(styleSingleton)[0];
|
|
18708
|
+
var lastProps = React32.useRef(props);
|
|
18709
|
+
React32.useEffect(function() {
|
|
18674
18710
|
lastProps.current = props;
|
|
18675
18711
|
}, [props]);
|
|
18676
|
-
|
|
18712
|
+
React32.useEffect(function() {
|
|
18677
18713
|
if (props.inert) {
|
|
18678
18714
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
18679
18715
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
@@ -18689,7 +18725,7 @@ function RemoveScrollSideCar(props) {
|
|
|
18689
18725
|
}
|
|
18690
18726
|
return;
|
|
18691
18727
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
18692
|
-
var shouldCancelEvent =
|
|
18728
|
+
var shouldCancelEvent = React32.useCallback(function(event, parent) {
|
|
18693
18729
|
if ("touches" in event && event.touches.length === 2) {
|
|
18694
18730
|
return !lastProps.current.allowPinchZoom;
|
|
18695
18731
|
}
|
|
@@ -18725,7 +18761,7 @@ function RemoveScrollSideCar(props) {
|
|
|
18725
18761
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
18726
18762
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
18727
18763
|
}, []);
|
|
18728
|
-
var shouldPrevent =
|
|
18764
|
+
var shouldPrevent = React32.useCallback(function(_event) {
|
|
18729
18765
|
var event = _event;
|
|
18730
18766
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
18731
18767
|
return;
|
|
@@ -18752,7 +18788,7 @@ function RemoveScrollSideCar(props) {
|
|
|
18752
18788
|
}
|
|
18753
18789
|
}
|
|
18754
18790
|
}, []);
|
|
18755
|
-
var shouldCancel =
|
|
18791
|
+
var shouldCancel = React32.useCallback(function(name, delta, target, should) {
|
|
18756
18792
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
18757
18793
|
shouldPreventQueue.current.push(event);
|
|
18758
18794
|
setTimeout(function() {
|
|
@@ -18761,17 +18797,17 @@ function RemoveScrollSideCar(props) {
|
|
|
18761
18797
|
});
|
|
18762
18798
|
}, 1);
|
|
18763
18799
|
}, []);
|
|
18764
|
-
var scrollTouchStart =
|
|
18800
|
+
var scrollTouchStart = React32.useCallback(function(event) {
|
|
18765
18801
|
touchStartRef.current = getTouchXY(event);
|
|
18766
18802
|
activeAxis.current = undefined;
|
|
18767
18803
|
}, []);
|
|
18768
|
-
var scrollWheel =
|
|
18804
|
+
var scrollWheel = React32.useCallback(function(event) {
|
|
18769
18805
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
18770
18806
|
}, []);
|
|
18771
|
-
var scrollTouchMove =
|
|
18807
|
+
var scrollTouchMove = React32.useCallback(function(event) {
|
|
18772
18808
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
18773
18809
|
}, []);
|
|
18774
|
-
|
|
18810
|
+
React32.useEffect(function() {
|
|
18775
18811
|
lockStack.push(Style2);
|
|
18776
18812
|
props.setCallbacks({
|
|
18777
18813
|
onScrollCapture: scrollWheel,
|
|
@@ -18791,7 +18827,7 @@ function RemoveScrollSideCar(props) {
|
|
|
18791
18827
|
};
|
|
18792
18828
|
}, []);
|
|
18793
18829
|
var { removeScrollBar, inert } = props;
|
|
18794
|
-
return
|
|
18830
|
+
return React32.createElement(React32.Fragment, null, inert ? React32.createElement(Style2, { styles: generateStyle(id) }) : null, removeScrollBar ? React32.createElement(RemoveScrollBar, { gapMode: props.gapMode }) : null);
|
|
18795
18831
|
}
|
|
18796
18832
|
function getOutermostShadowParent(node) {
|
|
18797
18833
|
var shadowParent = null;
|
|
@@ -19900,7 +19936,7 @@ var Switch = ({ active, onToggle }) => {
|
|
|
19900
19936
|
onClick: onToggle,
|
|
19901
19937
|
children: /* @__PURE__ */ jsx252("div", {
|
|
19902
19938
|
"data-active": active,
|
|
19903
|
-
className: "h-[20px] w-[20px]
|
|
19939
|
+
className: "h-[20px] w-[20px] left-[4px] top-[4px] transition-all rounded-full bg-white border-2 border-black absolute data-[active=true]:left-[calc(100%-24px)]"
|
|
19904
19940
|
})
|
|
19905
19941
|
});
|
|
19906
19942
|
};
|
|
@@ -23265,7 +23301,7 @@ var GitHubStars = () => {
|
|
|
23265
23301
|
width: "45px"
|
|
23266
23302
|
}),
|
|
23267
23303
|
/* @__PURE__ */ jsx50(StatItemContent, {
|
|
23268
|
-
content: "
|
|
23304
|
+
content: "41k",
|
|
23269
23305
|
width: "80px",
|
|
23270
23306
|
fontSize: "2.5rem",
|
|
23271
23307
|
fontWeight: "bold"
|
|
@@ -23478,7 +23514,7 @@ import {
|
|
|
23478
23514
|
} from "react";
|
|
23479
23515
|
import React103, {
|
|
23480
23516
|
Suspense as Suspense2,
|
|
23481
|
-
forwardRef as
|
|
23517
|
+
forwardRef as forwardRef31,
|
|
23482
23518
|
useCallback as useCallback112,
|
|
23483
23519
|
useContext as useContext52,
|
|
23484
23520
|
useEffect as useEffect122,
|
|
@@ -24306,8 +24342,8 @@ import {
|
|
|
24306
24342
|
useRef as useRef142,
|
|
24307
24343
|
useState as useState142
|
|
24308
24344
|
} from "react";
|
|
24309
|
-
import
|
|
24310
|
-
forwardRef as
|
|
24345
|
+
import React133, {
|
|
24346
|
+
forwardRef as forwardRef32,
|
|
24311
24347
|
Suspense as Suspense22,
|
|
24312
24348
|
useCallback as useCallback132,
|
|
24313
24349
|
useImperativeHandle as useImperativeHandle32,
|
|
@@ -27012,7 +27048,7 @@ var PlayerUI = ({
|
|
|
27012
27048
|
})
|
|
27013
27049
|
});
|
|
27014
27050
|
};
|
|
27015
|
-
var PlayerUI_default =
|
|
27051
|
+
var PlayerUI_default = forwardRef31(PlayerUI);
|
|
27016
27052
|
var DEFAULT_VOLUME_PERSISTANCE_KEY = "remotion.volumePreference";
|
|
27017
27053
|
var persistVolume = (volume, logLevel, volumePersistenceKey) => {
|
|
27018
27054
|
if (typeof window === "undefined") {
|
|
@@ -27066,7 +27102,8 @@ var SharedPlayerContexts = ({
|
|
|
27066
27102
|
folderName: null,
|
|
27067
27103
|
parentFolderName: null,
|
|
27068
27104
|
schema: null,
|
|
27069
|
-
calculateMetadata: null
|
|
27105
|
+
calculateMetadata: null,
|
|
27106
|
+
stack: null
|
|
27070
27107
|
}
|
|
27071
27108
|
],
|
|
27072
27109
|
folders: [],
|
|
@@ -27516,7 +27553,7 @@ var useThumbnail = () => {
|
|
|
27516
27553
|
}, [emitter]);
|
|
27517
27554
|
return returnValue;
|
|
27518
27555
|
};
|
|
27519
|
-
var reactVersion2 =
|
|
27556
|
+
var reactVersion2 = React133.version.split(".")[0];
|
|
27520
27557
|
if (reactVersion2 === "0") {
|
|
27521
27558
|
throw new Error(`Version ${reactVersion2} of "react" is not supported by Remotion`);
|
|
27522
27559
|
}
|
|
@@ -27635,7 +27672,7 @@ var ThumbnailUI = ({
|
|
|
27635
27672
|
})
|
|
27636
27673
|
});
|
|
27637
27674
|
};
|
|
27638
|
-
var ThumbnailUI_default =
|
|
27675
|
+
var ThumbnailUI_default = forwardRef32(ThumbnailUI);
|
|
27639
27676
|
var ThumbnailFn = ({
|
|
27640
27677
|
frameToDisplay,
|
|
27641
27678
|
style: style2,
|
|
@@ -32865,6 +32902,23 @@ var AudioInner = (props) => {
|
|
|
32865
32902
|
};
|
|
32866
32903
|
var Audio2 = Internals.wrapInSchema(AudioInner, audioSchema);
|
|
32867
32904
|
Internals.addSequenceStackTraces(Audio2);
|
|
32905
|
+
var OBJECT_FIT_CLASS_PATTERN = /\bobject-(contain|cover|fill|none|scale-down)\b/;
|
|
32906
|
+
var warnedStyle = false;
|
|
32907
|
+
var warnedClassName = false;
|
|
32908
|
+
var warnAboutObjectFitInStyleOrClassName = ({
|
|
32909
|
+
style: style2,
|
|
32910
|
+
className: className2,
|
|
32911
|
+
logLevel
|
|
32912
|
+
}) => {
|
|
32913
|
+
if (!warnedStyle && style2?.objectFit) {
|
|
32914
|
+
warnedStyle = true;
|
|
32915
|
+
Internals.Log.warn({ logLevel, tag: "@remotion/media" }, "Use the `objectFit` prop instead of the `style` prop.");
|
|
32916
|
+
}
|
|
32917
|
+
if (!warnedClassName && className2 && OBJECT_FIT_CLASS_PATTERN.test(className2)) {
|
|
32918
|
+
warnedClassName = true;
|
|
32919
|
+
Internals.Log.warn({ logLevel, tag: "@remotion/media" }, "Use the `objectFit` prop instead of `object-*` CSS class names.");
|
|
32920
|
+
}
|
|
32921
|
+
};
|
|
32868
32922
|
var {
|
|
32869
32923
|
useUnsafeVideoConfig: useUnsafeVideoConfig22,
|
|
32870
32924
|
Timeline: Timeline2,
|
|
@@ -32902,7 +32956,8 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
32902
32956
|
headless,
|
|
32903
32957
|
onError,
|
|
32904
32958
|
credentials,
|
|
32905
|
-
controls
|
|
32959
|
+
controls,
|
|
32960
|
+
objectFit: objectFitProp
|
|
32906
32961
|
}) => {
|
|
32907
32962
|
const src = usePreload22(unpreloadedSrc);
|
|
32908
32963
|
const canvasRef = useRef212(null);
|
|
@@ -33099,6 +33154,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
33099
33154
|
onError,
|
|
33100
33155
|
credentials
|
|
33101
33156
|
]);
|
|
33157
|
+
warnAboutObjectFitInStyleOrClassName({ style: style2, className: className2, logLevel });
|
|
33102
33158
|
const classNameValue = useMemo412(() => {
|
|
33103
33159
|
return [Internals.OBJECTFIT_CONTAIN_CLASS_NAME, className2].filter(Internals.truthy).join(" ");
|
|
33104
33160
|
}, [className2]);
|
|
@@ -33144,9 +33200,10 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
33144
33200
|
const actualStyle = useMemo412(() => {
|
|
33145
33201
|
return {
|
|
33146
33202
|
...style2,
|
|
33147
|
-
opacity: isSequenceHidden ? 0 : style2?.opacity ?? 1
|
|
33203
|
+
opacity: isSequenceHidden ? 0 : style2?.opacity ?? 1,
|
|
33204
|
+
objectFit: objectFitProp
|
|
33148
33205
|
};
|
|
33149
|
-
}, [isSequenceHidden, style2]);
|
|
33206
|
+
}, [isSequenceHidden, objectFitProp, style2]);
|
|
33150
33207
|
if (shouldFallbackToNativeVideo && !disallowFallbackToOffthreadVideo) {
|
|
33151
33208
|
return /* @__PURE__ */ jsx410(Html5Video, {
|
|
33152
33209
|
src,
|
|
@@ -33230,7 +33287,8 @@ var VideoForRendering2 = ({
|
|
|
33230
33287
|
trimBeforeValue,
|
|
33231
33288
|
headless,
|
|
33232
33289
|
onError,
|
|
33233
|
-
credentials
|
|
33290
|
+
credentials,
|
|
33291
|
+
objectFit: objectFitProp
|
|
33234
33292
|
}) => {
|
|
33235
33293
|
if (!src) {
|
|
33236
33294
|
throw new TypeError("No `src` was passed to <Video>.");
|
|
@@ -33433,9 +33491,16 @@ var VideoForRendering2 = ({
|
|
|
33433
33491
|
onError,
|
|
33434
33492
|
credentials
|
|
33435
33493
|
]);
|
|
33494
|
+
warnAboutObjectFitInStyleOrClassName({ style: style2, className: className2, logLevel });
|
|
33436
33495
|
const classNameValue = useMemo53(() => {
|
|
33437
33496
|
return [Internals.OBJECTFIT_CONTAIN_CLASS_NAME, className2].filter(Internals.truthy).join(" ");
|
|
33438
33497
|
}, [className2]);
|
|
33498
|
+
const styleWithObjectFit = useMemo53(() => {
|
|
33499
|
+
return {
|
|
33500
|
+
...style2,
|
|
33501
|
+
objectFit: objectFitProp
|
|
33502
|
+
};
|
|
33503
|
+
}, [objectFitProp, style2]);
|
|
33439
33504
|
if (replaceWithOffthreadVideo) {
|
|
33440
33505
|
const fallback = /* @__PURE__ */ jsx59(Internals.InnerOffthreadVideo, {
|
|
33441
33506
|
src,
|
|
@@ -33445,7 +33510,7 @@ var VideoForRendering2 = ({
|
|
|
33445
33510
|
loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
|
|
33446
33511
|
delayRenderRetries: delayRenderRetries ?? undefined,
|
|
33447
33512
|
delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined,
|
|
33448
|
-
style:
|
|
33513
|
+
style: styleWithObjectFit,
|
|
33449
33514
|
allowAmplificationDuringRender: true,
|
|
33450
33515
|
transparent: fallbackOffthreadVideoProps?.transparent ?? true,
|
|
33451
33516
|
toneMapped: fallbackOffthreadVideoProps?.toneMapped ?? true,
|
|
@@ -33493,7 +33558,7 @@ var VideoForRendering2 = ({
|
|
|
33493
33558
|
}
|
|
33494
33559
|
return /* @__PURE__ */ jsx59("canvas", {
|
|
33495
33560
|
ref: canvasRef,
|
|
33496
|
-
style:
|
|
33561
|
+
style: styleWithObjectFit,
|
|
33497
33562
|
className: classNameValue
|
|
33498
33563
|
});
|
|
33499
33564
|
};
|
|
@@ -33571,7 +33636,8 @@ var InnerVideo = ({
|
|
|
33571
33636
|
headless,
|
|
33572
33637
|
onError,
|
|
33573
33638
|
credentials,
|
|
33574
|
-
controls
|
|
33639
|
+
controls,
|
|
33640
|
+
objectFit
|
|
33575
33641
|
}) => {
|
|
33576
33642
|
const environment = useRemotionEnvironment();
|
|
33577
33643
|
if (typeof src !== "string") {
|
|
@@ -33614,7 +33680,8 @@ var InnerVideo = ({
|
|
|
33614
33680
|
trimBeforeValue,
|
|
33615
33681
|
headless,
|
|
33616
33682
|
onError,
|
|
33617
|
-
credentials
|
|
33683
|
+
credentials,
|
|
33684
|
+
objectFit
|
|
33618
33685
|
});
|
|
33619
33686
|
}
|
|
33620
33687
|
return /* @__PURE__ */ jsx65(VideoForPreview2, {
|
|
@@ -33641,7 +33708,8 @@ var InnerVideo = ({
|
|
|
33641
33708
|
headless: headless ?? false,
|
|
33642
33709
|
onError,
|
|
33643
33710
|
credentials,
|
|
33644
|
-
controls
|
|
33711
|
+
controls,
|
|
33712
|
+
objectFit
|
|
33645
33713
|
});
|
|
33646
33714
|
};
|
|
33647
33715
|
var VideoInner = ({
|
|
@@ -33671,7 +33739,8 @@ var VideoInner = ({
|
|
|
33671
33739
|
headless,
|
|
33672
33740
|
onError,
|
|
33673
33741
|
credentials,
|
|
33674
|
-
controls
|
|
33742
|
+
controls,
|
|
33743
|
+
objectFit
|
|
33675
33744
|
}) => {
|
|
33676
33745
|
const fallbackLogLevel = Internals.useLogLevel();
|
|
33677
33746
|
return /* @__PURE__ */ jsx65(InnerVideo, {
|
|
@@ -33701,7 +33770,8 @@ var VideoInner = ({
|
|
|
33701
33770
|
headless: headless ?? false,
|
|
33702
33771
|
onError,
|
|
33703
33772
|
credentials,
|
|
33704
|
-
controls
|
|
33773
|
+
controls,
|
|
33774
|
+
objectFit: objectFit ?? "contain"
|
|
33705
33775
|
});
|
|
33706
33776
|
};
|
|
33707
33777
|
var Video = Internals.wrapInSchema(VideoInner, videoSchema);
|
|
@@ -34080,7 +34150,7 @@ var CurrentCountry = ({ theme, countryPaths, countryLabel }) => {
|
|
|
34080
34150
|
|
|
34081
34151
|
// src/components/homepage/Demo/EmojiCard.tsx
|
|
34082
34152
|
import {
|
|
34083
|
-
forwardRef as
|
|
34153
|
+
forwardRef as forwardRef33,
|
|
34084
34154
|
useCallback as useCallback36,
|
|
34085
34155
|
useEffect as useEffect46,
|
|
34086
34156
|
useImperativeHandle as useImperativeHandle12,
|
|
@@ -34477,7 +34547,7 @@ var EmojiCardRefFn = ({ emojiIndex }, ref) => {
|
|
|
34477
34547
|
]
|
|
34478
34548
|
});
|
|
34479
34549
|
};
|
|
34480
|
-
var EmojiCard =
|
|
34550
|
+
var EmojiCard = forwardRef33(EmojiCardRefFn);
|
|
34481
34551
|
|
|
34482
34552
|
// src/components/homepage/Demo/Minus.tsx
|
|
34483
34553
|
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
@@ -35008,7 +35078,7 @@ import {
|
|
|
35008
35078
|
import { BufferTarget, StreamTarget } from "mediabunny";
|
|
35009
35079
|
|
|
35010
35080
|
// ../core/dist/esm/version.mjs
|
|
35011
|
-
var VERSION2 = "4.0.
|
|
35081
|
+
var VERSION2 = "4.0.443";
|
|
35012
35082
|
|
|
35013
35083
|
// ../web-renderer/dist/esm/index.mjs
|
|
35014
35084
|
import { AudioSample, VideoSample } from "mediabunny";
|
|
@@ -39891,7 +39961,7 @@ var PlayerVolume = ({ playerRef }) => {
|
|
|
39891
39961
|
};
|
|
39892
39962
|
|
|
39893
39963
|
// src/components/homepage/Demo/PlayPauseButton.tsx
|
|
39894
|
-
import
|
|
39964
|
+
import React73, { useCallback as useCallback45, useEffect as useEffect53 } from "react";
|
|
39895
39965
|
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
39896
39966
|
var playerButtonStyle2 = {
|
|
39897
39967
|
appearance: "none",
|
|
@@ -39908,7 +39978,7 @@ var playerButtonStyle2 = {
|
|
|
39908
39978
|
color: PALETTE.TEXT_COLOR
|
|
39909
39979
|
};
|
|
39910
39980
|
var PlayPauseButton = ({ playerRef }) => {
|
|
39911
|
-
const [playing, setPlaying] =
|
|
39981
|
+
const [playing, setPlaying] = React73.useState(true);
|
|
39912
39982
|
useEffect53(() => {
|
|
39913
39983
|
const { current } = playerRef;
|
|
39914
39984
|
if (!current) {
|
|
@@ -39946,7 +40016,7 @@ var PlayPauseButton = ({ playerRef }) => {
|
|
|
39946
40016
|
};
|
|
39947
40017
|
|
|
39948
40018
|
// src/components/homepage/Demo/TimeDisplay.tsx
|
|
39949
|
-
import
|
|
40019
|
+
import React75, { useEffect as useEffect55 } from "react";
|
|
39950
40020
|
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
39951
40021
|
var formatTime2 = (timeInSeconds) => {
|
|
39952
40022
|
const minutes = Math.floor(timeInSeconds / 60);
|
|
@@ -39954,7 +40024,7 @@ var formatTime2 = (timeInSeconds) => {
|
|
|
39954
40024
|
return `${String(minutes)}:${String(seconds).padStart(2, "0")}`;
|
|
39955
40025
|
};
|
|
39956
40026
|
var TimeDisplay = ({ fps, playerRef }) => {
|
|
39957
|
-
const [time, setTime] =
|
|
40027
|
+
const [time, setTime] = React75.useState(0);
|
|
39958
40028
|
useEffect55(() => {
|
|
39959
40029
|
const { current } = playerRef;
|
|
39960
40030
|
if (!current) {
|
|
@@ -40033,7 +40103,7 @@ var PlayerControls = ({ playerRef, durationInFrames, fps, children }) => {
|
|
|
40033
40103
|
};
|
|
40034
40104
|
|
|
40035
40105
|
// src/components/homepage/Demo/ThemeNudge.tsx
|
|
40036
|
-
import
|
|
40106
|
+
import React76 from "react";
|
|
40037
40107
|
import { jsx as jsx110, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
40038
40108
|
var origWidth3 = 21;
|
|
40039
40109
|
var scale3 = 0.4;
|
|
@@ -40055,7 +40125,7 @@ var Icon6 = () => {
|
|
|
40055
40125
|
};
|
|
40056
40126
|
var ThemeNudge = () => {
|
|
40057
40127
|
const { colorMode, setColorMode } = useColorMode();
|
|
40058
|
-
const toggleTheme =
|
|
40128
|
+
const toggleTheme = React76.useCallback((e) => {
|
|
40059
40129
|
e.preventDefault();
|
|
40060
40130
|
setColorMode(colorMode === "dark" ? "light" : "dark");
|
|
40061
40131
|
}, [colorMode, setColorMode]);
|
|
@@ -40279,12 +40349,12 @@ var ClearButton = (props) => {
|
|
|
40279
40349
|
|
|
40280
40350
|
// src/components/homepage/MuxVideo.tsx
|
|
40281
40351
|
import Hls2 from "hls.js";
|
|
40282
|
-
import { forwardRef as
|
|
40352
|
+
import { forwardRef as forwardRef36, useEffect as useEffect58, useImperativeHandle as useImperativeHandle14, useRef as useRef53 } from "react";
|
|
40283
40353
|
|
|
40284
40354
|
// src/components/homepage/VideoPlayerWithControls.tsx
|
|
40285
40355
|
import Hls from "hls.js";
|
|
40286
40356
|
import"plyr/dist/plyr.css";
|
|
40287
|
-
import { forwardRef as
|
|
40357
|
+
import { forwardRef as forwardRef35, useCallback as useCallback47, useEffect as useEffect57, useRef as useRef51, useState as useState57 } from "react";
|
|
40288
40358
|
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
40289
40359
|
var useCombinedRefs = function(...refs) {
|
|
40290
40360
|
const targetRef = useRef51(null);
|
|
@@ -40301,7 +40371,7 @@ var useCombinedRefs = function(...refs) {
|
|
|
40301
40371
|
}, [refs]);
|
|
40302
40372
|
return targetRef;
|
|
40303
40373
|
};
|
|
40304
|
-
var VideoPlayerWithControls =
|
|
40374
|
+
var VideoPlayerWithControls = forwardRef35(({ playbackId, poster, currentTime, onLoaded, onError, onSize, autoPlay }, ref) => {
|
|
40305
40375
|
const videoRef = useRef51(null);
|
|
40306
40376
|
const metaRef = useCombinedRefs(ref, videoRef);
|
|
40307
40377
|
const playerRef = useRef51(null);
|
|
@@ -40417,7 +40487,7 @@ var MuxVideoForward = ({ muxId, ...props }, ref) => {
|
|
|
40417
40487
|
...props
|
|
40418
40488
|
});
|
|
40419
40489
|
};
|
|
40420
|
-
var MuxVideo =
|
|
40490
|
+
var MuxVideo = forwardRef36(MuxVideoForward);
|
|
40421
40491
|
|
|
40422
40492
|
// src/components/homepage/EditorStarterSection.tsx
|
|
40423
40493
|
import { jsx as jsx118, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
@@ -40963,7 +41033,7 @@ var RealMP4Videos = () => {
|
|
|
40963
41033
|
/* @__PURE__ */ jsxs48("p", {
|
|
40964
41034
|
className: "leading-relaxed",
|
|
40965
41035
|
children: [
|
|
40966
|
-
"Render the video .mp4 or other formats. ",
|
|
41036
|
+
"Render the video as .mp4 or other formats. ",
|
|
40967
41037
|
/* @__PURE__ */ jsx126("br", {}),
|
|
40968
41038
|
"Locally, on the server or serverless."
|
|
40969
41039
|
]
|
|
@@ -41484,6 +41554,7 @@ var listOfRemotionPackages = [
|
|
|
41484
41554
|
"@remotion/convert",
|
|
41485
41555
|
"@remotion/captions",
|
|
41486
41556
|
"@remotion/openai-whisper",
|
|
41557
|
+
"@remotion/elevenlabs",
|
|
41487
41558
|
"@remotion/compositor",
|
|
41488
41559
|
"@remotion/example-videos",
|
|
41489
41560
|
"@remotion/whisper-web",
|
|
@@ -42748,7 +42819,7 @@ var GithubButton = () => {
|
|
|
42748
42819
|
" ",
|
|
42749
42820
|
/* @__PURE__ */ jsx164("div", {
|
|
42750
42821
|
className: "text-xs inline-block ml-2 leading-none mt-[3px] self-center",
|
|
42751
|
-
children: "
|
|
42822
|
+
children: "41k"
|
|
42752
42823
|
})
|
|
42753
42824
|
]
|
|
42754
42825
|
});
|