@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/team.js
CHANGED
|
@@ -1556,7 +1556,7 @@ var getDefaultConfig = () => {
|
|
|
1556
1556
|
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
1557
1557
|
|
|
1558
1558
|
// ../design/dist/esm/index.mjs
|
|
1559
|
-
import
|
|
1559
|
+
import React2, { useEffect as useEffect18, useMemo as useMemo36, useState as useState20 } from "react";
|
|
1560
1560
|
|
|
1561
1561
|
// ../paths/dist/esm/index.mjs
|
|
1562
1562
|
var cutLInstruction = ({
|
|
@@ -5895,176 +5895,176 @@ var extrudeAndTransformElement = (options) => {
|
|
|
5895
5895
|
|
|
5896
5896
|
// ../core/dist/esm/index.mjs
|
|
5897
5897
|
import { createContext } from "react";
|
|
5898
|
-
import {
|
|
5898
|
+
import { Suspense, useContext as useContext9, useEffect as useEffect2 } from "react";
|
|
5899
|
+
import { createPortal } from "react-dom";
|
|
5900
|
+
import { createContext as createContext2 } from "react";
|
|
5899
5901
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
5902
|
+
import { createContext as createContext3 } from "react";
|
|
5903
|
+
import { createContext as createContext5, useContext as useContext2, useEffect, useMemo as useMemo2 } from "react";
|
|
5904
|
+
import { createContext as createContext4, useCallback, useContext, useMemo as useMemo3, useRef } from "react";
|
|
5905
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5906
|
+
import { createContext as createContext6, useContext as useContext3 } from "react";
|
|
5907
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
5908
|
+
import { forwardRef, useMemo as useMemo32 } from "react";
|
|
5909
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
5910
|
+
import { jsx as jsx52, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
5911
|
+
import { createContext as createContext8, createRef, useContext as useContext5, useMemo as useMemo5 } from "react";
|
|
5912
|
+
import React3, { createContext as createContext7, useCallback as useCallback2, useMemo as useMemo4 } from "react";
|
|
5913
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
5914
|
+
import { useContext as useContext4, useState } from "react";
|
|
5915
|
+
import React4 from "react";
|
|
5916
|
+
import { createContext as createContext10, useCallback as useCallback3, useContext as useContext7 } from "react";
|
|
5917
|
+
import { createContext as createContext9 } from "react";
|
|
5918
|
+
import * as React5 from "react";
|
|
5919
|
+
import React6, { useMemo as useMemo6, useRef as useRef2 } from "react";
|
|
5920
|
+
import { useContext as useContext8, useMemo as useMemo7 } from "react";
|
|
5921
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
5900
5922
|
import {
|
|
5901
5923
|
forwardRef as forwardRef2,
|
|
5902
|
-
useContext as
|
|
5903
|
-
useEffect,
|
|
5904
|
-
useMemo as
|
|
5924
|
+
useContext as useContext15,
|
|
5925
|
+
useEffect as useEffect3,
|
|
5926
|
+
useMemo as useMemo13,
|
|
5905
5927
|
useState as useState4
|
|
5906
5928
|
} from "react";
|
|
5907
|
-
import {
|
|
5908
|
-
import {
|
|
5909
|
-
import { useContext as
|
|
5910
|
-
import { createContext as createContext3 } from "react";
|
|
5911
|
-
import { useContext as useContext7, useMemo as useMemo6 } from "react";
|
|
5929
|
+
import { useContext as useContext14, useMemo as useMemo11 } from "react";
|
|
5930
|
+
import { createContext as createContext11 } from "react";
|
|
5931
|
+
import { useContext as useContext10, useMemo as useMemo9 } from "react";
|
|
5912
5932
|
import {
|
|
5913
|
-
createContext as
|
|
5933
|
+
createContext as createContext12,
|
|
5914
5934
|
useLayoutEffect,
|
|
5915
|
-
useMemo as
|
|
5916
|
-
useRef,
|
|
5935
|
+
useMemo as useMemo8,
|
|
5936
|
+
useRef as useRef3,
|
|
5917
5937
|
useState as useState2
|
|
5918
5938
|
} from "react";
|
|
5919
|
-
import { createContext as createContext5, useCallback, useContext as useContext4 } from "react";
|
|
5920
|
-
import { createContext as createContext4 } from "react";
|
|
5921
|
-
import * as React2 from "react";
|
|
5922
|
-
import { useContext as useContext3, useState } from "react";
|
|
5923
|
-
import React3 from "react";
|
|
5924
|
-
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
5925
|
-
import { useContext as useContext6, useMemo as useMemo5 } from "react";
|
|
5926
|
-
import { createContext as createContext7 } from "react";
|
|
5927
|
-
import { createContext as createContext9, createRef, useContext as useContext5, useMemo as useMemo4 } from "react";
|
|
5928
|
-
import React5, { createContext as createContext8, useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
5929
|
-
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
5930
|
-
import { useContext as useContext8 } from "react";
|
|
5931
|
-
import { createContext as createContext10 } from "react";
|
|
5932
|
-
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
5933
|
-
import { useContext as useContext10 } from "react";
|
|
5934
|
-
import { useContext as useContext9, useMemo as useMemo7 } from "react";
|
|
5935
|
-
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
5936
|
-
import { createContext as createContext11, useCallback as useCallback3, useContext as useContext12, useMemo as useMemo9, useRef as useRef2 } from "react";
|
|
5937
|
-
import { createContext as createContext12 } from "react";
|
|
5938
|
-
import React8, { useCallback as useCallback4, useMemo as useMemo10, useRef as useRef3, useState as useState3 } from "react";
|
|
5939
|
-
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
5940
5939
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
5940
|
+
import { useContext as useContext11 } from "react";
|
|
5941
|
+
import { useContext as useContext13 } from "react";
|
|
5942
|
+
import { useContext as useContext12, useMemo as useMemo10 } from "react";
|
|
5943
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5944
|
+
import { createContext as createContext13 } from "react";
|
|
5945
|
+
import React10, { useCallback as useCallback4, useMemo as useMemo12, useRef as useRef4, useState as useState3 } from "react";
|
|
5946
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
5947
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
5941
5948
|
import {
|
|
5942
5949
|
forwardRef as forwardRef3,
|
|
5943
|
-
useEffect as
|
|
5950
|
+
useEffect as useEffect4,
|
|
5944
5951
|
useImperativeHandle as useImperativeHandle2,
|
|
5945
5952
|
useLayoutEffect as useLayoutEffect2,
|
|
5946
|
-
useRef as
|
|
5953
|
+
useRef as useRef6,
|
|
5947
5954
|
useState as useState5
|
|
5948
5955
|
} from "react";
|
|
5949
|
-
import
|
|
5950
|
-
import { jsx as
|
|
5951
|
-
import { jsx as
|
|
5952
|
-
import { useContext as
|
|
5956
|
+
import React12, { useCallback as useCallback5, useImperativeHandle, useRef as useRef5 } from "react";
|
|
5957
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5958
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
5959
|
+
import { useContext as useContext16, useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
|
|
5953
5960
|
import {
|
|
5954
|
-
createContext as
|
|
5961
|
+
createContext as createContext14,
|
|
5955
5962
|
useCallback as useCallback6,
|
|
5956
5963
|
useImperativeHandle as useImperativeHandle3,
|
|
5957
5964
|
useLayoutEffect as useLayoutEffect3,
|
|
5958
|
-
useMemo as
|
|
5959
|
-
useRef as
|
|
5965
|
+
useMemo as useMemo14,
|
|
5966
|
+
useRef as useRef7,
|
|
5960
5967
|
useState as useState6
|
|
5961
5968
|
} from "react";
|
|
5962
|
-
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
5963
|
-
import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext26 } from "react";
|
|
5964
|
-
import React11, { createContext as createContext14, useMemo as useMemo13 } from "react";
|
|
5965
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5966
|
-
import { useContext as useContext15 } from "react";
|
|
5967
|
-
import { createContext as createContext15, useEffect as useEffect3, useState as useState8 } from "react";
|
|
5968
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
5969
|
-
import { createContext as createContext16, useMemo as useMemo14, useReducer } from "react";
|
|
5970
5969
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
5971
|
-
import
|
|
5970
|
+
import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext28 } from "react";
|
|
5971
|
+
import React13, { createContext as createContext15, useMemo as useMemo15 } from "react";
|
|
5972
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
5973
|
+
import { useContext as useContext17 } from "react";
|
|
5974
|
+
import { createContext as createContext16, useEffect as useEffect5, useState as useState8 } from "react";
|
|
5975
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5976
|
+
import { createContext as createContext17, useMemo as useMemo16, useReducer } from "react";
|
|
5977
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5978
|
+
import React19, {
|
|
5972
5979
|
forwardRef as forwardRef4,
|
|
5973
|
-
useContext as
|
|
5974
|
-
useEffect as
|
|
5980
|
+
useContext as useContext26,
|
|
5981
|
+
useEffect as useEffect12,
|
|
5975
5982
|
useImperativeHandle as useImperativeHandle4,
|
|
5976
|
-
useMemo as
|
|
5977
|
-
useRef as
|
|
5983
|
+
useMemo as useMemo24,
|
|
5984
|
+
useRef as useRef15,
|
|
5978
5985
|
useState as useState13
|
|
5979
5986
|
} from "react";
|
|
5980
|
-
import { useContext as
|
|
5981
|
-
import
|
|
5982
|
-
createContext as
|
|
5987
|
+
import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useRef as useRef10 } from "react";
|
|
5988
|
+
import React16, {
|
|
5989
|
+
createContext as createContext18,
|
|
5983
5990
|
createRef as createRef2,
|
|
5984
5991
|
useCallback as useCallback7,
|
|
5985
|
-
useContext as
|
|
5986
|
-
useMemo as
|
|
5987
|
-
useRef as
|
|
5992
|
+
useContext as useContext18,
|
|
5993
|
+
useMemo as useMemo18,
|
|
5994
|
+
useRef as useRef8,
|
|
5988
5995
|
useState as useState9
|
|
5989
5996
|
} from "react";
|
|
5990
|
-
import { useMemo as
|
|
5991
|
-
import { jsx as
|
|
5992
|
-
import { useRef as
|
|
5993
|
-
import { useContext as
|
|
5994
|
-
import { useContext as
|
|
5997
|
+
import { useMemo as useMemo17 } from "react";
|
|
5998
|
+
import { jsx as jsx18, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5999
|
+
import { useRef as useRef9 } from "react";
|
|
6000
|
+
import { useContext as useContext21, useEffect as useEffect6, useMemo as useMemo19, useState as useState10 } from "react";
|
|
6001
|
+
import { useContext as useContext20 } from "react";
|
|
5995
6002
|
import {
|
|
5996
6003
|
useCallback as useCallback10,
|
|
5997
|
-
useContext as
|
|
5998
|
-
useEffect as
|
|
6004
|
+
useContext as useContext24,
|
|
6005
|
+
useEffect as useEffect10,
|
|
5999
6006
|
useLayoutEffect as useLayoutEffect7,
|
|
6000
|
-
useRef as
|
|
6007
|
+
useRef as useRef14
|
|
6001
6008
|
} from "react";
|
|
6002
|
-
import { useCallback as useCallback9, useMemo as
|
|
6003
|
-
import { useContext as
|
|
6004
|
-
import
|
|
6009
|
+
import { useCallback as useCallback9, useMemo as useMemo22, useRef as useRef12 } from "react";
|
|
6010
|
+
import { useContext as useContext23, useMemo as useMemo21 } from "react";
|
|
6011
|
+
import React17, {
|
|
6005
6012
|
useCallback as useCallback8,
|
|
6006
|
-
useContext as
|
|
6007
|
-
useEffect as
|
|
6013
|
+
useContext as useContext22,
|
|
6014
|
+
useEffect as useEffect7,
|
|
6008
6015
|
useLayoutEffect as useLayoutEffect6,
|
|
6009
|
-
useMemo as
|
|
6010
|
-
useRef as
|
|
6016
|
+
useMemo as useMemo20,
|
|
6017
|
+
useRef as useRef11,
|
|
6011
6018
|
useState as useState11
|
|
6012
6019
|
} from "react";
|
|
6013
|
-
import { jsx as
|
|
6014
|
-
import
|
|
6015
|
-
import { useEffect as
|
|
6016
|
-
import { useEffect as
|
|
6017
|
-
import { useEffect as
|
|
6018
|
-
import { createContext as
|
|
6019
|
-
import { jsx as
|
|
6020
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
6021
|
+
import React18 from "react";
|
|
6022
|
+
import { useEffect as useEffect8, useState as useState12 } from "react";
|
|
6023
|
+
import { useEffect as useEffect9, useRef as useRef13 } from "react";
|
|
6024
|
+
import { useEffect as useEffect11 } from "react";
|
|
6025
|
+
import { createContext as createContext19, useContext as useContext25, useMemo as useMemo23 } from "react";
|
|
6026
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
6020
6027
|
import {
|
|
6021
6028
|
forwardRef as forwardRef5,
|
|
6022
|
-
useContext as
|
|
6023
|
-
useEffect as
|
|
6029
|
+
useContext as useContext27,
|
|
6030
|
+
useEffect as useEffect13,
|
|
6024
6031
|
useImperativeHandle as useImperativeHandle5,
|
|
6025
6032
|
useLayoutEffect as useLayoutEffect8,
|
|
6026
|
-
useMemo as
|
|
6027
|
-
useRef as
|
|
6033
|
+
useMemo as useMemo25,
|
|
6034
|
+
useRef as useRef16
|
|
6028
6035
|
} from "react";
|
|
6029
|
-
import { jsx as
|
|
6030
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
6031
|
-
import { Suspense, useContext as useContext28, useEffect as useEffect13 } from "react";
|
|
6032
|
-
import { createPortal } from "react-dom";
|
|
6033
|
-
import { createContext as createContext19, useContext as useContext27, useEffect as useEffect12, useMemo as useMemo24 } from "react";
|
|
6034
|
-
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
6035
|
-
import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6036
|
-
import React20, { useMemo as useMemo25, useRef as useRef16 } from "react";
|
|
6036
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
6037
6037
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
6038
6038
|
import { forwardRef as forwardRef7, useCallback as useCallback12, useState as useState14 } from "react";
|
|
6039
6039
|
import { jsx as jsx232 } from "react/jsx-runtime";
|
|
6040
6040
|
import {
|
|
6041
|
-
forwardRef as forwardRef8,
|
|
6042
6041
|
useCallback as useCallback13,
|
|
6043
|
-
useContext as
|
|
6042
|
+
useContext as useContext30,
|
|
6044
6043
|
useImperativeHandle as useImperativeHandle6,
|
|
6045
6044
|
useLayoutEffect as useLayoutEffect9,
|
|
6046
6045
|
useRef as useRef17,
|
|
6047
|
-
useState as
|
|
6046
|
+
useState as useState16
|
|
6048
6047
|
} from "react";
|
|
6048
|
+
import React23, { forwardRef as forwardRef8, useMemo as useMemo27 } from "react";
|
|
6049
|
+
import { useContext as useContext29, useMemo as useMemo26, useState as useState15 } from "react";
|
|
6049
6050
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
6050
6051
|
import { createRef as createRef3 } from "react";
|
|
6051
|
-
import
|
|
6052
|
+
import React25 from "react";
|
|
6052
6053
|
import {
|
|
6053
6054
|
useCallback as useCallback14,
|
|
6054
6055
|
useImperativeHandle as useImperativeHandle7,
|
|
6055
|
-
useMemo as
|
|
6056
|
+
useMemo as useMemo28,
|
|
6056
6057
|
useRef as useRef18,
|
|
6057
|
-
useState as
|
|
6058
|
+
useState as useState17
|
|
6058
6059
|
} from "react";
|
|
6059
6060
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
6060
|
-
import
|
|
6061
|
-
import { useMemo as
|
|
6062
|
-
import { createContext as createContext20, useContext as
|
|
6061
|
+
import React26 from "react";
|
|
6062
|
+
import { useMemo as useMemo30 } from "react";
|
|
6063
|
+
import { createContext as createContext20, useContext as useContext31, useMemo as useMemo29 } from "react";
|
|
6063
6064
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
6064
6065
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
6065
|
-
import
|
|
6066
|
-
import
|
|
6067
|
-
import { useContext as useContext31, useMemo as useMemo29, useState as useState17 } from "react";
|
|
6066
|
+
import React28 from "react";
|
|
6067
|
+
import React29, { createContext as createContext21 } from "react";
|
|
6068
6068
|
import { useContext as useContext32 } from "react";
|
|
6069
6069
|
import { useCallback as useCallback16 } from "react";
|
|
6070
6070
|
import {
|
|
@@ -6072,34 +6072,33 @@ import {
|
|
|
6072
6072
|
useContext as useContext33,
|
|
6073
6073
|
useEffect as useEffect14,
|
|
6074
6074
|
useLayoutEffect as useLayoutEffect10,
|
|
6075
|
-
useMemo as
|
|
6075
|
+
useMemo as useMemo31,
|
|
6076
6076
|
useState as useState18
|
|
6077
6077
|
} from "react";
|
|
6078
6078
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
6079
|
-
import
|
|
6079
|
+
import React31, {
|
|
6080
6080
|
forwardRef as forwardRef9,
|
|
6081
6081
|
useContext as useContext34,
|
|
6082
6082
|
useEffect as useEffect16,
|
|
6083
6083
|
useImperativeHandle as useImperativeHandle8,
|
|
6084
|
-
useMemo as
|
|
6084
|
+
useMemo as useMemo322,
|
|
6085
6085
|
useRef as useRef19,
|
|
6086
6086
|
useState as useState19
|
|
6087
6087
|
} from "react";
|
|
6088
6088
|
import { useEffect as useEffect15 } from "react";
|
|
6089
6089
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
6090
6090
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
6091
|
-
import React32, { forwardRef as forwardRef10, useMemo as useMemo32 } from "react";
|
|
6092
6091
|
import React33, { useMemo as useMemo33 } from "react";
|
|
6093
6092
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
6094
|
-
import { Children, forwardRef as
|
|
6093
|
+
import { Children, forwardRef as forwardRef10, useMemo as useMemo34 } from "react";
|
|
6095
6094
|
import React34 from "react";
|
|
6096
6095
|
import React35, { createContext as createContext22 } from "react";
|
|
6097
6096
|
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
6098
6097
|
import { jsx as jsx332 } from "react/jsx-runtime";
|
|
6099
6098
|
import React37 from "react";
|
|
6100
|
-
import { forwardRef as
|
|
6099
|
+
import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext36 } from "react";
|
|
6101
6100
|
import {
|
|
6102
|
-
forwardRef as
|
|
6101
|
+
forwardRef as forwardRef11,
|
|
6103
6102
|
useContext as useContext35,
|
|
6104
6103
|
useEffect as useEffect17,
|
|
6105
6104
|
useImperativeHandle as useImperativeHandle9,
|
|
@@ -6134,53 +6133,171 @@ if (typeof createContext !== "function") {
|
|
|
6134
6133
|
throw new Error(err.join(`
|
|
6135
6134
|
`));
|
|
6136
6135
|
}
|
|
6137
|
-
var
|
|
6138
|
-
var
|
|
6139
|
-
|
|
6140
|
-
componentsToAddStacksTo.push(component);
|
|
6141
|
-
};
|
|
6142
|
-
var IsPlayerContext = createContext2(false);
|
|
6143
|
-
var IsPlayerContextProvider = ({
|
|
6144
|
-
children
|
|
6145
|
-
}) => {
|
|
6146
|
-
return /* @__PURE__ */ jsx11(IsPlayerContext.Provider, {
|
|
6136
|
+
var CanUseRemotionHooks = createContext2(false);
|
|
6137
|
+
var CanUseRemotionHooksProvider = ({ children }) => {
|
|
6138
|
+
return /* @__PURE__ */ jsx11(CanUseRemotionHooks.Provider, {
|
|
6147
6139
|
value: true,
|
|
6148
6140
|
children
|
|
6149
6141
|
});
|
|
6150
6142
|
};
|
|
6151
|
-
var
|
|
6152
|
-
|
|
6143
|
+
var CompositionManager = createContext3({
|
|
6144
|
+
compositions: [],
|
|
6145
|
+
folders: [],
|
|
6146
|
+
currentCompositionMetadata: null,
|
|
6147
|
+
canvasContent: null
|
|
6148
|
+
});
|
|
6149
|
+
var CompositionSetters = createContext3({
|
|
6150
|
+
registerComposition: () => {
|
|
6151
|
+
return;
|
|
6152
|
+
},
|
|
6153
|
+
unregisterComposition: () => {
|
|
6154
|
+
return;
|
|
6155
|
+
},
|
|
6156
|
+
registerFolder: () => {
|
|
6157
|
+
return;
|
|
6158
|
+
},
|
|
6159
|
+
unregisterFolder: () => {
|
|
6160
|
+
return;
|
|
6161
|
+
},
|
|
6162
|
+
setCanvasContent: () => {
|
|
6163
|
+
return;
|
|
6164
|
+
},
|
|
6165
|
+
onlyRenderComposition: null
|
|
6166
|
+
});
|
|
6167
|
+
var NonceContext = createContext4({
|
|
6168
|
+
getNonce: () => 0
|
|
6169
|
+
});
|
|
6170
|
+
var fastRefreshNonce = 0;
|
|
6171
|
+
try {
|
|
6172
|
+
if (typeof __webpack_module__ !== "undefined") {
|
|
6173
|
+
if (__webpack_module__.hot) {
|
|
6174
|
+
__webpack_module__.hot.addStatusHandler((status) => {
|
|
6175
|
+
if (status === "idle") {
|
|
6176
|
+
fastRefreshNonce++;
|
|
6177
|
+
}
|
|
6178
|
+
});
|
|
6179
|
+
}
|
|
6180
|
+
}
|
|
6181
|
+
} catch {}
|
|
6182
|
+
var useNonce = () => {
|
|
6183
|
+
const context = useContext(NonceContext);
|
|
6184
|
+
const nonce = context.getNonce();
|
|
6185
|
+
const nonceRef = useRef(nonce);
|
|
6186
|
+
nonceRef.current = nonce;
|
|
6187
|
+
const history = useRef([[fastRefreshNonce, nonce]]);
|
|
6188
|
+
const get = useCallback(() => {
|
|
6189
|
+
if (fastRefreshNonce !== history.current[history.current.length - 1][0]) {
|
|
6190
|
+
history.current = [
|
|
6191
|
+
...history.current,
|
|
6192
|
+
[fastRefreshNonce, nonceRef.current]
|
|
6193
|
+
];
|
|
6194
|
+
}
|
|
6195
|
+
return history.current;
|
|
6196
|
+
}, [history]);
|
|
6197
|
+
return useMemo3(() => {
|
|
6198
|
+
return { get };
|
|
6199
|
+
}, [get]);
|
|
6153
6200
|
};
|
|
6154
6201
|
function truthy2(value) {
|
|
6155
6202
|
return Boolean(value);
|
|
6156
6203
|
}
|
|
6157
|
-
var
|
|
6158
|
-
var
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6204
|
+
var getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
6205
|
+
var invalidFolderNameErrorMessage = `Folder name must match ${String(getRegex())}`;
|
|
6206
|
+
var FolderContext = createContext5({
|
|
6207
|
+
folderName: null,
|
|
6208
|
+
parentName: null
|
|
6209
|
+
});
|
|
6210
|
+
function getNodeEnvString() {
|
|
6211
|
+
return ["NOD", "E_EN", "V"].join("");
|
|
6212
|
+
}
|
|
6213
|
+
var getEnvString = () => {
|
|
6214
|
+
return ["e", "nv"].join("");
|
|
6215
|
+
};
|
|
6216
|
+
var getRemotionEnvironment = () => {
|
|
6217
|
+
const isPlayer = typeof window !== "undefined" && window.remotion_isPlayer;
|
|
6218
|
+
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");
|
|
6219
|
+
const isStudio = typeof window !== "undefined" && window.remotion_isStudio;
|
|
6220
|
+
const isReadOnlyStudio = typeof window !== "undefined" && window.remotion_isReadOnlyStudio;
|
|
6221
|
+
return {
|
|
6222
|
+
isStudio,
|
|
6223
|
+
isRendering,
|
|
6224
|
+
isPlayer,
|
|
6225
|
+
isReadOnlyStudio,
|
|
6226
|
+
isClientSideRendering: false
|
|
6167
6227
|
};
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6228
|
+
};
|
|
6229
|
+
var DATE_TOKEN = "remotion-date:";
|
|
6230
|
+
var FILE_TOKEN = "remotion-file:";
|
|
6231
|
+
var serializeJSONWithSpecialTypes = ({
|
|
6232
|
+
data,
|
|
6233
|
+
indent,
|
|
6234
|
+
staticBase
|
|
6235
|
+
}) => {
|
|
6236
|
+
let customDateUsed = false;
|
|
6237
|
+
let customFileUsed = false;
|
|
6238
|
+
let mapUsed = false;
|
|
6239
|
+
let setUsed = false;
|
|
6240
|
+
try {
|
|
6241
|
+
const serializedString = JSON.stringify(data, function(key, value) {
|
|
6242
|
+
const item = this[key];
|
|
6243
|
+
if (item instanceof Date) {
|
|
6244
|
+
customDateUsed = true;
|
|
6245
|
+
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
6246
|
+
}
|
|
6247
|
+
if (item instanceof Map) {
|
|
6248
|
+
mapUsed = true;
|
|
6249
|
+
return value;
|
|
6250
|
+
}
|
|
6251
|
+
if (item instanceof Set) {
|
|
6252
|
+
setUsed = true;
|
|
6253
|
+
return value;
|
|
6254
|
+
}
|
|
6255
|
+
if (typeof item === "string" && staticBase !== null && item.startsWith(staticBase)) {
|
|
6256
|
+
customFileUsed = true;
|
|
6257
|
+
return `${FILE_TOKEN}${item.replace(staticBase + "/", "")}`;
|
|
6258
|
+
}
|
|
6259
|
+
return value;
|
|
6260
|
+
}, indent);
|
|
6261
|
+
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
6262
|
+
} catch (err) {
|
|
6263
|
+
throw new Error("Could not serialize the passed input props to JSON: " + err.message);
|
|
6264
|
+
}
|
|
6265
|
+
};
|
|
6266
|
+
var deserializeJSONWithSpecialTypes = (data) => {
|
|
6267
|
+
return JSON.parse(data, (_, value) => {
|
|
6268
|
+
if (typeof value === "string" && value.startsWith(DATE_TOKEN)) {
|
|
6269
|
+
return new Date(value.replace(DATE_TOKEN, ""));
|
|
6172
6270
|
}
|
|
6173
|
-
if (typeof
|
|
6174
|
-
|
|
6175
|
-
return;
|
|
6271
|
+
if (typeof value === "string" && value.startsWith(FILE_TOKEN)) {
|
|
6272
|
+
return `${window.remotion_staticBase}/${value.replace(FILE_TOKEN, "")}`;
|
|
6176
6273
|
}
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6274
|
+
return value;
|
|
6275
|
+
});
|
|
6276
|
+
};
|
|
6277
|
+
var serializeThenDeserialize = (props) => {
|
|
6278
|
+
return deserializeJSONWithSpecialTypes(serializeJSONWithSpecialTypes({
|
|
6279
|
+
data: props,
|
|
6280
|
+
indent: 2,
|
|
6281
|
+
staticBase: window.remotion_staticBase
|
|
6282
|
+
}).serializedString);
|
|
6283
|
+
};
|
|
6284
|
+
var serializeThenDeserializeInStudio = (props) => {
|
|
6285
|
+
if (getRemotionEnvironment().isStudio) {
|
|
6286
|
+
return serializeThenDeserialize(props);
|
|
6182
6287
|
}
|
|
6183
|
-
|
|
6288
|
+
return props;
|
|
6289
|
+
};
|
|
6290
|
+
var IsPlayerContext = createContext6(false);
|
|
6291
|
+
var IsPlayerContextProvider = ({
|
|
6292
|
+
children
|
|
6293
|
+
}) => {
|
|
6294
|
+
return /* @__PURE__ */ jsx33(IsPlayerContext.Provider, {
|
|
6295
|
+
value: true,
|
|
6296
|
+
children
|
|
6297
|
+
});
|
|
6298
|
+
};
|
|
6299
|
+
var useIsPlayer = () => {
|
|
6300
|
+
return useContext3(IsPlayerContext);
|
|
6184
6301
|
};
|
|
6185
6302
|
var hasTailwindClassName = ({
|
|
6186
6303
|
className,
|
|
@@ -6204,7 +6321,7 @@ var hasTailwindClassName = ({
|
|
|
6204
6321
|
};
|
|
6205
6322
|
var AbsoluteFillRefForwarding = (props, ref) => {
|
|
6206
6323
|
const { style, ...other } = props;
|
|
6207
|
-
const actualStyle =
|
|
6324
|
+
const actualStyle = useMemo32(() => {
|
|
6208
6325
|
return {
|
|
6209
6326
|
position: "absolute",
|
|
6210
6327
|
top: hasTailwindClassName({
|
|
@@ -6267,168 +6384,402 @@ var AbsoluteFillRefForwarding = (props, ref) => {
|
|
|
6267
6384
|
...style
|
|
6268
6385
|
};
|
|
6269
6386
|
}, [other.className, style]);
|
|
6270
|
-
return /* @__PURE__ */
|
|
6387
|
+
return /* @__PURE__ */ jsx43("div", {
|
|
6271
6388
|
ref,
|
|
6272
6389
|
style: actualStyle,
|
|
6273
6390
|
...other
|
|
6274
6391
|
});
|
|
6275
6392
|
};
|
|
6276
6393
|
var AbsoluteFill = forwardRef(AbsoluteFillRefForwarding);
|
|
6277
|
-
var
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
}
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6394
|
+
var rotate = {
|
|
6395
|
+
transform: `rotate(90deg)`
|
|
6396
|
+
};
|
|
6397
|
+
var ICON_SIZE = 40;
|
|
6398
|
+
var label = {
|
|
6399
|
+
color: "white",
|
|
6400
|
+
fontSize: 14,
|
|
6401
|
+
fontFamily: "sans-serif"
|
|
6402
|
+
};
|
|
6403
|
+
var container = {
|
|
6404
|
+
justifyContent: "center",
|
|
6405
|
+
alignItems: "center"
|
|
6406
|
+
};
|
|
6407
|
+
var Loading = () => {
|
|
6408
|
+
return /* @__PURE__ */ jsxs4(AbsoluteFill, {
|
|
6409
|
+
style: container,
|
|
6410
|
+
id: "remotion-comp-loading",
|
|
6411
|
+
children: [
|
|
6412
|
+
/* @__PURE__ */ jsx52("style", {
|
|
6413
|
+
type: "text/css",
|
|
6414
|
+
children: `
|
|
6415
|
+
@keyframes anim {
|
|
6416
|
+
from {
|
|
6417
|
+
opacity: 0
|
|
6418
|
+
}
|
|
6419
|
+
to {
|
|
6420
|
+
opacity: 1
|
|
6421
|
+
}
|
|
6422
|
+
}
|
|
6423
|
+
#remotion-comp-loading {
|
|
6424
|
+
animation: anim 2s;
|
|
6425
|
+
animation-fill-mode: forwards;
|
|
6426
|
+
}
|
|
6427
|
+
`
|
|
6428
|
+
}),
|
|
6429
|
+
/* @__PURE__ */ jsx52("svg", {
|
|
6430
|
+
width: ICON_SIZE,
|
|
6431
|
+
height: ICON_SIZE,
|
|
6432
|
+
viewBox: "-100 -100 400 400",
|
|
6433
|
+
style: rotate,
|
|
6434
|
+
children: /* @__PURE__ */ jsx52("path", {
|
|
6435
|
+
fill: "#555",
|
|
6436
|
+
stroke: "#555",
|
|
6437
|
+
strokeWidth: "100",
|
|
6438
|
+
strokeLinejoin: "round",
|
|
6439
|
+
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"
|
|
6440
|
+
})
|
|
6441
|
+
}),
|
|
6442
|
+
/* @__PURE__ */ jsxs4("p", {
|
|
6443
|
+
style: label,
|
|
6444
|
+
children: [
|
|
6445
|
+
"Resolving ",
|
|
6446
|
+
"<Suspense>",
|
|
6447
|
+
"..."
|
|
6448
|
+
]
|
|
6449
|
+
})
|
|
6450
|
+
]
|
|
6451
|
+
});
|
|
6452
|
+
};
|
|
6453
|
+
var _portalNode = null;
|
|
6454
|
+
var portalNode = () => {
|
|
6455
|
+
if (!_portalNode) {
|
|
6456
|
+
if (typeof document === "undefined") {
|
|
6457
|
+
throw new Error("Tried to call an API that only works in the browser from outside the browser");
|
|
6458
|
+
}
|
|
6459
|
+
_portalNode = document.createElement("div");
|
|
6460
|
+
_portalNode.style.position = "absolute";
|
|
6461
|
+
_portalNode.style.top = "0px";
|
|
6462
|
+
_portalNode.style.left = "0px";
|
|
6463
|
+
_portalNode.style.right = "0px";
|
|
6464
|
+
_portalNode.style.bottom = "0px";
|
|
6465
|
+
_portalNode.style.width = "100%";
|
|
6466
|
+
_portalNode.style.height = "100%";
|
|
6467
|
+
_portalNode.style.display = "flex";
|
|
6468
|
+
_portalNode.style.flexDirection = "column";
|
|
6469
|
+
const containerNode = document.createElement("div");
|
|
6470
|
+
containerNode.style.position = "fixed";
|
|
6471
|
+
containerNode.style.top = -999999 + "px";
|
|
6472
|
+
containerNode.appendChild(_portalNode);
|
|
6473
|
+
document.body.appendChild(containerNode);
|
|
6318
6474
|
}
|
|
6319
|
-
|
|
6475
|
+
return _portalNode;
|
|
6320
6476
|
};
|
|
6321
|
-
var
|
|
6322
|
-
|
|
6323
|
-
return stack.startsWith("Error:") ? stack : `${error.message}
|
|
6324
|
-
${stack}`;
|
|
6477
|
+
var getKey = () => {
|
|
6478
|
+
return `remotion_inputPropsOverride` + window.location.origin;
|
|
6325
6479
|
};
|
|
6326
|
-
var
|
|
6327
|
-
if (
|
|
6328
|
-
return
|
|
6480
|
+
var getInputPropsOverride = () => {
|
|
6481
|
+
if (typeof localStorage === "undefined")
|
|
6482
|
+
return null;
|
|
6483
|
+
const override = localStorage.getItem(getKey());
|
|
6484
|
+
if (!override)
|
|
6485
|
+
return null;
|
|
6486
|
+
return JSON.parse(override);
|
|
6487
|
+
};
|
|
6488
|
+
var setInputPropsOverride = (override) => {
|
|
6489
|
+
if (typeof localStorage === "undefined")
|
|
6490
|
+
return;
|
|
6491
|
+
if (override === null) {
|
|
6492
|
+
localStorage.removeItem(getKey());
|
|
6493
|
+
return;
|
|
6329
6494
|
}
|
|
6330
|
-
|
|
6331
|
-
|
|
6495
|
+
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
6496
|
+
};
|
|
6497
|
+
var didWarnSSRImport = false;
|
|
6498
|
+
var warnOnceSSRImport = () => {
|
|
6499
|
+
if (didWarnSSRImport) {
|
|
6500
|
+
return;
|
|
6332
6501
|
}
|
|
6333
|
-
|
|
6334
|
-
|
|
6502
|
+
didWarnSSRImport = true;
|
|
6503
|
+
console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.");
|
|
6504
|
+
console.warn("To hide this warning, don't call this function on the server:");
|
|
6505
|
+
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
6506
|
+
};
|
|
6507
|
+
var getInputProps = () => {
|
|
6508
|
+
if (typeof window === "undefined") {
|
|
6509
|
+
warnOnceSSRImport();
|
|
6510
|
+
return {};
|
|
6335
6511
|
}
|
|
6336
|
-
if (
|
|
6337
|
-
|
|
6512
|
+
if (getRemotionEnvironment().isPlayer) {
|
|
6513
|
+
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.");
|
|
6338
6514
|
}
|
|
6339
|
-
|
|
6340
|
-
|
|
6515
|
+
const override = getInputPropsOverride();
|
|
6516
|
+
if (override) {
|
|
6517
|
+
return override;
|
|
6341
6518
|
}
|
|
6342
|
-
if (
|
|
6343
|
-
|
|
6519
|
+
if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
|
|
6520
|
+
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.");
|
|
6344
6521
|
}
|
|
6345
|
-
|
|
6346
|
-
|
|
6522
|
+
const param = window.remotion_inputProps;
|
|
6523
|
+
if (!param) {
|
|
6524
|
+
return {};
|
|
6347
6525
|
}
|
|
6348
|
-
|
|
6526
|
+
const parsed = deserializeJSONWithSpecialTypes(param);
|
|
6527
|
+
return parsed;
|
|
6349
6528
|
};
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
if (!error.stack) {
|
|
6355
|
-
error.stack = new Error(error.message).stack;
|
|
6356
|
-
}
|
|
6357
|
-
} else if (typeof err === "string") {
|
|
6358
|
-
error = Error(err);
|
|
6359
|
-
} else {
|
|
6360
|
-
error = Error("Rendering was cancelled");
|
|
6361
|
-
}
|
|
6362
|
-
if (scope) {
|
|
6363
|
-
scope.remotion_cancelledError = getErrorStackWithMessage(error);
|
|
6529
|
+
var EditorPropsContext = createContext7({
|
|
6530
|
+
props: {},
|
|
6531
|
+
updateProps: () => {
|
|
6532
|
+
throw new Error("Not implemented");
|
|
6364
6533
|
}
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
};
|
|
6388
|
-
};
|
|
6389
|
-
var logLevels = ["trace", "verbose", "info", "warn", "error"];
|
|
6390
|
-
var getNumberForLogLevel = (level) => {
|
|
6391
|
-
return logLevels.indexOf(level);
|
|
6534
|
+
});
|
|
6535
|
+
var timeValueRef = React3.createRef();
|
|
6536
|
+
var EditorPropsProvider = ({ children }) => {
|
|
6537
|
+
const [props, setProps] = React3.useState({});
|
|
6538
|
+
const updateProps = useCallback2(({
|
|
6539
|
+
defaultProps,
|
|
6540
|
+
id,
|
|
6541
|
+
newProps
|
|
6542
|
+
}) => {
|
|
6543
|
+
setProps((prev) => {
|
|
6544
|
+
return {
|
|
6545
|
+
...prev,
|
|
6546
|
+
[id]: typeof newProps === "function" ? newProps(prev[id] ?? defaultProps) : newProps
|
|
6547
|
+
};
|
|
6548
|
+
});
|
|
6549
|
+
}, []);
|
|
6550
|
+
const ctx = useMemo4(() => {
|
|
6551
|
+
return { props, updateProps };
|
|
6552
|
+
}, [props, updateProps]);
|
|
6553
|
+
return /* @__PURE__ */ jsx62(EditorPropsContext.Provider, {
|
|
6554
|
+
value: ctx,
|
|
6555
|
+
children
|
|
6556
|
+
});
|
|
6392
6557
|
};
|
|
6393
|
-
var
|
|
6394
|
-
|
|
6558
|
+
var RemotionEnvironmentContext = React4.createContext(null);
|
|
6559
|
+
var useRemotionEnvironment = () => {
|
|
6560
|
+
const context = useContext4(RemotionEnvironmentContext);
|
|
6561
|
+
const [env] = useState(() => getRemotionEnvironment());
|
|
6562
|
+
return context ?? env;
|
|
6395
6563
|
};
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
tag
|
|
6400
|
-
}) => {
|
|
6401
|
-
const arr = [...args];
|
|
6402
|
-
if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6403
|
-
arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
|
|
6404
|
-
}
|
|
6405
|
-
if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6406
|
-
arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
|
|
6564
|
+
function validateDimension(amount, nameOfProp, location) {
|
|
6565
|
+
if (typeof amount !== "number") {
|
|
6566
|
+
throw new Error(`The "${nameOfProp}" prop ${location} must be a number, but you passed a value of type ${typeof amount}`);
|
|
6407
6567
|
}
|
|
6408
|
-
|
|
6409
|
-
};
|
|
6410
|
-
var verbose = (options, ...args) => {
|
|
6411
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
|
|
6412
|
-
return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
|
|
6568
|
+
if (isNaN(amount)) {
|
|
6569
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must not be NaN, but is NaN.`);
|
|
6413
6570
|
}
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
6417
|
-
return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
|
|
6571
|
+
if (!Number.isFinite(amount)) {
|
|
6572
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be finite, but is ${amount}.`);
|
|
6418
6573
|
}
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
|
|
6422
|
-
return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
|
|
6574
|
+
if (amount % 1 !== 0) {
|
|
6575
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be an integer, but is ${amount}.`);
|
|
6423
6576
|
}
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
|
|
6427
|
-
return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
|
|
6577
|
+
if (amount <= 0) {
|
|
6578
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be positive, but got ${amount}.`);
|
|
6428
6579
|
}
|
|
6429
|
-
}
|
|
6430
|
-
|
|
6431
|
-
|
|
6580
|
+
}
|
|
6581
|
+
function validateDurationInFrames(durationInFrames, options) {
|
|
6582
|
+
const { allowFloats, component } = options;
|
|
6583
|
+
if (typeof durationInFrames === "undefined") {
|
|
6584
|
+
throw new Error(`The "durationInFrames" prop ${component} is missing.`);
|
|
6585
|
+
}
|
|
6586
|
+
if (typeof durationInFrames !== "number") {
|
|
6587
|
+
throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
|
|
6588
|
+
}
|
|
6589
|
+
if (durationInFrames <= 0) {
|
|
6590
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
6591
|
+
}
|
|
6592
|
+
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
6593
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
6594
|
+
}
|
|
6595
|
+
if (!Number.isFinite(durationInFrames)) {
|
|
6596
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
6597
|
+
}
|
|
6598
|
+
}
|
|
6599
|
+
function validateFps(fps, location, isGif) {
|
|
6600
|
+
if (typeof fps !== "number") {
|
|
6601
|
+
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
6602
|
+
}
|
|
6603
|
+
if (!Number.isFinite(fps)) {
|
|
6604
|
+
throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
|
|
6605
|
+
}
|
|
6606
|
+
if (isNaN(fps)) {
|
|
6607
|
+
throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
|
|
6608
|
+
}
|
|
6609
|
+
if (fps <= 0) {
|
|
6610
|
+
throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
|
|
6611
|
+
}
|
|
6612
|
+
if (isGif && fps > 50) {
|
|
6613
|
+
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`);
|
|
6614
|
+
}
|
|
6615
|
+
}
|
|
6616
|
+
var ResolveCompositionContext = createContext8(null);
|
|
6617
|
+
var resolveCompositionsRef = createRef();
|
|
6618
|
+
var needsResolution = (composition) => {
|
|
6619
|
+
return Boolean(composition.calculateMetadata);
|
|
6620
|
+
};
|
|
6621
|
+
var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
6622
|
+
const context = useContext5(ResolveCompositionContext);
|
|
6623
|
+
const { props: allEditorProps } = useContext5(EditorPropsContext);
|
|
6624
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext5(CompositionManager);
|
|
6625
|
+
const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
6626
|
+
const compositionId = preferredCompositionId ?? currentComposition;
|
|
6627
|
+
const composition = compositions.find((c) => c.id === compositionId);
|
|
6628
|
+
const selectedEditorProps = useMemo5(() => {
|
|
6629
|
+
return composition ? allEditorProps[composition.id] ?? {} : {};
|
|
6630
|
+
}, [allEditorProps, composition]);
|
|
6631
|
+
const env = useRemotionEnvironment();
|
|
6632
|
+
return useMemo5(() => {
|
|
6633
|
+
if (!composition) {
|
|
6634
|
+
return null;
|
|
6635
|
+
}
|
|
6636
|
+
if (currentCompositionMetadata) {
|
|
6637
|
+
return {
|
|
6638
|
+
type: "success",
|
|
6639
|
+
result: {
|
|
6640
|
+
...currentCompositionMetadata,
|
|
6641
|
+
id: composition.id,
|
|
6642
|
+
defaultProps: composition.defaultProps ?? {}
|
|
6643
|
+
}
|
|
6644
|
+
};
|
|
6645
|
+
}
|
|
6646
|
+
if (!needsResolution(composition)) {
|
|
6647
|
+
validateDurationInFrames(composition.durationInFrames, {
|
|
6648
|
+
allowFloats: false,
|
|
6649
|
+
component: `in <Composition id="${composition.id}">`
|
|
6650
|
+
});
|
|
6651
|
+
validateFps(composition.fps, `in <Composition id="${composition.id}">`, false);
|
|
6652
|
+
validateDimension(composition.width, "width", `in <Composition id="${composition.id}">`);
|
|
6653
|
+
validateDimension(composition.height, "height", `in <Composition id="${composition.id}">`);
|
|
6654
|
+
return {
|
|
6655
|
+
type: "success",
|
|
6656
|
+
result: {
|
|
6657
|
+
width: composition.width,
|
|
6658
|
+
height: composition.height,
|
|
6659
|
+
fps: composition.fps,
|
|
6660
|
+
id: composition.id,
|
|
6661
|
+
durationInFrames: composition.durationInFrames,
|
|
6662
|
+
defaultProps: composition.defaultProps ?? {},
|
|
6663
|
+
props: {
|
|
6664
|
+
...composition.defaultProps ?? {},
|
|
6665
|
+
...selectedEditorProps ?? {},
|
|
6666
|
+
...typeof window === "undefined" || env.isPlayer || !window.remotion_inputProps ? {} : getInputProps() ?? {}
|
|
6667
|
+
},
|
|
6668
|
+
defaultCodec: null,
|
|
6669
|
+
defaultOutName: null,
|
|
6670
|
+
defaultVideoImageFormat: null,
|
|
6671
|
+
defaultPixelFormat: null,
|
|
6672
|
+
defaultProResProfile: null
|
|
6673
|
+
}
|
|
6674
|
+
};
|
|
6675
|
+
}
|
|
6676
|
+
if (!context) {
|
|
6677
|
+
return null;
|
|
6678
|
+
}
|
|
6679
|
+
if (!context[composition.id]) {
|
|
6680
|
+
return null;
|
|
6681
|
+
}
|
|
6682
|
+
return context[composition.id];
|
|
6683
|
+
}, [
|
|
6684
|
+
composition,
|
|
6685
|
+
context,
|
|
6686
|
+
currentCompositionMetadata,
|
|
6687
|
+
selectedEditorProps,
|
|
6688
|
+
env.isPlayer
|
|
6689
|
+
]);
|
|
6690
|
+
};
|
|
6691
|
+
var getErrorStackWithMessage = (error) => {
|
|
6692
|
+
const stack = error.stack ?? "";
|
|
6693
|
+
return stack.startsWith("Error:") ? stack : `${error.message}
|
|
6694
|
+
${stack}`;
|
|
6695
|
+
};
|
|
6696
|
+
var isErrorLike = (err) => {
|
|
6697
|
+
if (err instanceof Error) {
|
|
6698
|
+
return true;
|
|
6699
|
+
}
|
|
6700
|
+
if (err === null) {
|
|
6701
|
+
return false;
|
|
6702
|
+
}
|
|
6703
|
+
if (typeof err !== "object") {
|
|
6704
|
+
return false;
|
|
6705
|
+
}
|
|
6706
|
+
if (!("stack" in err)) {
|
|
6707
|
+
return false;
|
|
6708
|
+
}
|
|
6709
|
+
if (typeof err.stack !== "string") {
|
|
6710
|
+
return false;
|
|
6711
|
+
}
|
|
6712
|
+
if (!("message" in err)) {
|
|
6713
|
+
return false;
|
|
6714
|
+
}
|
|
6715
|
+
if (typeof err.message !== "string") {
|
|
6716
|
+
return false;
|
|
6717
|
+
}
|
|
6718
|
+
return true;
|
|
6719
|
+
};
|
|
6720
|
+
function cancelRenderInternal(scope, err) {
|
|
6721
|
+
let error;
|
|
6722
|
+
if (isErrorLike(err)) {
|
|
6723
|
+
error = err;
|
|
6724
|
+
if (!error.stack) {
|
|
6725
|
+
error.stack = new Error(error.message).stack;
|
|
6726
|
+
}
|
|
6727
|
+
} else if (typeof err === "string") {
|
|
6728
|
+
error = Error(err);
|
|
6729
|
+
} else {
|
|
6730
|
+
error = Error("Rendering was cancelled");
|
|
6731
|
+
}
|
|
6732
|
+
if (scope) {
|
|
6733
|
+
scope.remotion_cancelledError = getErrorStackWithMessage(error);
|
|
6734
|
+
}
|
|
6735
|
+
throw error;
|
|
6736
|
+
}
|
|
6737
|
+
function cancelRender(err) {
|
|
6738
|
+
return cancelRenderInternal(typeof window !== "undefined" ? window : undefined, err);
|
|
6739
|
+
}
|
|
6740
|
+
var logLevels = ["trace", "verbose", "info", "warn", "error"];
|
|
6741
|
+
var getNumberForLogLevel = (level) => {
|
|
6742
|
+
return logLevels.indexOf(level);
|
|
6743
|
+
};
|
|
6744
|
+
var isEqualOrBelowLogLevel = (currentLevel, level) => {
|
|
6745
|
+
return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
|
|
6746
|
+
};
|
|
6747
|
+
var transformArgs = ({
|
|
6748
|
+
args,
|
|
6749
|
+
logLevel,
|
|
6750
|
+
tag
|
|
6751
|
+
}) => {
|
|
6752
|
+
const arr = [...args];
|
|
6753
|
+
if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6754
|
+
arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
|
|
6755
|
+
}
|
|
6756
|
+
if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6757
|
+
arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
|
|
6758
|
+
}
|
|
6759
|
+
return arr;
|
|
6760
|
+
};
|
|
6761
|
+
var verbose = (options, ...args) => {
|
|
6762
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
|
|
6763
|
+
return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
|
|
6764
|
+
}
|
|
6765
|
+
};
|
|
6766
|
+
var trace = (options, ...args) => {
|
|
6767
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
6768
|
+
return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
|
|
6769
|
+
}
|
|
6770
|
+
};
|
|
6771
|
+
var info = (options, ...args) => {
|
|
6772
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
|
|
6773
|
+
return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
|
|
6774
|
+
}
|
|
6775
|
+
};
|
|
6776
|
+
var warn = (options, ...args) => {
|
|
6777
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
|
|
6778
|
+
return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
|
|
6779
|
+
}
|
|
6780
|
+
};
|
|
6781
|
+
var error = (options, ...args) => {
|
|
6782
|
+
return console.error(...transformArgs({ args, logLevel: "error", tag: options.tag }));
|
|
6432
6783
|
};
|
|
6433
6784
|
var Log = {
|
|
6434
6785
|
trace,
|
|
@@ -6452,11 +6803,11 @@ var defaultTimeout = 30000;
|
|
|
6452
6803
|
var delayRenderInternal = ({
|
|
6453
6804
|
scope,
|
|
6454
6805
|
environment,
|
|
6455
|
-
label,
|
|
6806
|
+
label: label2,
|
|
6456
6807
|
options
|
|
6457
6808
|
}) => {
|
|
6458
|
-
if (typeof
|
|
6459
|
-
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(
|
|
6809
|
+
if (typeof label2 !== "string" && label2 !== null) {
|
|
6810
|
+
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label2));
|
|
6460
6811
|
}
|
|
6461
6812
|
const handle = Math.random();
|
|
6462
6813
|
scope.remotion_delayRenderHandles.push(handle);
|
|
@@ -6465,12 +6816,12 @@ var delayRenderInternal = ({
|
|
|
6465
6816
|
const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
|
|
6466
6817
|
const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
|
|
6467
6818
|
scope.remotion_delayRenderTimeouts[handle] = {
|
|
6468
|
-
label:
|
|
6819
|
+
label: label2 ?? null,
|
|
6469
6820
|
startTime: Date.now(),
|
|
6470
6821
|
timeout: setTimeout(() => {
|
|
6471
6822
|
const message = [
|
|
6472
6823
|
`A delayRender()`,
|
|
6473
|
-
|
|
6824
|
+
label2 ? `"${label2}"` : null,
|
|
6474
6825
|
`was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
|
|
6475
6826
|
retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
|
|
6476
6827
|
retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
|
|
@@ -6506,10 +6857,10 @@ var continueRenderInternal = ({
|
|
|
6506
6857
|
if (!scope.remotion_delayRenderTimeouts[handle]) {
|
|
6507
6858
|
return false;
|
|
6508
6859
|
}
|
|
6509
|
-
const { label, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
|
|
6860
|
+
const { label: label2, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
|
|
6510
6861
|
clearTimeout(timeout);
|
|
6511
6862
|
const message = [
|
|
6512
|
-
|
|
6863
|
+
label2 ? `"${label2}"` : "A handle",
|
|
6513
6864
|
DELAY_RENDER_CLEAR_TOKEN,
|
|
6514
6865
|
`${Date.now() - startTime}ms`
|
|
6515
6866
|
].filter(truthy2).join(" ");
|
|
@@ -6524,47 +6875,41 @@ var continueRenderInternal = ({
|
|
|
6524
6875
|
scope.remotion_renderReady = true;
|
|
6525
6876
|
}
|
|
6526
6877
|
};
|
|
6527
|
-
var LogLevelContext =
|
|
6878
|
+
var LogLevelContext = createContext9({
|
|
6528
6879
|
logLevel: "info",
|
|
6529
6880
|
mountTime: 0
|
|
6530
6881
|
});
|
|
6531
6882
|
var useLogLevel = () => {
|
|
6532
|
-
const { logLevel } =
|
|
6883
|
+
const { logLevel } = React5.useContext(LogLevelContext);
|
|
6533
6884
|
if (logLevel === null) {
|
|
6534
6885
|
throw new Error("useLogLevel must be used within a LogLevelProvider");
|
|
6535
6886
|
}
|
|
6536
6887
|
return logLevel;
|
|
6537
6888
|
};
|
|
6538
6889
|
var useMountTime = () => {
|
|
6539
|
-
const { mountTime } =
|
|
6890
|
+
const { mountTime } = React5.useContext(LogLevelContext);
|
|
6540
6891
|
if (mountTime === null) {
|
|
6541
6892
|
throw new Error("useMountTime must be used within a LogLevelProvider");
|
|
6542
6893
|
}
|
|
6543
6894
|
return mountTime;
|
|
6544
6895
|
};
|
|
6545
|
-
var
|
|
6546
|
-
var useRemotionEnvironment = () => {
|
|
6547
|
-
const context = useContext3(RemotionEnvironmentContext);
|
|
6548
|
-
const [env] = useState(() => getRemotionEnvironment());
|
|
6549
|
-
return context ?? env;
|
|
6550
|
-
};
|
|
6551
|
-
var DelayRenderContextType = createContext5(null);
|
|
6896
|
+
var DelayRenderContextType = createContext10(null);
|
|
6552
6897
|
var useDelayRender = () => {
|
|
6553
6898
|
const environment = useRemotionEnvironment();
|
|
6554
|
-
const scope =
|
|
6899
|
+
const scope = useContext7(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
|
|
6555
6900
|
const logLevel = useLogLevel();
|
|
6556
|
-
const delayRender2 =
|
|
6901
|
+
const delayRender2 = useCallback3((label2, options) => {
|
|
6557
6902
|
if (!scope) {
|
|
6558
6903
|
return Math.random();
|
|
6559
6904
|
}
|
|
6560
6905
|
return delayRenderInternal({
|
|
6561
6906
|
scope,
|
|
6562
6907
|
environment,
|
|
6563
|
-
label:
|
|
6908
|
+
label: label2 ?? null,
|
|
6564
6909
|
options: options ?? {}
|
|
6565
6910
|
});
|
|
6566
6911
|
}, [environment, scope]);
|
|
6567
|
-
const continueRender2 =
|
|
6912
|
+
const continueRender2 = useCallback3((handle) => {
|
|
6568
6913
|
if (!scope) {
|
|
6569
6914
|
return;
|
|
6570
6915
|
}
|
|
@@ -6575,404 +6920,362 @@ var useDelayRender = () => {
|
|
|
6575
6920
|
logLevel
|
|
6576
6921
|
});
|
|
6577
6922
|
}, [environment, logLevel, scope]);
|
|
6578
|
-
const cancelRender2 =
|
|
6923
|
+
const cancelRender2 = useCallback3((err) => {
|
|
6579
6924
|
return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
|
|
6580
6925
|
}, [scope]);
|
|
6581
6926
|
return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
|
|
6582
6927
|
};
|
|
6583
|
-
var
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6928
|
+
var useLazyComponent = ({
|
|
6929
|
+
compProps,
|
|
6930
|
+
componentName,
|
|
6931
|
+
noSuspense
|
|
6932
|
+
}) => {
|
|
6933
|
+
const componentRef = useRef2(null);
|
|
6934
|
+
if ("component" in compProps) {
|
|
6935
|
+
componentRef.current = compProps.component;
|
|
6589
6936
|
}
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
6602
|
-
if (typeof window !== "undefined") {
|
|
6603
|
-
useLayoutEffect(() => {
|
|
6604
|
-
window.remotion_setFrame = (f, composition, attempt) => {
|
|
6605
|
-
window.remotion_attempt = attempt;
|
|
6606
|
-
const id = delayRender2(`Setting the current frame to ${f}`);
|
|
6607
|
-
let asyncUpdate = true;
|
|
6608
|
-
setFrame((s) => {
|
|
6609
|
-
const currentFrame = s[composition] ?? window.remotion_initialFrame;
|
|
6610
|
-
if (currentFrame === f) {
|
|
6611
|
-
asyncUpdate = false;
|
|
6612
|
-
return s;
|
|
6613
|
-
}
|
|
6614
|
-
return {
|
|
6615
|
-
...s,
|
|
6616
|
-
[composition]: f
|
|
6617
|
-
};
|
|
6618
|
-
});
|
|
6619
|
-
if (asyncUpdate) {
|
|
6620
|
-
requestAnimationFrame(() => continueRender2(id));
|
|
6621
|
-
} else {
|
|
6622
|
-
continueRender2(id);
|
|
6623
|
-
}
|
|
6937
|
+
const lazy = useMemo6(() => {
|
|
6938
|
+
if ("component" in compProps) {
|
|
6939
|
+
if (typeof document === "undefined" || noSuspense) {
|
|
6940
|
+
return compProps.component;
|
|
6941
|
+
}
|
|
6942
|
+
if (typeof compProps.component === "undefined") {
|
|
6943
|
+
throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
6944
|
+
}
|
|
6945
|
+
const Wrapper = (props) => {
|
|
6946
|
+
const Comp = componentRef.current;
|
|
6947
|
+
return React6.createElement(Comp, props);
|
|
6624
6948
|
};
|
|
6625
|
-
|
|
6626
|
-
}
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
frame,
|
|
6631
|
-
playing,
|
|
6632
|
-
imperativePlaying,
|
|
6633
|
-
rootId: remotionRootId,
|
|
6634
|
-
playbackRate,
|
|
6635
|
-
setPlaybackRate,
|
|
6636
|
-
audioAndVideoTags
|
|
6637
|
-
};
|
|
6638
|
-
}, [frame, playbackRate, playing, remotionRootId]);
|
|
6639
|
-
const setTimelineContextValue = useMemo22(() => {
|
|
6640
|
-
return {
|
|
6641
|
-
setFrame,
|
|
6642
|
-
setPlaying
|
|
6643
|
-
};
|
|
6644
|
-
}, []);
|
|
6645
|
-
return /* @__PURE__ */ jsx33(AbsoluteTimeContext.Provider, {
|
|
6646
|
-
value: timelineContextValue,
|
|
6647
|
-
children: /* @__PURE__ */ jsx33(TimelineContext.Provider, {
|
|
6648
|
-
value: timelineContextValue,
|
|
6649
|
-
children: /* @__PURE__ */ jsx33(SetTimelineContext.Provider, {
|
|
6650
|
-
value: setTimelineContextValue,
|
|
6651
|
-
children
|
|
6652
|
-
})
|
|
6653
|
-
})
|
|
6654
|
-
});
|
|
6655
|
-
};
|
|
6656
|
-
var CompositionManager = createContext7({
|
|
6657
|
-
compositions: [],
|
|
6658
|
-
folders: [],
|
|
6659
|
-
currentCompositionMetadata: null,
|
|
6660
|
-
canvasContent: null
|
|
6661
|
-
});
|
|
6662
|
-
var CompositionSetters = createContext7({
|
|
6663
|
-
registerComposition: () => {
|
|
6664
|
-
return;
|
|
6665
|
-
},
|
|
6666
|
-
unregisterComposition: () => {
|
|
6667
|
-
return;
|
|
6668
|
-
},
|
|
6669
|
-
registerFolder: () => {
|
|
6670
|
-
return;
|
|
6671
|
-
},
|
|
6672
|
-
unregisterFolder: () => {
|
|
6673
|
-
return;
|
|
6674
|
-
},
|
|
6675
|
-
setCanvasContent: () => {
|
|
6676
|
-
return;
|
|
6677
|
-
},
|
|
6678
|
-
onlyRenderComposition: null
|
|
6679
|
-
});
|
|
6680
|
-
var getKey = () => {
|
|
6681
|
-
return `remotion_inputPropsOverride` + window.location.origin;
|
|
6682
|
-
};
|
|
6683
|
-
var getInputPropsOverride = () => {
|
|
6684
|
-
if (typeof localStorage === "undefined")
|
|
6685
|
-
return null;
|
|
6686
|
-
const override = localStorage.getItem(getKey());
|
|
6687
|
-
if (!override)
|
|
6688
|
-
return null;
|
|
6689
|
-
return JSON.parse(override);
|
|
6690
|
-
};
|
|
6691
|
-
var setInputPropsOverride = (override) => {
|
|
6692
|
-
if (typeof localStorage === "undefined")
|
|
6693
|
-
return;
|
|
6694
|
-
if (override === null) {
|
|
6695
|
-
localStorage.removeItem(getKey());
|
|
6696
|
-
return;
|
|
6697
|
-
}
|
|
6698
|
-
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
6699
|
-
};
|
|
6700
|
-
var DATE_TOKEN = "remotion-date:";
|
|
6701
|
-
var FILE_TOKEN = "remotion-file:";
|
|
6702
|
-
var serializeJSONWithSpecialTypes = ({
|
|
6703
|
-
data,
|
|
6704
|
-
indent,
|
|
6705
|
-
staticBase
|
|
6706
|
-
}) => {
|
|
6707
|
-
let customDateUsed = false;
|
|
6708
|
-
let customFileUsed = false;
|
|
6709
|
-
let mapUsed = false;
|
|
6710
|
-
let setUsed = false;
|
|
6711
|
-
try {
|
|
6712
|
-
const serializedString = JSON.stringify(data, function(key, value) {
|
|
6713
|
-
const item = this[key];
|
|
6714
|
-
if (item instanceof Date) {
|
|
6715
|
-
customDateUsed = true;
|
|
6716
|
-
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
6717
|
-
}
|
|
6718
|
-
if (item instanceof Map) {
|
|
6719
|
-
mapUsed = true;
|
|
6720
|
-
return value;
|
|
6721
|
-
}
|
|
6722
|
-
if (item instanceof Set) {
|
|
6723
|
-
setUsed = true;
|
|
6724
|
-
return value;
|
|
6725
|
-
}
|
|
6726
|
-
if (typeof item === "string" && staticBase !== null && item.startsWith(staticBase)) {
|
|
6727
|
-
customFileUsed = true;
|
|
6728
|
-
return `${FILE_TOKEN}${item.replace(staticBase + "/", "")}`;
|
|
6949
|
+
return Wrapper;
|
|
6950
|
+
}
|
|
6951
|
+
if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
|
|
6952
|
+
if (typeof compProps.lazyComponent === "undefined") {
|
|
6953
|
+
throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
6729
6954
|
}
|
|
6730
|
-
return
|
|
6731
|
-
}
|
|
6732
|
-
|
|
6733
|
-
}
|
|
6734
|
-
|
|
6735
|
-
}
|
|
6955
|
+
return React6.lazy(compProps.lazyComponent);
|
|
6956
|
+
}
|
|
6957
|
+
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
6958
|
+
}, [compProps.lazyComponent]);
|
|
6959
|
+
return lazy;
|
|
6736
6960
|
};
|
|
6737
|
-
var
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6961
|
+
var useVideo = () => {
|
|
6962
|
+
const { canvasContent, compositions, currentCompositionMetadata } = useContext8(CompositionManager);
|
|
6963
|
+
const selected = compositions.find((c) => {
|
|
6964
|
+
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
6965
|
+
});
|
|
6966
|
+
const resolved = useResolvedVideoConfig(selected?.id ?? null);
|
|
6967
|
+
return useMemo7(() => {
|
|
6968
|
+
if (!resolved) {
|
|
6969
|
+
return null;
|
|
6741
6970
|
}
|
|
6742
|
-
if (
|
|
6743
|
-
return
|
|
6971
|
+
if (resolved.type === "error") {
|
|
6972
|
+
return null;
|
|
6744
6973
|
}
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
}
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6974
|
+
if (resolved.type === "loading") {
|
|
6975
|
+
return null;
|
|
6976
|
+
}
|
|
6977
|
+
if (!selected) {
|
|
6978
|
+
return null;
|
|
6979
|
+
}
|
|
6980
|
+
return {
|
|
6981
|
+
...resolved.result,
|
|
6982
|
+
defaultProps: selected.defaultProps ?? {},
|
|
6983
|
+
id: selected.id,
|
|
6984
|
+
...currentCompositionMetadata ?? {},
|
|
6985
|
+
component: selected.component
|
|
6986
|
+
};
|
|
6987
|
+
}, [currentCompositionMetadata, resolved, selected]);
|
|
6754
6988
|
};
|
|
6755
|
-
var
|
|
6756
|
-
|
|
6757
|
-
|
|
6989
|
+
var getRegex2 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
6990
|
+
var isCompositionIdValid = (id) => id.match(getRegex2());
|
|
6991
|
+
var validateCompositionId = (id) => {
|
|
6992
|
+
if (!isCompositionIdValid(id)) {
|
|
6993
|
+
throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`);
|
|
6758
6994
|
}
|
|
6759
|
-
return props;
|
|
6760
6995
|
};
|
|
6761
|
-
var
|
|
6762
|
-
var
|
|
6763
|
-
if (
|
|
6996
|
+
var invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex2())}`;
|
|
6997
|
+
var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
6998
|
+
if (!defaultProps) {
|
|
6764
6999
|
return;
|
|
6765
7000
|
}
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
console.warn("To hide this warning, don't call this function on the server:");
|
|
6769
|
-
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
6770
|
-
};
|
|
6771
|
-
var getInputProps = () => {
|
|
6772
|
-
if (typeof window === "undefined") {
|
|
6773
|
-
warnOnceSSRImport();
|
|
6774
|
-
return {};
|
|
6775
|
-
}
|
|
6776
|
-
if (getRemotionEnvironment().isPlayer) {
|
|
6777
|
-
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.");
|
|
6778
|
-
}
|
|
6779
|
-
const override = getInputPropsOverride();
|
|
6780
|
-
if (override) {
|
|
6781
|
-
return override;
|
|
6782
|
-
}
|
|
6783
|
-
if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
|
|
6784
|
-
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.");
|
|
7001
|
+
if (typeof defaultProps !== "object") {
|
|
7002
|
+
throw new Error(`"${name}" must be an object, but you passed a value of type ${typeof defaultProps}`);
|
|
6785
7003
|
}
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
return {};
|
|
7004
|
+
if (Array.isArray(defaultProps)) {
|
|
7005
|
+
throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
|
|
6789
7006
|
}
|
|
6790
|
-
const parsed = deserializeJSONWithSpecialTypes(param);
|
|
6791
|
-
return parsed;
|
|
6792
7007
|
};
|
|
6793
|
-
var
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
});
|
|
6799
|
-
|
|
6800
|
-
var EditorPropsProvider = ({ children }) => {
|
|
6801
|
-
const [props, setProps] = React5.useState({});
|
|
6802
|
-
const updateProps = useCallback2(({
|
|
6803
|
-
defaultProps,
|
|
6804
|
-
id,
|
|
6805
|
-
newProps
|
|
6806
|
-
}) => {
|
|
6807
|
-
setProps((prev) => {
|
|
6808
|
-
return {
|
|
6809
|
-
...prev,
|
|
6810
|
-
[id]: typeof newProps === "function" ? newProps(prev[id] ?? defaultProps) : newProps
|
|
6811
|
-
};
|
|
6812
|
-
});
|
|
6813
|
-
}, []);
|
|
6814
|
-
const ctx = useMemo3(() => {
|
|
6815
|
-
return { props, updateProps };
|
|
6816
|
-
}, [props, updateProps]);
|
|
6817
|
-
return /* @__PURE__ */ jsx43(EditorPropsContext.Provider, {
|
|
6818
|
-
value: ctx,
|
|
6819
|
-
children
|
|
6820
|
-
});
|
|
7008
|
+
var Fallback = () => {
|
|
7009
|
+
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
7010
|
+
useEffect2(() => {
|
|
7011
|
+
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
7012
|
+
return () => continueRender2(fallback);
|
|
7013
|
+
}, [continueRender2, delayRender2]);
|
|
7014
|
+
return null;
|
|
6821
7015
|
};
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
const
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
if (typeof
|
|
6845
|
-
|
|
6846
|
-
}
|
|
6847
|
-
if (durationInFrames <= 0) {
|
|
6848
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
6849
|
-
}
|
|
6850
|
-
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
6851
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
6852
|
-
}
|
|
6853
|
-
if (!Number.isFinite(durationInFrames)) {
|
|
6854
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
6855
|
-
}
|
|
6856
|
-
}
|
|
6857
|
-
function validateFps(fps, location, isGif) {
|
|
6858
|
-
if (typeof fps !== "number") {
|
|
6859
|
-
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
7016
|
+
var InnerComposition = ({
|
|
7017
|
+
width,
|
|
7018
|
+
height,
|
|
7019
|
+
fps,
|
|
7020
|
+
durationInFrames,
|
|
7021
|
+
id,
|
|
7022
|
+
defaultProps,
|
|
7023
|
+
schema,
|
|
7024
|
+
...compProps
|
|
7025
|
+
}) => {
|
|
7026
|
+
const compManager = useContext9(CompositionSetters);
|
|
7027
|
+
const { registerComposition, unregisterComposition } = compManager;
|
|
7028
|
+
const video = useVideo();
|
|
7029
|
+
const lazy = useLazyComponent({
|
|
7030
|
+
compProps,
|
|
7031
|
+
componentName: "Composition",
|
|
7032
|
+
noSuspense: false
|
|
7033
|
+
});
|
|
7034
|
+
const nonce = useNonce();
|
|
7035
|
+
const isPlayer = useIsPlayer();
|
|
7036
|
+
const environment = useRemotionEnvironment();
|
|
7037
|
+
const canUseComposition = useContext9(CanUseRemotionHooks);
|
|
7038
|
+
if (typeof window !== "undefined") {
|
|
7039
|
+
window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
|
|
6860
7040
|
}
|
|
6861
|
-
if (
|
|
6862
|
-
|
|
7041
|
+
if (canUseComposition) {
|
|
7042
|
+
if (isPlayer) {
|
|
7043
|
+
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.");
|
|
7044
|
+
}
|
|
7045
|
+
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
6863
7046
|
}
|
|
6864
|
-
|
|
6865
|
-
|
|
7047
|
+
const { folderName, parentName } = useContext9(FolderContext);
|
|
7048
|
+
const stack = compProps.stack ?? null;
|
|
7049
|
+
useEffect2(() => {
|
|
7050
|
+
if (!id) {
|
|
7051
|
+
throw new Error("No id for composition passed.");
|
|
7052
|
+
}
|
|
7053
|
+
validateCompositionId(id);
|
|
7054
|
+
validateDefaultAndInputProps(defaultProps, "defaultProps", id);
|
|
7055
|
+
registerComposition({
|
|
7056
|
+
durationInFrames: durationInFrames ?? undefined,
|
|
7057
|
+
fps: fps ?? undefined,
|
|
7058
|
+
height: height ?? undefined,
|
|
7059
|
+
width: width ?? undefined,
|
|
7060
|
+
id,
|
|
7061
|
+
folderName,
|
|
7062
|
+
component: lazy,
|
|
7063
|
+
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
7064
|
+
nonce: nonce.get(),
|
|
7065
|
+
parentFolderName: parentName,
|
|
7066
|
+
schema: schema ?? null,
|
|
7067
|
+
calculateMetadata: compProps.calculateMetadata ?? null,
|
|
7068
|
+
stack
|
|
7069
|
+
});
|
|
7070
|
+
return () => {
|
|
7071
|
+
unregisterComposition(id);
|
|
7072
|
+
};
|
|
7073
|
+
}, [
|
|
7074
|
+
durationInFrames,
|
|
7075
|
+
fps,
|
|
7076
|
+
height,
|
|
7077
|
+
lazy,
|
|
7078
|
+
id,
|
|
7079
|
+
folderName,
|
|
7080
|
+
defaultProps,
|
|
7081
|
+
width,
|
|
7082
|
+
nonce,
|
|
7083
|
+
parentName,
|
|
7084
|
+
schema,
|
|
7085
|
+
compProps.calculateMetadata,
|
|
7086
|
+
stack,
|
|
7087
|
+
registerComposition,
|
|
7088
|
+
unregisterComposition
|
|
7089
|
+
]);
|
|
7090
|
+
const resolved = useResolvedVideoConfig(id);
|
|
7091
|
+
if (environment.isStudio && video && video.component === lazy && video.id === id) {
|
|
7092
|
+
const Comp = lazy;
|
|
7093
|
+
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
7094
|
+
return null;
|
|
7095
|
+
}
|
|
7096
|
+
return createPortal(/* @__PURE__ */ jsx72(CanUseRemotionHooksProvider, {
|
|
7097
|
+
children: /* @__PURE__ */ jsx72(Suspense, {
|
|
7098
|
+
fallback: /* @__PURE__ */ jsx72(Loading, {}),
|
|
7099
|
+
children: /* @__PURE__ */ jsx72(Comp, {
|
|
7100
|
+
...resolved.result.props ?? {}
|
|
7101
|
+
})
|
|
7102
|
+
})
|
|
7103
|
+
}), portalNode());
|
|
6866
7104
|
}
|
|
6867
|
-
if (
|
|
6868
|
-
|
|
7105
|
+
if (environment.isRendering && video && video.component === lazy && video.id === id) {
|
|
7106
|
+
const Comp = lazy;
|
|
7107
|
+
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
7108
|
+
return null;
|
|
7109
|
+
}
|
|
7110
|
+
return createPortal(/* @__PURE__ */ jsx72(CanUseRemotionHooksProvider, {
|
|
7111
|
+
children: /* @__PURE__ */ jsx72(Suspense, {
|
|
7112
|
+
fallback: /* @__PURE__ */ jsx72(Fallback, {}),
|
|
7113
|
+
children: /* @__PURE__ */ jsx72(Comp, {
|
|
7114
|
+
...resolved.result.props ?? {}
|
|
7115
|
+
})
|
|
7116
|
+
})
|
|
7117
|
+
}), portalNode());
|
|
6869
7118
|
}
|
|
6870
|
-
|
|
6871
|
-
|
|
7119
|
+
return null;
|
|
7120
|
+
};
|
|
7121
|
+
var Composition = (props) => {
|
|
7122
|
+
const { onlyRenderComposition } = useContext9(CompositionSetters);
|
|
7123
|
+
if (onlyRenderComposition && onlyRenderComposition !== props.id) {
|
|
7124
|
+
return null;
|
|
6872
7125
|
}
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
var needsResolution = (composition) => {
|
|
6877
|
-
return Boolean(composition.calculateMetadata);
|
|
7126
|
+
return /* @__PURE__ */ jsx72(InnerComposition, {
|
|
7127
|
+
...props
|
|
7128
|
+
});
|
|
6878
7129
|
};
|
|
6879
|
-
var
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
return
|
|
6888
|
-
}
|
|
6889
|
-
const
|
|
6890
|
-
|
|
6891
|
-
if (
|
|
6892
|
-
|
|
7130
|
+
var componentsToAddStacksTo = [];
|
|
7131
|
+
var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
7132
|
+
var addSequenceStackTraces = (component) => {
|
|
7133
|
+
componentsToAddStacksTo.push(component);
|
|
7134
|
+
};
|
|
7135
|
+
var VERSION = "4.0.443";
|
|
7136
|
+
var checkMultipleRemotionVersions = () => {
|
|
7137
|
+
if (typeof globalThis === "undefined") {
|
|
7138
|
+
return;
|
|
7139
|
+
}
|
|
7140
|
+
const set = () => {
|
|
7141
|
+
globalThis.remotion_imported = VERSION;
|
|
7142
|
+
if (typeof window !== "undefined") {
|
|
7143
|
+
window.remotion_imported = VERSION;
|
|
6893
7144
|
}
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
id: composition.id,
|
|
6900
|
-
defaultProps: composition.defaultProps ?? {}
|
|
6901
|
-
}
|
|
6902
|
-
};
|
|
7145
|
+
};
|
|
7146
|
+
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
7147
|
+
if (alreadyImported) {
|
|
7148
|
+
if (alreadyImported === VERSION) {
|
|
7149
|
+
return;
|
|
6903
7150
|
}
|
|
6904
|
-
if (
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
7151
|
+
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
7152
|
+
set();
|
|
7153
|
+
return;
|
|
7154
|
+
}
|
|
7155
|
+
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
7156
|
+
VERSION,
|
|
7157
|
+
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
7158
|
+
].filter(truthy2).join(" and ")}. This will cause things to break in an unexpected way.
|
|
7159
|
+
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.`);
|
|
7160
|
+
}
|
|
7161
|
+
set();
|
|
7162
|
+
};
|
|
7163
|
+
var SequenceContext = createContext11(null);
|
|
7164
|
+
var exports_timeline_position_state = {};
|
|
7165
|
+
__export2(exports_timeline_position_state, {
|
|
7166
|
+
useTimelineSetFrame: () => useTimelineSetFrame,
|
|
7167
|
+
useTimelinePosition: () => useTimelinePosition,
|
|
7168
|
+
useTimelineContext: () => useTimelineContext,
|
|
7169
|
+
usePlayingState: () => usePlayingState,
|
|
7170
|
+
useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
|
|
7171
|
+
persistCurrentFrame: () => persistCurrentFrame,
|
|
7172
|
+
getInitialFrameState: () => getInitialFrameState,
|
|
7173
|
+
getFrameForComposition: () => getFrameForComposition
|
|
7174
|
+
});
|
|
7175
|
+
function mulberry32(a) {
|
|
7176
|
+
let t = a + 1831565813;
|
|
7177
|
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
7178
|
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
7179
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
7180
|
+
}
|
|
7181
|
+
function hashCode(str) {
|
|
7182
|
+
let i = 0;
|
|
7183
|
+
let chr = 0;
|
|
7184
|
+
let hash = 0;
|
|
7185
|
+
for (i = 0;i < str.length; i++) {
|
|
7186
|
+
chr = str.charCodeAt(i);
|
|
7187
|
+
hash = (hash << 5) - hash + chr;
|
|
7188
|
+
hash |= 0;
|
|
7189
|
+
}
|
|
7190
|
+
return hash;
|
|
7191
|
+
}
|
|
7192
|
+
var random = (seed, dummy) => {
|
|
7193
|
+
if (dummy !== undefined) {
|
|
7194
|
+
throw new TypeError("random() takes only one argument");
|
|
7195
|
+
}
|
|
7196
|
+
if (seed === null) {
|
|
7197
|
+
return Math.random();
|
|
7198
|
+
}
|
|
7199
|
+
if (typeof seed === "string") {
|
|
7200
|
+
return mulberry32(hashCode(seed));
|
|
7201
|
+
}
|
|
7202
|
+
if (typeof seed === "number") {
|
|
7203
|
+
return mulberry32(seed * 10000000000);
|
|
7204
|
+
}
|
|
7205
|
+
throw new Error("random() argument must be a number or a string");
|
|
7206
|
+
};
|
|
7207
|
+
var SetTimelineContext = createContext12({
|
|
7208
|
+
setFrame: () => {
|
|
7209
|
+
throw new Error("default");
|
|
7210
|
+
},
|
|
7211
|
+
setPlaying: () => {
|
|
7212
|
+
throw new Error("default");
|
|
7213
|
+
}
|
|
7214
|
+
});
|
|
7215
|
+
var TimelineContext = createContext12(null);
|
|
7216
|
+
var AbsoluteTimeContext = createContext12(null);
|
|
7217
|
+
var TimelineContextProvider = ({ children, frameState }) => {
|
|
7218
|
+
const [playing, setPlaying] = useState2(false);
|
|
7219
|
+
const imperativePlaying = useRef3(false);
|
|
7220
|
+
const [playbackRate, setPlaybackRate] = useState2(1);
|
|
7221
|
+
const audioAndVideoTags = useRef3([]);
|
|
7222
|
+
const [remotionRootId] = useState2(() => String(random(null)));
|
|
7223
|
+
const [_frame, setFrame] = useState2(() => getInitialFrameState());
|
|
7224
|
+
const frame = frameState ?? _frame;
|
|
7225
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
7226
|
+
if (typeof window !== "undefined") {
|
|
7227
|
+
useLayoutEffect(() => {
|
|
7228
|
+
window.remotion_setFrame = (f, composition, attempt) => {
|
|
7229
|
+
window.remotion_attempt = attempt;
|
|
7230
|
+
const id = delayRender2(`Setting the current frame to ${f}`);
|
|
7231
|
+
let asyncUpdate = true;
|
|
7232
|
+
setFrame((s) => {
|
|
7233
|
+
const currentFrame = s[composition] ?? window.remotion_initialFrame;
|
|
7234
|
+
if (currentFrame === f) {
|
|
7235
|
+
asyncUpdate = false;
|
|
7236
|
+
return s;
|
|
7237
|
+
}
|
|
7238
|
+
return {
|
|
7239
|
+
...s,
|
|
7240
|
+
[composition]: f
|
|
7241
|
+
};
|
|
7242
|
+
});
|
|
7243
|
+
if (asyncUpdate) {
|
|
7244
|
+
requestAnimationFrame(() => continueRender2(id));
|
|
7245
|
+
} else {
|
|
7246
|
+
continueRender2(id);
|
|
6931
7247
|
}
|
|
6932
7248
|
};
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
if (!context[composition.id]) {
|
|
6938
|
-
return null;
|
|
6939
|
-
}
|
|
6940
|
-
return context[composition.id];
|
|
6941
|
-
}, [
|
|
6942
|
-
composition,
|
|
6943
|
-
context,
|
|
6944
|
-
currentCompositionMetadata,
|
|
6945
|
-
selectedEditorProps,
|
|
6946
|
-
env.isPlayer
|
|
6947
|
-
]);
|
|
6948
|
-
};
|
|
6949
|
-
var useVideo = () => {
|
|
6950
|
-
const { canvasContent, compositions, currentCompositionMetadata } = useContext6(CompositionManager);
|
|
6951
|
-
const selected = compositions.find((c) => {
|
|
6952
|
-
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
6953
|
-
});
|
|
6954
|
-
const resolved = useResolvedVideoConfig(selected?.id ?? null);
|
|
6955
|
-
return useMemo5(() => {
|
|
6956
|
-
if (!resolved) {
|
|
6957
|
-
return null;
|
|
6958
|
-
}
|
|
6959
|
-
if (resolved.type === "error") {
|
|
6960
|
-
return null;
|
|
6961
|
-
}
|
|
6962
|
-
if (resolved.type === "loading") {
|
|
6963
|
-
return null;
|
|
6964
|
-
}
|
|
6965
|
-
if (!selected) {
|
|
6966
|
-
return null;
|
|
6967
|
-
}
|
|
7249
|
+
window.remotion_isPlayer = false;
|
|
7250
|
+
}, [continueRender2, delayRender2]);
|
|
7251
|
+
}
|
|
7252
|
+
const timelineContextValue = useMemo8(() => {
|
|
6968
7253
|
return {
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
7254
|
+
frame,
|
|
7255
|
+
playing,
|
|
7256
|
+
imperativePlaying,
|
|
7257
|
+
rootId: remotionRootId,
|
|
7258
|
+
playbackRate,
|
|
7259
|
+
setPlaybackRate,
|
|
7260
|
+
audioAndVideoTags
|
|
6974
7261
|
};
|
|
6975
|
-
}, [
|
|
7262
|
+
}, [frame, playbackRate, playing, remotionRootId]);
|
|
7263
|
+
const setTimelineContextValue = useMemo8(() => {
|
|
7264
|
+
return {
|
|
7265
|
+
setFrame,
|
|
7266
|
+
setPlaying
|
|
7267
|
+
};
|
|
7268
|
+
}, []);
|
|
7269
|
+
return /* @__PURE__ */ jsx82(AbsoluteTimeContext.Provider, {
|
|
7270
|
+
value: timelineContextValue,
|
|
7271
|
+
children: /* @__PURE__ */ jsx82(TimelineContext.Provider, {
|
|
7272
|
+
value: timelineContextValue,
|
|
7273
|
+
children: /* @__PURE__ */ jsx82(SetTimelineContext.Provider, {
|
|
7274
|
+
value: setTimelineContextValue,
|
|
7275
|
+
children
|
|
7276
|
+
})
|
|
7277
|
+
})
|
|
7278
|
+
});
|
|
6976
7279
|
};
|
|
6977
7280
|
var makeKey = () => {
|
|
6978
7281
|
return `remotion.time-all`;
|
|
@@ -7006,7 +7309,7 @@ var useTimelinePositionFromContext = (state) => {
|
|
|
7006
7309
|
return Math.min(videoConfig.durationInFrames - 1, unclamped);
|
|
7007
7310
|
};
|
|
7008
7311
|
var useTimelineContext = () => {
|
|
7009
|
-
const state =
|
|
7312
|
+
const state = useContext10(TimelineContext);
|
|
7010
7313
|
if (state === null) {
|
|
7011
7314
|
throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
7012
7315
|
}
|
|
@@ -7017,30 +7320,23 @@ var useTimelinePosition = () => {
|
|
|
7017
7320
|
return useTimelinePositionFromContext(state);
|
|
7018
7321
|
};
|
|
7019
7322
|
var useAbsoluteTimelinePosition = () => {
|
|
7020
|
-
const state =
|
|
7323
|
+
const state = useContext10(AbsoluteTimeContext);
|
|
7021
7324
|
if (state === null) {
|
|
7022
7325
|
throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
7023
7326
|
}
|
|
7024
7327
|
return useTimelinePositionFromContext(state);
|
|
7025
7328
|
};
|
|
7026
7329
|
var useTimelineSetFrame = () => {
|
|
7027
|
-
const { setFrame } =
|
|
7330
|
+
const { setFrame } = useContext10(SetTimelineContext);
|
|
7028
7331
|
return setFrame;
|
|
7029
7332
|
};
|
|
7030
7333
|
var usePlayingState = () => {
|
|
7031
7334
|
const { playing, imperativePlaying } = useTimelineContext();
|
|
7032
|
-
const { setPlaying } =
|
|
7033
|
-
return
|
|
7034
|
-
};
|
|
7035
|
-
var CanUseRemotionHooks = createContext10(false);
|
|
7036
|
-
var CanUseRemotionHooksProvider = ({ children }) => {
|
|
7037
|
-
return /* @__PURE__ */ jsx52(CanUseRemotionHooks.Provider, {
|
|
7038
|
-
value: true,
|
|
7039
|
-
children
|
|
7040
|
-
});
|
|
7335
|
+
const { setPlaying } = useContext10(SetTimelineContext);
|
|
7336
|
+
return useMemo9(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
|
|
7041
7337
|
};
|
|
7042
7338
|
var useCurrentFrame = () => {
|
|
7043
|
-
const canUseRemotionHooks =
|
|
7339
|
+
const canUseRemotionHooks = useContext11(CanUseRemotionHooks);
|
|
7044
7340
|
const env = useRemotionEnvironment();
|
|
7045
7341
|
if (!canUseRemotionHooks) {
|
|
7046
7342
|
if (env.isPlayer) {
|
|
@@ -7049,17 +7345,17 @@ var useCurrentFrame = () => {
|
|
|
7049
7345
|
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`);
|
|
7050
7346
|
}
|
|
7051
7347
|
const frame = useTimelinePosition();
|
|
7052
|
-
const context =
|
|
7348
|
+
const context = useContext11(SequenceContext);
|
|
7053
7349
|
const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
|
|
7054
7350
|
return frame - contextOffset;
|
|
7055
7351
|
};
|
|
7056
7352
|
var useUnsafeVideoConfig = () => {
|
|
7057
|
-
const context =
|
|
7353
|
+
const context = useContext12(SequenceContext);
|
|
7058
7354
|
const ctxWidth = context?.width ?? null;
|
|
7059
7355
|
const ctxHeight = context?.height ?? null;
|
|
7060
7356
|
const ctxDuration = context?.durationInFrames ?? null;
|
|
7061
7357
|
const video = useVideo();
|
|
7062
|
-
return
|
|
7358
|
+
return useMemo10(() => {
|
|
7063
7359
|
if (!video) {
|
|
7064
7360
|
return null;
|
|
7065
7361
|
}
|
|
@@ -7095,7 +7391,7 @@ var useUnsafeVideoConfig = () => {
|
|
|
7095
7391
|
};
|
|
7096
7392
|
var useVideoConfig = () => {
|
|
7097
7393
|
const videoConfig = useUnsafeVideoConfig();
|
|
7098
|
-
const context =
|
|
7394
|
+
const context = useContext13(CanUseRemotionHooks);
|
|
7099
7395
|
const isPlayer = useIsPlayer();
|
|
7100
7396
|
if (!videoConfig) {
|
|
7101
7397
|
if (typeof window !== "undefined" && window.remotion_isPlayer || isPlayer) {
|
|
@@ -7131,7 +7427,7 @@ var Freeze = ({
|
|
|
7131
7427
|
if (!Number.isFinite(frameToFreeze)) {
|
|
7132
7428
|
throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frameToFreeze}.`);
|
|
7133
7429
|
}
|
|
7134
|
-
const isActive =
|
|
7430
|
+
const isActive = useMemo11(() => {
|
|
7135
7431
|
if (typeof active === "boolean") {
|
|
7136
7432
|
return active;
|
|
7137
7433
|
}
|
|
@@ -7140,9 +7436,9 @@ var Freeze = ({
|
|
|
7140
7436
|
}
|
|
7141
7437
|
}, [active, frame]);
|
|
7142
7438
|
const timelineContext = useTimelineContext();
|
|
7143
|
-
const sequenceContext =
|
|
7439
|
+
const sequenceContext = useContext14(SequenceContext);
|
|
7144
7440
|
const relativeFrom = sequenceContext?.relativeFrom ?? 0;
|
|
7145
|
-
const timelineValue =
|
|
7441
|
+
const timelineValue = useMemo11(() => {
|
|
7146
7442
|
if (!isActive) {
|
|
7147
7443
|
return timelineContext;
|
|
7148
7444
|
}
|
|
@@ -7157,7 +7453,7 @@ var Freeze = ({
|
|
|
7157
7453
|
}
|
|
7158
7454
|
};
|
|
7159
7455
|
}, [isActive, timelineContext, videoConfig.id, frameToFreeze, relativeFrom]);
|
|
7160
|
-
const newSequenceContext =
|
|
7456
|
+
const newSequenceContext = useMemo11(() => {
|
|
7161
7457
|
if (!sequenceContext) {
|
|
7162
7458
|
return null;
|
|
7163
7459
|
}
|
|
@@ -7169,53 +7465,19 @@ var Freeze = ({
|
|
|
7169
7465
|
cumulatedFrom: 0
|
|
7170
7466
|
};
|
|
7171
7467
|
}, [sequenceContext, isActive]);
|
|
7172
|
-
return /* @__PURE__ */
|
|
7468
|
+
return /* @__PURE__ */ jsx92(TimelineContext.Provider, {
|
|
7173
7469
|
value: timelineValue,
|
|
7174
|
-
children: /* @__PURE__ */
|
|
7470
|
+
children: /* @__PURE__ */ jsx92(SequenceContext.Provider, {
|
|
7175
7471
|
value: newSequenceContext,
|
|
7176
7472
|
children
|
|
7177
7473
|
})
|
|
7178
7474
|
});
|
|
7179
7475
|
};
|
|
7180
|
-
var
|
|
7181
|
-
getNonce: () => 0
|
|
7182
|
-
});
|
|
7183
|
-
var fastRefreshNonce = 0;
|
|
7184
|
-
try {
|
|
7185
|
-
if (typeof __webpack_module__ !== "undefined") {
|
|
7186
|
-
if (__webpack_module__.hot) {
|
|
7187
|
-
__webpack_module__.hot.addStatusHandler((status) => {
|
|
7188
|
-
if (status === "idle") {
|
|
7189
|
-
fastRefreshNonce++;
|
|
7190
|
-
}
|
|
7191
|
-
});
|
|
7192
|
-
}
|
|
7193
|
-
}
|
|
7194
|
-
} catch {}
|
|
7195
|
-
var useNonce = () => {
|
|
7196
|
-
const context = useContext12(NonceContext);
|
|
7197
|
-
const nonce = context.getNonce();
|
|
7198
|
-
const nonceRef = useRef2(nonce);
|
|
7199
|
-
nonceRef.current = nonce;
|
|
7200
|
-
const history = useRef2([[fastRefreshNonce, nonce]]);
|
|
7201
|
-
const get = useCallback3(() => {
|
|
7202
|
-
if (fastRefreshNonce !== history.current[history.current.length - 1][0]) {
|
|
7203
|
-
history.current = [
|
|
7204
|
-
...history.current,
|
|
7205
|
-
[fastRefreshNonce, nonceRef.current]
|
|
7206
|
-
];
|
|
7207
|
-
}
|
|
7208
|
-
return history.current;
|
|
7209
|
-
}, [history]);
|
|
7210
|
-
return useMemo9(() => {
|
|
7211
|
-
return { get };
|
|
7212
|
-
}, [get]);
|
|
7213
|
-
};
|
|
7214
|
-
var PremountContext = createContext12({
|
|
7476
|
+
var PremountContext = createContext13({
|
|
7215
7477
|
premountFramesRemaining: 0,
|
|
7216
7478
|
playing: false
|
|
7217
7479
|
});
|
|
7218
|
-
var SequenceManager =
|
|
7480
|
+
var SequenceManager = React10.createContext({
|
|
7219
7481
|
registerSequence: () => {
|
|
7220
7482
|
throw new Error("SequenceManagerContext not initialized");
|
|
7221
7483
|
},
|
|
@@ -7224,13 +7486,13 @@ var SequenceManager = React8.createContext({
|
|
|
7224
7486
|
},
|
|
7225
7487
|
sequences: []
|
|
7226
7488
|
});
|
|
7227
|
-
var SequenceVisibilityToggleContext =
|
|
7489
|
+
var SequenceVisibilityToggleContext = React10.createContext({
|
|
7228
7490
|
hidden: {},
|
|
7229
7491
|
setHidden: () => {
|
|
7230
7492
|
throw new Error("SequenceVisibilityToggle not initialized");
|
|
7231
7493
|
}
|
|
7232
7494
|
});
|
|
7233
|
-
var VisualModeOverridesContext =
|
|
7495
|
+
var VisualModeOverridesContext = React10.createContext({
|
|
7234
7496
|
dragOverrides: {},
|
|
7235
7497
|
setDragOverrides: () => {
|
|
7236
7498
|
throw new Error("VisualModeOverridesContext not initialized");
|
|
@@ -7248,7 +7510,7 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
7248
7510
|
const [sequences, setSequences] = useState3([]);
|
|
7249
7511
|
const [hidden, setHidden] = useState3({});
|
|
7250
7512
|
const [dragOverrides, setControlOverrides] = useState3({});
|
|
7251
|
-
const controlOverridesRef =
|
|
7513
|
+
const controlOverridesRef = useRef4(dragOverrides);
|
|
7252
7514
|
controlOverridesRef.current = dragOverrides;
|
|
7253
7515
|
const [codeValues, setCodeValuesMapState] = useState3({});
|
|
7254
7516
|
const setDragOverrides = useCallback4((sequenceId, key, value) => {
|
|
@@ -7294,20 +7556,20 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
7294
7556
|
const unregisterSequence = useCallback4((seq) => {
|
|
7295
7557
|
setSequences((seqs) => seqs.filter((s) => s.id !== seq));
|
|
7296
7558
|
}, []);
|
|
7297
|
-
const sequenceContext =
|
|
7559
|
+
const sequenceContext = useMemo12(() => {
|
|
7298
7560
|
return {
|
|
7299
7561
|
registerSequence,
|
|
7300
7562
|
sequences,
|
|
7301
7563
|
unregisterSequence
|
|
7302
7564
|
};
|
|
7303
7565
|
}, [registerSequence, sequences, unregisterSequence]);
|
|
7304
|
-
const hiddenContext =
|
|
7566
|
+
const hiddenContext = useMemo12(() => {
|
|
7305
7567
|
return {
|
|
7306
7568
|
hidden,
|
|
7307
7569
|
setHidden
|
|
7308
7570
|
};
|
|
7309
7571
|
}, [hidden]);
|
|
7310
|
-
const overrideContext =
|
|
7572
|
+
const overrideContext = useMemo12(() => {
|
|
7311
7573
|
return {
|
|
7312
7574
|
visualModeEnabled,
|
|
7313
7575
|
dragOverrides,
|
|
@@ -7324,11 +7586,11 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
7324
7586
|
codeValues,
|
|
7325
7587
|
setCodeValues
|
|
7326
7588
|
]);
|
|
7327
|
-
return /* @__PURE__ */
|
|
7589
|
+
return /* @__PURE__ */ jsx102(SequenceManager.Provider, {
|
|
7328
7590
|
value: sequenceContext,
|
|
7329
|
-
children: /* @__PURE__ */
|
|
7591
|
+
children: /* @__PURE__ */ jsx102(SequenceVisibilityToggleContext.Provider, {
|
|
7330
7592
|
value: hiddenContext,
|
|
7331
|
-
children: /* @__PURE__ */
|
|
7593
|
+
children: /* @__PURE__ */ jsx102(VisualModeOverridesContext.Provider, {
|
|
7332
7594
|
value: overrideContext,
|
|
7333
7595
|
children
|
|
7334
7596
|
})
|
|
@@ -7353,7 +7615,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7353
7615
|
}, ref) => {
|
|
7354
7616
|
const { layout = "absolute-fill" } = other;
|
|
7355
7617
|
const [id] = useState4(() => String(Math.random()));
|
|
7356
|
-
const parentSequence =
|
|
7618
|
+
const parentSequence = useContext15(SequenceContext);
|
|
7357
7619
|
const { rootId } = useTimelineContext();
|
|
7358
7620
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
7359
7621
|
const nonce = useNonce();
|
|
@@ -7379,15 +7641,15 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7379
7641
|
const videoConfig = useVideoConfig();
|
|
7380
7642
|
const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - from, durationInFrames) : durationInFrames;
|
|
7381
7643
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
7382
|
-
const { registerSequence, unregisterSequence } =
|
|
7383
|
-
const { hidden } =
|
|
7384
|
-
const premounting =
|
|
7644
|
+
const { registerSequence, unregisterSequence } = useContext15(SequenceManager);
|
|
7645
|
+
const { hidden } = useContext15(SequenceVisibilityToggleContext);
|
|
7646
|
+
const premounting = useMemo13(() => {
|
|
7385
7647
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
7386
7648
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
7387
|
-
const postmounting =
|
|
7649
|
+
const postmounting = useMemo13(() => {
|
|
7388
7650
|
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
7389
7651
|
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
7390
|
-
const contextValue =
|
|
7652
|
+
const contextValue = useMemo13(() => {
|
|
7391
7653
|
return {
|
|
7392
7654
|
cumulatedFrom,
|
|
7393
7655
|
relativeFrom: from,
|
|
@@ -7414,12 +7676,12 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7414
7676
|
premountDisplay,
|
|
7415
7677
|
postmountDisplay
|
|
7416
7678
|
]);
|
|
7417
|
-
const timelineClipName =
|
|
7679
|
+
const timelineClipName = useMemo13(() => {
|
|
7418
7680
|
return name ?? "";
|
|
7419
7681
|
}, [name]);
|
|
7420
7682
|
const env = useRemotionEnvironment();
|
|
7421
7683
|
const inheritedStack = other?.stack ?? null;
|
|
7422
|
-
|
|
7684
|
+
useEffect3(() => {
|
|
7423
7685
|
if (!env.isStudio) {
|
|
7424
7686
|
return;
|
|
7425
7687
|
}
|
|
@@ -7466,7 +7728,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7466
7728
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
7467
7729
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
7468
7730
|
const styleIfThere = other.layout === "none" ? undefined : other.style;
|
|
7469
|
-
const defaultStyle =
|
|
7731
|
+
const defaultStyle = useMemo13(() => {
|
|
7470
7732
|
return {
|
|
7471
7733
|
flexDirection: undefined,
|
|
7472
7734
|
...width ? { width } : {},
|
|
@@ -7481,9 +7743,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7481
7743
|
if (isSequenceHidden) {
|
|
7482
7744
|
return null;
|
|
7483
7745
|
}
|
|
7484
|
-
return /* @__PURE__ */
|
|
7746
|
+
return /* @__PURE__ */ jsx112(SequenceContext.Provider, {
|
|
7485
7747
|
value: contextValue,
|
|
7486
|
-
children: content === null ? null : other.layout === "none" ? content : /* @__PURE__ */
|
|
7748
|
+
children: content === null ? null : other.layout === "none" ? content : /* @__PURE__ */ jsx112(AbsoluteFill, {
|
|
7487
7749
|
ref,
|
|
7488
7750
|
style: defaultStyle,
|
|
7489
7751
|
className: other.className,
|
|
@@ -7493,7 +7755,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7493
7755
|
};
|
|
7494
7756
|
var RegularSequence = forwardRef2(RegularSequenceRefForwardingFunction);
|
|
7495
7757
|
var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
7496
|
-
const parentPremountContext =
|
|
7758
|
+
const parentPremountContext = useContext15(PremountContext);
|
|
7497
7759
|
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
7498
7760
|
if (props.layout === "none") {
|
|
7499
7761
|
throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
|
|
@@ -7513,7 +7775,7 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
7513
7775
|
const postmountingActive = frame > endThreshold && frame <= endThreshold + postmountFor;
|
|
7514
7776
|
const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
|
|
7515
7777
|
const isFreezingActive = premountingActive || postmountingActive;
|
|
7516
|
-
const style =
|
|
7778
|
+
const style = useMemo13(() => {
|
|
7517
7779
|
return {
|
|
7518
7780
|
...passedStyle,
|
|
7519
7781
|
opacity: premountingActive || postmountingActive ? 0 : 1,
|
|
@@ -7530,18 +7792,18 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
7530
7792
|
]);
|
|
7531
7793
|
const { playing } = useTimelineContext();
|
|
7532
7794
|
const premountFramesRemaining = premountingActive ? from - frame : 0;
|
|
7533
|
-
const premountContextValue =
|
|
7795
|
+
const premountContextValue = useMemo13(() => {
|
|
7534
7796
|
return {
|
|
7535
7797
|
premountFramesRemaining,
|
|
7536
7798
|
playing: parentPremountContext.playing || playing
|
|
7537
7799
|
};
|
|
7538
7800
|
}, [premountFramesRemaining, parentPremountContext.playing, playing]);
|
|
7539
|
-
return /* @__PURE__ */
|
|
7801
|
+
return /* @__PURE__ */ jsx112(PremountContext.Provider, {
|
|
7540
7802
|
value: premountContextValue,
|
|
7541
|
-
children: /* @__PURE__ */
|
|
7803
|
+
children: /* @__PURE__ */ jsx112(Freeze, {
|
|
7542
7804
|
frame: freezeFrame,
|
|
7543
7805
|
active: isFreezingActive,
|
|
7544
|
-
children: /* @__PURE__ */
|
|
7806
|
+
children: /* @__PURE__ */ jsx112(Sequence, {
|
|
7545
7807
|
ref,
|
|
7546
7808
|
from,
|
|
7547
7809
|
durationInFrames,
|
|
@@ -7562,14 +7824,14 @@ var SequenceRefForwardingFunction = (props, ref) => {
|
|
|
7562
7824
|
if (props.layout !== "none" && !env.isRendering) {
|
|
7563
7825
|
const effectivePremountFor = ENABLE_V5_BREAKING_CHANGES ? props.premountFor ?? fps : props.premountFor;
|
|
7564
7826
|
if (effectivePremountFor || props.postmountFor) {
|
|
7565
|
-
return /* @__PURE__ */
|
|
7827
|
+
return /* @__PURE__ */ jsx112(PremountedPostmountedSequence, {
|
|
7566
7828
|
ref,
|
|
7567
7829
|
...props,
|
|
7568
7830
|
premountFor: effectivePremountFor
|
|
7569
7831
|
});
|
|
7570
7832
|
}
|
|
7571
7833
|
}
|
|
7572
|
-
return /* @__PURE__ */
|
|
7834
|
+
return /* @__PURE__ */ jsx112(RegularSequence, {
|
|
7573
7835
|
...props,
|
|
7574
7836
|
ref
|
|
7575
7837
|
});
|
|
@@ -7624,7 +7886,7 @@ var calcArgs = (fit, frameSize, canvasSize) => {
|
|
|
7624
7886
|
}
|
|
7625
7887
|
};
|
|
7626
7888
|
var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
|
|
7627
|
-
const canvasRef =
|
|
7889
|
+
const canvasRef = useRef5(null);
|
|
7628
7890
|
const draw = useCallback5((imageData) => {
|
|
7629
7891
|
const canvas = canvasRef.current;
|
|
7630
7892
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
@@ -7664,13 +7926,13 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref
|
|
|
7664
7926
|
}
|
|
7665
7927
|
};
|
|
7666
7928
|
}, [draw]);
|
|
7667
|
-
return /* @__PURE__ */
|
|
7929
|
+
return /* @__PURE__ */ jsx12("canvas", {
|
|
7668
7930
|
ref: canvasRef,
|
|
7669
7931
|
className,
|
|
7670
7932
|
style
|
|
7671
7933
|
});
|
|
7672
7934
|
};
|
|
7673
|
-
var Canvas =
|
|
7935
|
+
var Canvas = React12.forwardRef(CanvasRefForwardingFunction);
|
|
7674
7936
|
var CACHE_SIZE = 5;
|
|
7675
7937
|
var getActualTime = ({
|
|
7676
7938
|
loopBehavior,
|
|
@@ -7827,8 +8089,8 @@ var AnimatedImage = forwardRef3(({
|
|
|
7827
8089
|
fit = "fill",
|
|
7828
8090
|
...props
|
|
7829
8091
|
}, canvasRef) => {
|
|
7830
|
-
const mountState =
|
|
7831
|
-
|
|
8092
|
+
const mountState = useRef6({ isMounted: true });
|
|
8093
|
+
useEffect4(() => {
|
|
7832
8094
|
const { current } = mountState;
|
|
7833
8095
|
current.isMounted = true;
|
|
7834
8096
|
return () => {
|
|
@@ -7842,9 +8104,9 @@ var AnimatedImage = forwardRef3(({
|
|
|
7842
8104
|
const frame = useCurrentFrame();
|
|
7843
8105
|
const { fps } = useVideoConfig();
|
|
7844
8106
|
const currentTime = frame / playbackRate / fps;
|
|
7845
|
-
const currentTimeRef =
|
|
8107
|
+
const currentTimeRef = useRef6(currentTime);
|
|
7846
8108
|
currentTimeRef.current = currentTime;
|
|
7847
|
-
const ref =
|
|
8109
|
+
const ref = useRef6(null);
|
|
7848
8110
|
useImperativeHandle2(canvasRef, () => {
|
|
7849
8111
|
const c = ref.current?.getCanvas();
|
|
7850
8112
|
if (!c) {
|
|
@@ -7853,7 +8115,7 @@ var AnimatedImage = forwardRef3(({
|
|
|
7853
8115
|
return c;
|
|
7854
8116
|
}, []);
|
|
7855
8117
|
const [initialLoopBehavior] = useState5(() => loopBehavior);
|
|
7856
|
-
|
|
8118
|
+
useEffect4(() => {
|
|
7857
8119
|
const controller = new AbortController;
|
|
7858
8120
|
decodeImage({
|
|
7859
8121
|
resolvedSrc,
|
|
@@ -7916,7 +8178,7 @@ var AnimatedImage = forwardRef3(({
|
|
|
7916
8178
|
continueRender2,
|
|
7917
8179
|
delayRender2
|
|
7918
8180
|
]);
|
|
7919
|
-
return /* @__PURE__ */
|
|
8181
|
+
return /* @__PURE__ */ jsx13(Canvas, {
|
|
7920
8182
|
ref,
|
|
7921
8183
|
width,
|
|
7922
8184
|
height,
|
|
@@ -7953,7 +8215,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
7953
8215
|
}
|
|
7954
8216
|
validateContent(artifact.content);
|
|
7955
8217
|
};
|
|
7956
|
-
var RenderAssetManager =
|
|
8218
|
+
var RenderAssetManager = createContext14({
|
|
7957
8219
|
registerRenderAsset: () => {
|
|
7958
8220
|
return;
|
|
7959
8221
|
},
|
|
@@ -7964,7 +8226,7 @@ var RenderAssetManager = createContext13({
|
|
|
7964
8226
|
});
|
|
7965
8227
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
7966
8228
|
const [renderAssets, setRenderAssets] = useState6([]);
|
|
7967
|
-
const renderAssetsRef =
|
|
8229
|
+
const renderAssetsRef = useRef7([]);
|
|
7968
8230
|
const registerRenderAsset = useCallback6((renderAsset) => {
|
|
7969
8231
|
validateRenderAsset(renderAsset);
|
|
7970
8232
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
@@ -7996,21 +8258,21 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
7996
8258
|
};
|
|
7997
8259
|
}
|
|
7998
8260
|
}, []);
|
|
7999
|
-
const contextValue =
|
|
8261
|
+
const contextValue = useMemo14(() => {
|
|
8000
8262
|
return {
|
|
8001
8263
|
registerRenderAsset,
|
|
8002
8264
|
unregisterRenderAsset,
|
|
8003
8265
|
renderAssets
|
|
8004
8266
|
};
|
|
8005
8267
|
}, [renderAssets, registerRenderAsset, unregisterRenderAsset]);
|
|
8006
|
-
return /* @__PURE__ */
|
|
8268
|
+
return /* @__PURE__ */ jsx14(RenderAssetManager.Provider, {
|
|
8007
8269
|
value: contextValue,
|
|
8008
8270
|
children
|
|
8009
8271
|
});
|
|
8010
8272
|
};
|
|
8011
8273
|
var ArtifactThumbnail = Symbol("Thumbnail");
|
|
8012
8274
|
var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
8013
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
8275
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext16(RenderAssetManager);
|
|
8014
8276
|
const env = useRemotionEnvironment();
|
|
8015
8277
|
const frame = useCurrentFrame();
|
|
8016
8278
|
const [id] = useState7(() => {
|
|
@@ -8091,9 +8353,9 @@ var calculateMediaDuration = ({
|
|
|
8091
8353
|
const actualDuration = duration / playbackRate;
|
|
8092
8354
|
return Math.floor(actualDuration);
|
|
8093
8355
|
};
|
|
8094
|
-
var LoopContext =
|
|
8356
|
+
var LoopContext = createContext15(null);
|
|
8095
8357
|
var useLoop = () => {
|
|
8096
|
-
return
|
|
8358
|
+
return React13.useContext(LoopContext);
|
|
8097
8359
|
};
|
|
8098
8360
|
var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
|
|
8099
8361
|
const currentFrame = useCurrentFrame();
|
|
@@ -8118,22 +8380,22 @@ var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) =>
|
|
|
8118
8380
|
const iteration = Math.floor(currentFrame / durationInFrames);
|
|
8119
8381
|
const start = iteration * durationInFrames;
|
|
8120
8382
|
const from = Math.min(start, maxFrame);
|
|
8121
|
-
const loopDisplay =
|
|
8383
|
+
const loopDisplay = useMemo15(() => {
|
|
8122
8384
|
return {
|
|
8123
8385
|
numberOfTimes: Math.min(compDuration / durationInFrames, times),
|
|
8124
8386
|
startOffset: -from,
|
|
8125
8387
|
durationInFrames
|
|
8126
8388
|
};
|
|
8127
8389
|
}, [compDuration, durationInFrames, from, times]);
|
|
8128
|
-
const loopContext =
|
|
8390
|
+
const loopContext = useMemo15(() => {
|
|
8129
8391
|
return {
|
|
8130
8392
|
iteration: Math.floor(currentFrame / durationInFrames),
|
|
8131
8393
|
durationInFrames
|
|
8132
8394
|
};
|
|
8133
8395
|
}, [currentFrame, durationInFrames]);
|
|
8134
|
-
return /* @__PURE__ */
|
|
8396
|
+
return /* @__PURE__ */ jsx15(LoopContext.Provider, {
|
|
8135
8397
|
value: loopContext,
|
|
8136
|
-
children: /* @__PURE__ */
|
|
8398
|
+
children: /* @__PURE__ */ jsx15(Sequence, {
|
|
8137
8399
|
durationInFrames,
|
|
8138
8400
|
from,
|
|
8139
8401
|
name: name ?? "<Loop>",
|
|
@@ -8154,7 +8416,7 @@ var playbackLogging = ({
|
|
|
8154
8416
|
const tags = [mountTime ? Date.now() - mountTime + "ms " : null, tag].filter(Boolean).join(" ");
|
|
8155
8417
|
Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
|
|
8156
8418
|
};
|
|
8157
|
-
var PreloadContext =
|
|
8419
|
+
var PreloadContext = createContext16({});
|
|
8158
8420
|
var preloads = {};
|
|
8159
8421
|
var updaters = [];
|
|
8160
8422
|
var setPreloads = (updater) => {
|
|
@@ -8163,7 +8425,7 @@ var setPreloads = (updater) => {
|
|
|
8163
8425
|
};
|
|
8164
8426
|
var PrefetchProvider = ({ children }) => {
|
|
8165
8427
|
const [_preloads, _setPreloads] = useState8(() => preloads);
|
|
8166
|
-
|
|
8428
|
+
useEffect5(() => {
|
|
8167
8429
|
const updaterFunction = () => {
|
|
8168
8430
|
_setPreloads(preloads);
|
|
8169
8431
|
};
|
|
@@ -8172,7 +8434,7 @@ var PrefetchProvider = ({ children }) => {
|
|
|
8172
8434
|
updaters = updaters.filter((u) => u !== updaterFunction);
|
|
8173
8435
|
};
|
|
8174
8436
|
}, []);
|
|
8175
|
-
return /* @__PURE__ */
|
|
8437
|
+
return /* @__PURE__ */ jsx16(PreloadContext.Provider, {
|
|
8176
8438
|
value: _preloads,
|
|
8177
8439
|
children
|
|
8178
8440
|
});
|
|
@@ -8192,7 +8454,7 @@ var getSrcWithoutHash = (src) => {
|
|
|
8192
8454
|
return src.slice(0, hashIndex);
|
|
8193
8455
|
};
|
|
8194
8456
|
var usePreload = (src) => {
|
|
8195
|
-
const preloads2 =
|
|
8457
|
+
const preloads2 = useContext17(PreloadContext);
|
|
8196
8458
|
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
8197
8459
|
const withoutHashFragment = getSrcWithoutHash(src);
|
|
8198
8460
|
if (!preloads2[withoutHashFragment]) {
|
|
@@ -8475,7 +8737,7 @@ var durationReducer = (state, action) => {
|
|
|
8475
8737
|
return state;
|
|
8476
8738
|
}
|
|
8477
8739
|
};
|
|
8478
|
-
var DurationsContext =
|
|
8740
|
+
var DurationsContext = createContext17({
|
|
8479
8741
|
durations: {},
|
|
8480
8742
|
setDurations: () => {
|
|
8481
8743
|
throw new Error("context missing");
|
|
@@ -8483,13 +8745,13 @@ var DurationsContext = createContext16({
|
|
|
8483
8745
|
});
|
|
8484
8746
|
var DurationsContextProvider = ({ children }) => {
|
|
8485
8747
|
const [durations, setDurations] = useReducer(durationReducer, {});
|
|
8486
|
-
const value =
|
|
8748
|
+
const value = useMemo16(() => {
|
|
8487
8749
|
return {
|
|
8488
8750
|
durations,
|
|
8489
8751
|
setDurations
|
|
8490
8752
|
};
|
|
8491
8753
|
}, [durations]);
|
|
8492
|
-
return /* @__PURE__ */
|
|
8754
|
+
return /* @__PURE__ */ jsx17(DurationsContext.Provider, {
|
|
8493
8755
|
value,
|
|
8494
8756
|
children
|
|
8495
8757
|
});
|
|
@@ -8617,7 +8879,7 @@ var useSingletonAudioContext = ({
|
|
|
8617
8879
|
audioEnabled
|
|
8618
8880
|
}) => {
|
|
8619
8881
|
const env = useRemotionEnvironment();
|
|
8620
|
-
const audioContext =
|
|
8882
|
+
const audioContext = useMemo17(() => {
|
|
8621
8883
|
if (env.isRendering) {
|
|
8622
8884
|
return null;
|
|
8623
8885
|
}
|
|
@@ -8661,9 +8923,9 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
8661
8923
|
}
|
|
8662
8924
|
return true;
|
|
8663
8925
|
};
|
|
8664
|
-
var SharedAudioContext =
|
|
8926
|
+
var SharedAudioContext = createContext18(null);
|
|
8665
8927
|
var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHint, audioEnabled }) => {
|
|
8666
|
-
const audios =
|
|
8928
|
+
const audios = useRef8([]);
|
|
8667
8929
|
const [initialNumberOfAudioTags] = useState9(numberOfAudioTags);
|
|
8668
8930
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
8669
8931
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
@@ -8674,9 +8936,9 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8674
8936
|
latencyHint: audioLatencyHint,
|
|
8675
8937
|
audioEnabled
|
|
8676
8938
|
});
|
|
8677
|
-
const audioSyncAnchor =
|
|
8678
|
-
const prevEndTimes =
|
|
8679
|
-
const scheduleAudioNode =
|
|
8939
|
+
const audioSyncAnchor = useMemo18(() => ({ value: 0 }), []);
|
|
8940
|
+
const prevEndTimes = useRef8({ scheduledEndTime: null, mediaEndTime: null });
|
|
8941
|
+
const scheduleAudioNode = useMemo18(() => {
|
|
8680
8942
|
return ({
|
|
8681
8943
|
node,
|
|
8682
8944
|
mediaTimestamp,
|
|
@@ -8731,7 +8993,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8731
8993
|
};
|
|
8732
8994
|
};
|
|
8733
8995
|
}, [audioContext, logLevel]);
|
|
8734
|
-
const refs =
|
|
8996
|
+
const refs = useMemo18(() => {
|
|
8735
8997
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
8736
8998
|
const ref = createRef2();
|
|
8737
8999
|
return {
|
|
@@ -8744,7 +9006,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8744
9006
|
};
|
|
8745
9007
|
});
|
|
8746
9008
|
}, [audioContext, numberOfAudioTags]);
|
|
8747
|
-
const effectToUse =
|
|
9009
|
+
const effectToUse = React16.useInsertionEffect ?? React16.useLayoutEffect;
|
|
8748
9010
|
effectToUse(() => {
|
|
8749
9011
|
return () => {
|
|
8750
9012
|
requestAnimationFrame(() => {
|
|
@@ -8754,7 +9016,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8754
9016
|
});
|
|
8755
9017
|
};
|
|
8756
9018
|
}, [refs]);
|
|
8757
|
-
const takenAudios =
|
|
9019
|
+
const takenAudios = useRef8(new Array(numberOfAudioTags).fill(false));
|
|
8758
9020
|
const rerenderAudios = useCallback7(() => {
|
|
8759
9021
|
refs.forEach(({ ref, id }) => {
|
|
8760
9022
|
const data = audios.current?.find((a) => a.id === id);
|
|
@@ -8870,7 +9132,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8870
9132
|
});
|
|
8871
9133
|
audioContext?.resume();
|
|
8872
9134
|
}, [audioContext, logLevel, mountTime, refs, env.isPlayer]);
|
|
8873
|
-
const value =
|
|
9135
|
+
const value = useMemo18(() => {
|
|
8874
9136
|
return {
|
|
8875
9137
|
registerAudio,
|
|
8876
9138
|
unregisterAudio,
|
|
@@ -8891,11 +9153,11 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8891
9153
|
audioSyncAnchor,
|
|
8892
9154
|
scheduleAudioNode
|
|
8893
9155
|
]);
|
|
8894
|
-
return /* @__PURE__ */
|
|
9156
|
+
return /* @__PURE__ */ jsxs22(SharedAudioContext.Provider, {
|
|
8895
9157
|
value,
|
|
8896
9158
|
children: [
|
|
8897
9159
|
refs.map(({ id, ref }) => {
|
|
8898
|
-
return /* @__PURE__ */
|
|
9160
|
+
return /* @__PURE__ */ jsx18("audio", {
|
|
8899
9161
|
ref,
|
|
8900
9162
|
preload: "metadata",
|
|
8901
9163
|
src: EMPTY_AUDIO
|
|
@@ -8911,12 +9173,12 @@ var useSharedAudio = ({
|
|
|
8911
9173
|
premounting,
|
|
8912
9174
|
postmounting
|
|
8913
9175
|
}) => {
|
|
8914
|
-
const ctx =
|
|
9176
|
+
const ctx = useContext18(SharedAudioContext);
|
|
8915
9177
|
const [elem] = useState9(() => {
|
|
8916
9178
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
8917
9179
|
return ctx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
8918
9180
|
}
|
|
8919
|
-
const el =
|
|
9181
|
+
const el = React16.createRef();
|
|
8920
9182
|
const mediaElementSourceNode = ctx?.audioContext ? makeSharedElementSourceNode({
|
|
8921
9183
|
audioContext: ctx.audioContext,
|
|
8922
9184
|
ref: el
|
|
@@ -8935,7 +9197,7 @@ var useSharedAudio = ({
|
|
|
8935
9197
|
}
|
|
8936
9198
|
};
|
|
8937
9199
|
});
|
|
8938
|
-
const effectToUse =
|
|
9200
|
+
const effectToUse = React16.useInsertionEffect ?? React16.useLayoutEffect;
|
|
8939
9201
|
if (typeof document !== "undefined") {
|
|
8940
9202
|
effectToUse(() => {
|
|
8941
9203
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
@@ -9042,9 +9304,9 @@ var useAppendVideoFragment = ({
|
|
|
9042
9304
|
duration: initialDuration,
|
|
9043
9305
|
fps
|
|
9044
9306
|
}) => {
|
|
9045
|
-
const actualFromRef =
|
|
9046
|
-
const actualDuration =
|
|
9047
|
-
const actualSrc =
|
|
9307
|
+
const actualFromRef = useRef9(initialActualFrom);
|
|
9308
|
+
const actualDuration = useRef9(initialDuration);
|
|
9309
|
+
const actualSrc = useRef9(initialActualSrc);
|
|
9048
9310
|
if (!isSubsetOfDuration({
|
|
9049
9311
|
prevStartFrom: actualFromRef.current,
|
|
9050
9312
|
newStartFrom: initialActualFrom,
|
|
@@ -9081,10 +9343,10 @@ var useVolume = ({
|
|
|
9081
9343
|
source,
|
|
9082
9344
|
shouldUseWebAudioApi
|
|
9083
9345
|
}) => {
|
|
9084
|
-
const audioStuffRef =
|
|
9085
|
-
const currentVolumeRef =
|
|
9346
|
+
const audioStuffRef = useRef10(null);
|
|
9347
|
+
const currentVolumeRef = useRef10(volume);
|
|
9086
9348
|
currentVolumeRef.current = volume;
|
|
9087
|
-
const sharedAudioContext =
|
|
9349
|
+
const sharedAudioContext = useContext19(SharedAudioContext);
|
|
9088
9350
|
if (!sharedAudioContext) {
|
|
9089
9351
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
9090
9352
|
}
|
|
@@ -9139,7 +9401,7 @@ var useVolume = ({
|
|
|
9139
9401
|
return audioStuffRef;
|
|
9140
9402
|
};
|
|
9141
9403
|
var useMediaStartsAt = () => {
|
|
9142
|
-
const parentSequence =
|
|
9404
|
+
const parentSequence = useContext20(SequenceContext);
|
|
9143
9405
|
const startsAt = Math.min(0, parentSequence?.relativeFrom ?? 0);
|
|
9144
9406
|
return startsAt;
|
|
9145
9407
|
};
|
|
@@ -9204,7 +9466,7 @@ var useBasicMediaInTimeline = ({
|
|
|
9204
9466
|
throw new Error("No src passed");
|
|
9205
9467
|
}
|
|
9206
9468
|
const startsAt = useMediaStartsAt();
|
|
9207
|
-
const parentSequence =
|
|
9469
|
+
const parentSequence = useContext21(SequenceContext);
|
|
9208
9470
|
const videoConfig = useVideoConfig();
|
|
9209
9471
|
const [initialVolume] = useState10(() => volume);
|
|
9210
9472
|
const mediaDuration = calculateMediaDuration({
|
|
@@ -9214,7 +9476,7 @@ var useBasicMediaInTimeline = ({
|
|
|
9214
9476
|
trimAfter
|
|
9215
9477
|
});
|
|
9216
9478
|
const duration = parentSequence ? Math.min(parentSequence.durationInFrames, mediaDuration) : mediaDuration;
|
|
9217
|
-
const volumes =
|
|
9479
|
+
const volumes = useMemo19(() => {
|
|
9218
9480
|
if (typeof volume === "number") {
|
|
9219
9481
|
return volume;
|
|
9220
9482
|
}
|
|
@@ -9226,7 +9488,7 @@ var useBasicMediaInTimeline = ({
|
|
|
9226
9488
|
});
|
|
9227
9489
|
}).join(",");
|
|
9228
9490
|
}, [duration, startsAt, volume, mediaVolume]);
|
|
9229
|
-
|
|
9491
|
+
useEffect6(() => {
|
|
9230
9492
|
if (typeof volume === "number" && volume !== initialVolume) {
|
|
9231
9493
|
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`);
|
|
9232
9494
|
}
|
|
@@ -9253,10 +9515,11 @@ var useImageInTimeline = ({
|
|
|
9253
9515
|
showInTimeline,
|
|
9254
9516
|
premountDisplay,
|
|
9255
9517
|
postmountDisplay,
|
|
9256
|
-
loopDisplay
|
|
9518
|
+
loopDisplay,
|
|
9519
|
+
controls
|
|
9257
9520
|
}) => {
|
|
9258
|
-
const parentSequence =
|
|
9259
|
-
const { registerSequence, unregisterSequence } =
|
|
9521
|
+
const parentSequence = useContext21(SequenceContext);
|
|
9522
|
+
const { registerSequence, unregisterSequence } = useContext21(SequenceManager);
|
|
9260
9523
|
const { duration, nonce, rootId, isStudio, finalDisplayName } = useBasicMediaInTimeline({
|
|
9261
9524
|
volume: undefined,
|
|
9262
9525
|
mediaVolume: 0,
|
|
@@ -9267,7 +9530,7 @@ var useImageInTimeline = ({
|
|
|
9267
9530
|
trimBefore: undefined,
|
|
9268
9531
|
playbackRate: 1
|
|
9269
9532
|
});
|
|
9270
|
-
|
|
9533
|
+
useEffect6(() => {
|
|
9271
9534
|
if (!src) {
|
|
9272
9535
|
throw new Error("No src passed");
|
|
9273
9536
|
}
|
|
@@ -9292,7 +9555,7 @@ var useImageInTimeline = ({
|
|
|
9292
9555
|
stack,
|
|
9293
9556
|
premountDisplay,
|
|
9294
9557
|
postmountDisplay,
|
|
9295
|
-
controls
|
|
9558
|
+
controls
|
|
9296
9559
|
});
|
|
9297
9560
|
return () => {
|
|
9298
9561
|
unregisterSequence(id);
|
|
@@ -9312,7 +9575,8 @@ var useImageInTimeline = ({
|
|
|
9312
9575
|
isStudio,
|
|
9313
9576
|
loopDisplay,
|
|
9314
9577
|
rootId,
|
|
9315
|
-
finalDisplayName
|
|
9578
|
+
finalDisplayName,
|
|
9579
|
+
controls
|
|
9316
9580
|
]);
|
|
9317
9581
|
};
|
|
9318
9582
|
var useMediaInTimeline = ({
|
|
@@ -9329,9 +9593,9 @@ var useMediaInTimeline = ({
|
|
|
9329
9593
|
postmountDisplay,
|
|
9330
9594
|
loopDisplay
|
|
9331
9595
|
}) => {
|
|
9332
|
-
const parentSequence =
|
|
9596
|
+
const parentSequence = useContext21(SequenceContext);
|
|
9333
9597
|
const startsAt = useMediaStartsAt();
|
|
9334
|
-
const { registerSequence, unregisterSequence } =
|
|
9598
|
+
const { registerSequence, unregisterSequence } = useContext21(SequenceManager);
|
|
9335
9599
|
const {
|
|
9336
9600
|
volumes,
|
|
9337
9601
|
duration,
|
|
@@ -9350,7 +9614,7 @@ var useMediaInTimeline = ({
|
|
|
9350
9614
|
trimBefore: undefined,
|
|
9351
9615
|
playbackRate
|
|
9352
9616
|
});
|
|
9353
|
-
|
|
9617
|
+
useEffect6(() => {
|
|
9354
9618
|
if (!src) {
|
|
9355
9619
|
throw new Error("No src passed");
|
|
9356
9620
|
}
|
|
@@ -9413,7 +9677,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
9413
9677
|
const [onResumeCallbacks, setOnResumeCallbacks] = useState11([]);
|
|
9414
9678
|
const env = useRemotionEnvironment();
|
|
9415
9679
|
const rendering = env.isRendering;
|
|
9416
|
-
const buffering =
|
|
9680
|
+
const buffering = useRef11(false);
|
|
9417
9681
|
const addBlock = useCallback8((block) => {
|
|
9418
9682
|
if (rendering) {
|
|
9419
9683
|
return {
|
|
@@ -9451,7 +9715,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
9451
9715
|
}
|
|
9452
9716
|
};
|
|
9453
9717
|
}, []);
|
|
9454
|
-
|
|
9718
|
+
useEffect7(() => {
|
|
9455
9719
|
if (rendering) {
|
|
9456
9720
|
return;
|
|
9457
9721
|
}
|
|
@@ -9481,22 +9745,22 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
9481
9745
|
}
|
|
9482
9746
|
}, [blocks]);
|
|
9483
9747
|
}
|
|
9484
|
-
return
|
|
9748
|
+
return useMemo20(() => {
|
|
9485
9749
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
9486
9750
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
9487
9751
|
};
|
|
9488
|
-
var BufferingContextReact =
|
|
9752
|
+
var BufferingContextReact = React17.createContext(null);
|
|
9489
9753
|
var BufferingProvider = ({ children }) => {
|
|
9490
|
-
const { logLevel, mountTime } =
|
|
9754
|
+
const { logLevel, mountTime } = useContext22(LogLevelContext);
|
|
9491
9755
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
|
|
9492
|
-
return /* @__PURE__ */
|
|
9756
|
+
return /* @__PURE__ */ jsx19(BufferingContextReact.Provider, {
|
|
9493
9757
|
value: bufferManager,
|
|
9494
9758
|
children
|
|
9495
9759
|
});
|
|
9496
9760
|
};
|
|
9497
9761
|
var useIsPlayerBuffering = (bufferManager) => {
|
|
9498
9762
|
const [isBuffering, setIsBuffering] = useState11(bufferManager.buffering.current);
|
|
9499
|
-
|
|
9763
|
+
useEffect7(() => {
|
|
9500
9764
|
const onBuffer = () => {
|
|
9501
9765
|
setIsBuffering(true);
|
|
9502
9766
|
};
|
|
@@ -9517,9 +9781,9 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
9517
9781
|
return isBuffering;
|
|
9518
9782
|
};
|
|
9519
9783
|
var useBufferState = () => {
|
|
9520
|
-
const buffer =
|
|
9784
|
+
const buffer = useContext23(BufferingContextReact);
|
|
9521
9785
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
9522
|
-
return
|
|
9786
|
+
return useMemo21(() => ({
|
|
9523
9787
|
delayPlayback: () => {
|
|
9524
9788
|
if (!addBlock) {
|
|
9525
9789
|
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");
|
|
@@ -9543,7 +9807,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
9543
9807
|
logLevel,
|
|
9544
9808
|
mountTime
|
|
9545
9809
|
}) => {
|
|
9546
|
-
const bufferingRef =
|
|
9810
|
+
const bufferingRef = useRef12(false);
|
|
9547
9811
|
const { delayPlayback } = useBufferState();
|
|
9548
9812
|
const bufferUntilFirstFrame = useCallback9((requestedTime) => {
|
|
9549
9813
|
if (mediaType !== "video") {
|
|
@@ -9616,7 +9880,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
9616
9880
|
onVariableFpsVideoDetected,
|
|
9617
9881
|
pauseWhenBuffering
|
|
9618
9882
|
]);
|
|
9619
|
-
return
|
|
9883
|
+
return useMemo22(() => {
|
|
9620
9884
|
return {
|
|
9621
9885
|
isBuffering: () => bufferingRef.current,
|
|
9622
9886
|
bufferUntilFirstFrame
|
|
@@ -9624,7 +9888,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
9624
9888
|
}, [bufferUntilFirstFrame]);
|
|
9625
9889
|
};
|
|
9626
9890
|
var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
|
|
9627
|
-
const lastUpdate =
|
|
9891
|
+
const lastUpdate = React18.useRef({
|
|
9628
9892
|
time: mediaRef.current?.currentTime ?? 0,
|
|
9629
9893
|
lastUpdate: performance.now()
|
|
9630
9894
|
});
|
|
@@ -9665,7 +9929,7 @@ var useMediaBuffering = ({
|
|
|
9665
9929
|
}) => {
|
|
9666
9930
|
const buffer = useBufferState();
|
|
9667
9931
|
const [isBuffering, setIsBuffering] = useState12(false);
|
|
9668
|
-
|
|
9932
|
+
useEffect8(() => {
|
|
9669
9933
|
let cleanupFns = [];
|
|
9670
9934
|
const { current } = element;
|
|
9671
9935
|
if (!current) {
|
|
@@ -9797,8 +10061,8 @@ var useRequestVideoCallbackTime = ({
|
|
|
9797
10061
|
lastSeek,
|
|
9798
10062
|
onVariableFpsVideoDetected
|
|
9799
10063
|
}) => {
|
|
9800
|
-
const currentTime =
|
|
9801
|
-
|
|
10064
|
+
const currentTime = useRef13(null);
|
|
10065
|
+
useEffect9(() => {
|
|
9802
10066
|
const { current } = mediaRef;
|
|
9803
10067
|
if (current) {
|
|
9804
10068
|
currentTime.current = {
|
|
@@ -10022,17 +10286,17 @@ var useMediaPlayback = ({
|
|
|
10022
10286
|
const frame = useCurrentFrame();
|
|
10023
10287
|
const absoluteFrame = useTimelinePosition();
|
|
10024
10288
|
const [playing] = usePlayingState();
|
|
10025
|
-
const buffering =
|
|
10289
|
+
const buffering = useContext24(BufferingContextReact);
|
|
10026
10290
|
const { fps } = useVideoConfig();
|
|
10027
10291
|
const mediaStartsAt = useMediaStartsAt();
|
|
10028
|
-
const lastSeekDueToShift =
|
|
10029
|
-
const lastSeek =
|
|
10292
|
+
const lastSeekDueToShift = useRef14(null);
|
|
10293
|
+
const lastSeek = useRef14(null);
|
|
10030
10294
|
const logLevel = useLogLevel();
|
|
10031
10295
|
const mountTime = useMountTime();
|
|
10032
10296
|
if (!buffering) {
|
|
10033
10297
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
10034
10298
|
}
|
|
10035
|
-
const isVariableFpsVideoMap =
|
|
10299
|
+
const isVariableFpsVideoMap = useRef14({});
|
|
10036
10300
|
const onVariableFpsVideoDetected = useCallback10(() => {
|
|
10037
10301
|
if (!src) {
|
|
10038
10302
|
return;
|
|
@@ -10084,7 +10348,7 @@ var useMediaPlayback = ({
|
|
|
10084
10348
|
return acceptableTimeshift ?? defaultAcceptableTimeshift;
|
|
10085
10349
|
})();
|
|
10086
10350
|
const isPlayerBuffering = useIsPlayerBuffering(buffering);
|
|
10087
|
-
|
|
10351
|
+
useEffect10(() => {
|
|
10088
10352
|
if (mediaRef.current?.paused) {
|
|
10089
10353
|
return;
|
|
10090
10354
|
}
|
|
@@ -10129,7 +10393,7 @@ var useMediaPlayback = ({
|
|
|
10129
10393
|
mediaRef.current.playbackRate = playbackRateToSet;
|
|
10130
10394
|
}
|
|
10131
10395
|
}, [mediaRef, playbackRate]);
|
|
10132
|
-
|
|
10396
|
+
useEffect10(() => {
|
|
10133
10397
|
const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
|
|
10134
10398
|
if (!mediaRef.current) {
|
|
10135
10399
|
throw new Error(`No ${mediaType} ref found`);
|
|
@@ -10258,7 +10522,7 @@ var useMediaTag = ({
|
|
|
10258
10522
|
const logLevel = useLogLevel();
|
|
10259
10523
|
const mountTime = useMountTime();
|
|
10260
10524
|
const env = useRemotionEnvironment();
|
|
10261
|
-
|
|
10525
|
+
useEffect11(() => {
|
|
10262
10526
|
const tag = {
|
|
10263
10527
|
id,
|
|
10264
10528
|
play: (reason) => {
|
|
@@ -10297,11 +10561,11 @@ var useMediaTag = ({
|
|
|
10297
10561
|
env.isPlayer
|
|
10298
10562
|
]);
|
|
10299
10563
|
};
|
|
10300
|
-
var MediaVolumeContext =
|
|
10564
|
+
var MediaVolumeContext = createContext19({
|
|
10301
10565
|
mediaMuted: false,
|
|
10302
10566
|
mediaVolume: 1
|
|
10303
10567
|
});
|
|
10304
|
-
var SetMediaVolumeContext =
|
|
10568
|
+
var SetMediaVolumeContext = createContext19({
|
|
10305
10569
|
setMediaMuted: () => {
|
|
10306
10570
|
throw new Error("default");
|
|
10307
10571
|
},
|
|
@@ -10310,16 +10574,16 @@ var SetMediaVolumeContext = createContext18({
|
|
|
10310
10574
|
}
|
|
10311
10575
|
});
|
|
10312
10576
|
var useMediaVolumeState = () => {
|
|
10313
|
-
const { mediaVolume } =
|
|
10314
|
-
const { setMediaVolume } =
|
|
10315
|
-
return
|
|
10577
|
+
const { mediaVolume } = useContext25(MediaVolumeContext);
|
|
10578
|
+
const { setMediaVolume } = useContext25(SetMediaVolumeContext);
|
|
10579
|
+
return useMemo23(() => {
|
|
10316
10580
|
return [mediaVolume, setMediaVolume];
|
|
10317
10581
|
}, [mediaVolume, setMediaVolume]);
|
|
10318
10582
|
};
|
|
10319
10583
|
var useMediaMutedState = () => {
|
|
10320
|
-
const { mediaMuted } =
|
|
10321
|
-
const { setMediaMuted } =
|
|
10322
|
-
return
|
|
10584
|
+
const { mediaMuted } = useContext25(MediaVolumeContext);
|
|
10585
|
+
const { setMediaMuted } = useContext25(SetMediaVolumeContext);
|
|
10586
|
+
return useMemo23(() => {
|
|
10323
10587
|
return [mediaMuted, setMediaMuted];
|
|
10324
10588
|
}, [mediaMuted, setMediaMuted]);
|
|
10325
10589
|
};
|
|
@@ -10368,12 +10632,12 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10368
10632
|
const [mediaVolume] = useMediaVolumeState();
|
|
10369
10633
|
const [mediaMuted] = useMediaMutedState();
|
|
10370
10634
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
10371
|
-
const { hidden } =
|
|
10635
|
+
const { hidden } = useContext26(SequenceVisibilityToggleContext);
|
|
10372
10636
|
if (!src) {
|
|
10373
10637
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
10374
10638
|
}
|
|
10375
10639
|
const preloadedSrc = usePreload(src);
|
|
10376
|
-
const sequenceContext =
|
|
10640
|
+
const sequenceContext = useContext26(SequenceContext);
|
|
10377
10641
|
const [timelineId] = useState13(() => String(Math.random()));
|
|
10378
10642
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
10379
10643
|
const userPreferredVolume = evaluateVolume({
|
|
@@ -10387,7 +10651,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10387
10651
|
requestsVideoFrame: false,
|
|
10388
10652
|
isClientSideRendering: false
|
|
10389
10653
|
});
|
|
10390
|
-
const propsToPass =
|
|
10654
|
+
const propsToPass = useMemo24(() => {
|
|
10391
10655
|
return {
|
|
10392
10656
|
muted: muted || mediaMuted || isSequenceHidden || userPreferredVolume <= 0,
|
|
10393
10657
|
src: preloadedSrc,
|
|
@@ -10405,7 +10669,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10405
10669
|
userPreferredVolume,
|
|
10406
10670
|
crossOriginValue
|
|
10407
10671
|
]);
|
|
10408
|
-
const id =
|
|
10672
|
+
const id = useMemo24(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
|
|
10409
10673
|
src,
|
|
10410
10674
|
sequenceContext?.relativeFrom,
|
|
10411
10675
|
sequenceContext?.cumulatedFrom,
|
|
@@ -10464,7 +10728,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10464
10728
|
volume: userPreferredVolume,
|
|
10465
10729
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
10466
10730
|
});
|
|
10467
|
-
const effectToUse =
|
|
10731
|
+
const effectToUse = React19.useInsertionEffect ?? React19.useLayoutEffect;
|
|
10468
10732
|
effectToUse(() => {
|
|
10469
10733
|
return () => {
|
|
10470
10734
|
requestAnimationFrame(() => {
|
|
@@ -10475,9 +10739,9 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10475
10739
|
useImperativeHandle4(ref, () => {
|
|
10476
10740
|
return audioRef.current;
|
|
10477
10741
|
}, [audioRef]);
|
|
10478
|
-
const currentOnDurationCallback =
|
|
10742
|
+
const currentOnDurationCallback = useRef15(onDuration);
|
|
10479
10743
|
currentOnDurationCallback.current = onDuration;
|
|
10480
|
-
|
|
10744
|
+
useEffect12(() => {
|
|
10481
10745
|
const { current } = audioRef;
|
|
10482
10746
|
if (!current) {
|
|
10483
10747
|
return;
|
|
@@ -10497,7 +10761,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10497
10761
|
if (initialShouldPreMountAudioElements) {
|
|
10498
10762
|
return null;
|
|
10499
10763
|
}
|
|
10500
|
-
return /* @__PURE__ */
|
|
10764
|
+
return /* @__PURE__ */ jsx20("audio", {
|
|
10501
10765
|
ref: audioRef,
|
|
10502
10766
|
preload: "metadata",
|
|
10503
10767
|
crossOrigin: crossOriginValue,
|
|
@@ -10506,7 +10770,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10506
10770
|
};
|
|
10507
10771
|
var AudioForPreview = forwardRef4(AudioForDevelopmentForwardRefFunction);
|
|
10508
10772
|
var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
10509
|
-
const audioRef =
|
|
10773
|
+
const audioRef = useRef16(null);
|
|
10510
10774
|
const {
|
|
10511
10775
|
volume: volumeProp,
|
|
10512
10776
|
playbackRate,
|
|
@@ -10528,10 +10792,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10528
10792
|
const absoluteFrame = useTimelinePosition();
|
|
10529
10793
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
10530
10794
|
const frame = useCurrentFrame();
|
|
10531
|
-
const sequenceContext =
|
|
10532
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
10795
|
+
const sequenceContext = useContext27(SequenceContext);
|
|
10796
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext27(RenderAssetManager);
|
|
10533
10797
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
10534
|
-
const id =
|
|
10798
|
+
const id = useMemo25(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
10535
10799
|
props.src,
|
|
10536
10800
|
sequenceContext?.relativeFrom,
|
|
10537
10801
|
sequenceContext?.cumulatedFrom,
|
|
@@ -10546,7 +10810,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10546
10810
|
useImperativeHandle5(ref, () => {
|
|
10547
10811
|
return audioRef.current;
|
|
10548
10812
|
}, []);
|
|
10549
|
-
|
|
10813
|
+
useEffect13(() => {
|
|
10550
10814
|
if (!props.src) {
|
|
10551
10815
|
throw new Error("No src passed");
|
|
10552
10816
|
}
|
|
@@ -10630,7 +10894,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10630
10894
|
if (!needsToRenderAudioTag) {
|
|
10631
10895
|
return null;
|
|
10632
10896
|
}
|
|
10633
|
-
return /* @__PURE__ */
|
|
10897
|
+
return /* @__PURE__ */ jsx21("audio", {
|
|
10634
10898
|
ref: audioRef,
|
|
10635
10899
|
...nativeProps,
|
|
10636
10900
|
onError: onNativeError
|
|
@@ -10638,7 +10902,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10638
10902
|
};
|
|
10639
10903
|
var AudioForRendering = forwardRef5(AudioForRenderingRefForwardingFunction);
|
|
10640
10904
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
10641
|
-
const audioContext =
|
|
10905
|
+
const audioContext = useContext28(SharedAudioContext);
|
|
10642
10906
|
const {
|
|
10643
10907
|
startFrom,
|
|
10644
10908
|
endAt,
|
|
@@ -10657,7 +10921,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10657
10921
|
if (environment.isClientSideRendering) {
|
|
10658
10922
|
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");
|
|
10659
10923
|
}
|
|
10660
|
-
const { durations, setDurations } =
|
|
10924
|
+
const { durations, setDurations } = useContext28(DurationsContext);
|
|
10661
10925
|
if (typeof props.src !== "string") {
|
|
10662
10926
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
10663
10927
|
}
|
|
@@ -10689,14 +10953,14 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10689
10953
|
});
|
|
10690
10954
|
if (loop && durationFetched !== undefined) {
|
|
10691
10955
|
if (!Number.isFinite(durationFetched)) {
|
|
10692
|
-
return /* @__PURE__ */
|
|
10956
|
+
return /* @__PURE__ */ jsx222(Html5Audio, {
|
|
10693
10957
|
...propsOtherThanLoop,
|
|
10694
10958
|
ref,
|
|
10695
10959
|
_remotionInternalNativeLoopPassed: true
|
|
10696
10960
|
});
|
|
10697
10961
|
}
|
|
10698
10962
|
const duration = durationFetched * fps;
|
|
10699
|
-
return /* @__PURE__ */
|
|
10963
|
+
return /* @__PURE__ */ jsx222(Loop, {
|
|
10700
10964
|
layout: "none",
|
|
10701
10965
|
durationInFrames: calculateMediaDuration({
|
|
10702
10966
|
trimAfter: trimAfterValue,
|
|
@@ -10704,7 +10968,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10704
10968
|
playbackRate: props.playbackRate ?? 1,
|
|
10705
10969
|
trimBefore: trimBeforeValue
|
|
10706
10970
|
}),
|
|
10707
|
-
children: /* @__PURE__ */
|
|
10971
|
+
children: /* @__PURE__ */ jsx222(Html5Audio, {
|
|
10708
10972
|
...propsOtherThanLoop,
|
|
10709
10973
|
ref,
|
|
10710
10974
|
_remotionInternalNativeLoopPassed: true
|
|
@@ -10712,13 +10976,13 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10712
10976
|
});
|
|
10713
10977
|
}
|
|
10714
10978
|
if (typeof trimBeforeValue !== "undefined" || typeof trimAfterValue !== "undefined") {
|
|
10715
|
-
return /* @__PURE__ */
|
|
10979
|
+
return /* @__PURE__ */ jsx222(Sequence, {
|
|
10716
10980
|
layout: "none",
|
|
10717
10981
|
from: 0 - (trimBeforeValue ?? 0),
|
|
10718
10982
|
showInTimeline: false,
|
|
10719
10983
|
durationInFrames: trimAfterValue,
|
|
10720
10984
|
name,
|
|
10721
|
-
children: /* @__PURE__ */
|
|
10985
|
+
children: /* @__PURE__ */ jsx222(Html5Audio, {
|
|
10722
10986
|
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
10723
10987
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
10724
10988
|
...otherProps,
|
|
@@ -10728,7 +10992,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10728
10992
|
}
|
|
10729
10993
|
validateMediaProps({ playbackRate: props.playbackRate, volume: props.volume }, "Html5Audio");
|
|
10730
10994
|
if (environment.isRendering) {
|
|
10731
|
-
return /* @__PURE__ */
|
|
10995
|
+
return /* @__PURE__ */ jsx222(AudioForRendering, {
|
|
10732
10996
|
onDuration,
|
|
10733
10997
|
...props,
|
|
10734
10998
|
ref,
|
|
@@ -10736,321 +11000,243 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10736
11000
|
_remotionInternalNeedsDurationCalculation: Boolean(loop)
|
|
10737
11001
|
});
|
|
10738
11002
|
}
|
|
10739
|
-
return /* @__PURE__ */
|
|
11003
|
+
return /* @__PURE__ */ jsx222(AudioForPreview, {
|
|
10740
11004
|
_remotionInternalNativeLoopPassed: props._remotionInternalNativeLoopPassed ?? false,
|
|
10741
11005
|
_remotionInternalStack: stack ?? null,
|
|
10742
11006
|
shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0,
|
|
10743
11007
|
...props,
|
|
10744
11008
|
ref,
|
|
10745
|
-
onNativeError: onError,
|
|
10746
|
-
onDuration,
|
|
10747
|
-
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
10748
|
-
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
10749
|
-
showInTimeline: showInTimeline ?? true
|
|
10750
|
-
});
|
|
10751
|
-
};
|
|
10752
|
-
var Html5Audio = forwardRef6(AudioRefForwardingFunction);
|
|
10753
|
-
addSequenceStackTraces(Html5Audio);
|
|
10754
|
-
var Audio = Html5Audio;
|
|
10755
|
-
var getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
10756
|
-
var invalidFolderNameErrorMessage = `Folder name must match ${String(getRegex())}`;
|
|
10757
|
-
var FolderContext = createContext19({
|
|
10758
|
-
folderName: null,
|
|
10759
|
-
parentName: null
|
|
10760
|
-
});
|
|
10761
|
-
var rotate = {
|
|
10762
|
-
transform: `rotate(90deg)`
|
|
10763
|
-
};
|
|
10764
|
-
var ICON_SIZE = 40;
|
|
10765
|
-
var label = {
|
|
10766
|
-
color: "white",
|
|
10767
|
-
fontSize: 14,
|
|
10768
|
-
fontFamily: "sans-serif"
|
|
10769
|
-
};
|
|
10770
|
-
var container = {
|
|
10771
|
-
justifyContent: "center",
|
|
10772
|
-
alignItems: "center"
|
|
10773
|
-
};
|
|
10774
|
-
var Loading = () => {
|
|
10775
|
-
return /* @__PURE__ */ jsxs22(AbsoluteFill, {
|
|
10776
|
-
style: container,
|
|
10777
|
-
id: "remotion-comp-loading",
|
|
10778
|
-
children: [
|
|
10779
|
-
/* @__PURE__ */ jsx21("style", {
|
|
10780
|
-
type: "text/css",
|
|
10781
|
-
children: `
|
|
10782
|
-
@keyframes anim {
|
|
10783
|
-
from {
|
|
10784
|
-
opacity: 0
|
|
10785
|
-
}
|
|
10786
|
-
to {
|
|
10787
|
-
opacity: 1
|
|
10788
|
-
}
|
|
10789
|
-
}
|
|
10790
|
-
#remotion-comp-loading {
|
|
10791
|
-
animation: anim 2s;
|
|
10792
|
-
animation-fill-mode: forwards;
|
|
10793
|
-
}
|
|
10794
|
-
`
|
|
10795
|
-
}),
|
|
10796
|
-
/* @__PURE__ */ jsx21("svg", {
|
|
10797
|
-
width: ICON_SIZE,
|
|
10798
|
-
height: ICON_SIZE,
|
|
10799
|
-
viewBox: "-100 -100 400 400",
|
|
10800
|
-
style: rotate,
|
|
10801
|
-
children: /* @__PURE__ */ jsx21("path", {
|
|
10802
|
-
fill: "#555",
|
|
10803
|
-
stroke: "#555",
|
|
10804
|
-
strokeWidth: "100",
|
|
10805
|
-
strokeLinejoin: "round",
|
|
10806
|
-
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"
|
|
10807
|
-
})
|
|
10808
|
-
}),
|
|
10809
|
-
/* @__PURE__ */ jsxs22("p", {
|
|
10810
|
-
style: label,
|
|
10811
|
-
children: [
|
|
10812
|
-
"Resolving ",
|
|
10813
|
-
"<Suspense>",
|
|
10814
|
-
"..."
|
|
10815
|
-
]
|
|
10816
|
-
})
|
|
10817
|
-
]
|
|
11009
|
+
onNativeError: onError,
|
|
11010
|
+
onDuration,
|
|
11011
|
+
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
11012
|
+
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
11013
|
+
showInTimeline: showInTimeline ?? true
|
|
10818
11014
|
});
|
|
10819
11015
|
};
|
|
10820
|
-
var
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
11016
|
+
var Html5Audio = forwardRef6(AudioRefForwardingFunction);
|
|
11017
|
+
addSequenceStackTraces(Html5Audio);
|
|
11018
|
+
var Audio = Html5Audio;
|
|
11019
|
+
var kSplineTableSize = 11;
|
|
11020
|
+
var kSampleStepSize = 1 / (kSplineTableSize - 1);
|
|
11021
|
+
var IFrameRefForwarding = ({
|
|
11022
|
+
onLoad,
|
|
11023
|
+
onError,
|
|
11024
|
+
delayRenderRetries,
|
|
11025
|
+
delayRenderTimeoutInMilliseconds,
|
|
11026
|
+
...props2
|
|
11027
|
+
}, ref) => {
|
|
11028
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
11029
|
+
const [handle] = useState14(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
|
|
11030
|
+
retries: delayRenderRetries ?? undefined,
|
|
11031
|
+
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
11032
|
+
}));
|
|
11033
|
+
const didLoad = useCallback12((e) => {
|
|
11034
|
+
continueRender2(handle);
|
|
11035
|
+
onLoad?.(e);
|
|
11036
|
+
}, [handle, onLoad, continueRender2]);
|
|
11037
|
+
const didGetError = useCallback12((e) => {
|
|
11038
|
+
continueRender2(handle);
|
|
11039
|
+
if (onError) {
|
|
11040
|
+
onError(e);
|
|
11041
|
+
} else {
|
|
11042
|
+
console.error("Error loading iframe:", e, "Handle the event using the onError() prop to make this message disappear.");
|
|
10825
11043
|
}
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
_portalNode.style.display = "flex";
|
|
10835
|
-
_portalNode.style.flexDirection = "column";
|
|
10836
|
-
const containerNode = document.createElement("div");
|
|
10837
|
-
containerNode.style.position = "fixed";
|
|
10838
|
-
containerNode.style.top = -999999 + "px";
|
|
10839
|
-
containerNode.appendChild(_portalNode);
|
|
10840
|
-
document.body.appendChild(containerNode);
|
|
10841
|
-
}
|
|
10842
|
-
return _portalNode;
|
|
11044
|
+
}, [handle, onError, continueRender2]);
|
|
11045
|
+
return /* @__PURE__ */ jsx232("iframe", {
|
|
11046
|
+
referrerPolicy: "strict-origin-when-cross-origin",
|
|
11047
|
+
...props2,
|
|
11048
|
+
ref,
|
|
11049
|
+
onError: didGetError,
|
|
11050
|
+
onLoad: didLoad
|
|
11051
|
+
});
|
|
10843
11052
|
};
|
|
10844
|
-
var
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
11053
|
+
var IFrame = forwardRef7(IFrameRefForwarding);
|
|
11054
|
+
var getEffectiveVisualModeValue = ({
|
|
11055
|
+
codeValue,
|
|
11056
|
+
runtimeValue,
|
|
11057
|
+
dragOverrideValue,
|
|
11058
|
+
defaultValue,
|
|
11059
|
+
shouldResortToDefaultValueIfUndefined = false
|
|
10848
11060
|
}) => {
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
componentRef.current = compProps.component;
|
|
10852
|
-
}
|
|
10853
|
-
const lazy = useMemo25(() => {
|
|
10854
|
-
if ("component" in compProps) {
|
|
10855
|
-
if (typeof document === "undefined" || noSuspense) {
|
|
10856
|
-
return compProps.component;
|
|
10857
|
-
}
|
|
10858
|
-
if (typeof compProps.component === "undefined") {
|
|
10859
|
-
throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
10860
|
-
}
|
|
10861
|
-
const Wrapper = (props2) => {
|
|
10862
|
-
const Comp = componentRef.current;
|
|
10863
|
-
return React20.createElement(Comp, props2);
|
|
10864
|
-
};
|
|
10865
|
-
return Wrapper;
|
|
10866
|
-
}
|
|
10867
|
-
if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
|
|
10868
|
-
if (typeof compProps.lazyComponent === "undefined") {
|
|
10869
|
-
throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
10870
|
-
}
|
|
10871
|
-
return React20.lazy(compProps.lazyComponent);
|
|
10872
|
-
}
|
|
10873
|
-
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
10874
|
-
}, [compProps.lazyComponent]);
|
|
10875
|
-
return lazy;
|
|
10876
|
-
};
|
|
10877
|
-
var getRegex2 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
10878
|
-
var isCompositionIdValid = (id) => id.match(getRegex2());
|
|
10879
|
-
var validateCompositionId = (id) => {
|
|
10880
|
-
if (!isCompositionIdValid(id)) {
|
|
10881
|
-
throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`);
|
|
11061
|
+
if (dragOverrideValue !== undefined) {
|
|
11062
|
+
return dragOverrideValue;
|
|
10882
11063
|
}
|
|
10883
|
-
|
|
10884
|
-
|
|
10885
|
-
var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
10886
|
-
if (!defaultProps) {
|
|
10887
|
-
return;
|
|
11064
|
+
if (!codeValue) {
|
|
11065
|
+
return runtimeValue;
|
|
10888
11066
|
}
|
|
10889
|
-
if (
|
|
10890
|
-
|
|
11067
|
+
if (!codeValue.canUpdate) {
|
|
11068
|
+
return runtimeValue;
|
|
10891
11069
|
}
|
|
10892
|
-
if (
|
|
10893
|
-
|
|
11070
|
+
if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
|
|
11071
|
+
return defaultValue;
|
|
10894
11072
|
}
|
|
11073
|
+
return codeValue.codeValue;
|
|
10895
11074
|
};
|
|
10896
|
-
var
|
|
10897
|
-
const
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
};
|
|
10904
|
-
var InnerComposition = ({
|
|
10905
|
-
width,
|
|
10906
|
-
height,
|
|
10907
|
-
fps,
|
|
10908
|
-
durationInFrames,
|
|
10909
|
-
id,
|
|
10910
|
-
defaultProps,
|
|
10911
|
-
schema,
|
|
10912
|
-
...compProps
|
|
10913
|
-
}) => {
|
|
10914
|
-
const compManager = useContext28(CompositionSetters);
|
|
10915
|
-
const { registerComposition, unregisterComposition } = compManager;
|
|
10916
|
-
const video = useVideo();
|
|
10917
|
-
const lazy = useLazyComponent({
|
|
10918
|
-
compProps,
|
|
10919
|
-
componentName: "Composition",
|
|
10920
|
-
noSuspense: false
|
|
10921
|
-
});
|
|
10922
|
-
const nonce = useNonce();
|
|
10923
|
-
const isPlayer = useIsPlayer();
|
|
10924
|
-
const environment = useRemotionEnvironment();
|
|
10925
|
-
const canUseComposition = useContext28(CanUseRemotionHooks);
|
|
10926
|
-
if (typeof window !== "undefined") {
|
|
10927
|
-
window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
|
|
10928
|
-
}
|
|
10929
|
-
if (canUseComposition) {
|
|
10930
|
-
if (isPlayer) {
|
|
10931
|
-
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.");
|
|
11075
|
+
var useSchema = (schema, currentValue) => {
|
|
11076
|
+
const env = useRemotionEnvironment();
|
|
11077
|
+
const earlyReturn = useMemo26(() => {
|
|
11078
|
+
if (!env.isStudio || env.isReadOnlyStudio) {
|
|
11079
|
+
return {
|
|
11080
|
+
controls: undefined,
|
|
11081
|
+
values: currentValue ?? {}
|
|
11082
|
+
};
|
|
10932
11083
|
}
|
|
10933
|
-
|
|
11084
|
+
return;
|
|
11085
|
+
}, [env.isStudio, env.isReadOnlyStudio, currentValue]);
|
|
11086
|
+
if (earlyReturn) {
|
|
11087
|
+
return earlyReturn;
|
|
10934
11088
|
}
|
|
10935
|
-
const
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
11089
|
+
const [overrideId] = useState15(() => String(Math.random()));
|
|
11090
|
+
const {
|
|
11091
|
+
visualModeEnabled,
|
|
11092
|
+
dragOverrides: overrides,
|
|
11093
|
+
codeValues
|
|
11094
|
+
} = useContext29(VisualModeOverridesContext);
|
|
11095
|
+
const controls = useMemo26(() => {
|
|
11096
|
+
if (!visualModeEnabled) {
|
|
11097
|
+
return;
|
|
10939
11098
|
}
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
id,
|
|
10948
|
-
folderName,
|
|
10949
|
-
component: lazy,
|
|
10950
|
-
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
10951
|
-
nonce: nonce.get(),
|
|
10952
|
-
parentFolderName: parentName,
|
|
10953
|
-
schema: schema ?? null,
|
|
10954
|
-
calculateMetadata: compProps.calculateMetadata ?? null
|
|
10955
|
-
});
|
|
10956
|
-
return () => {
|
|
10957
|
-
unregisterComposition(id);
|
|
11099
|
+
if (schema === null || currentValue === null) {
|
|
11100
|
+
return;
|
|
11101
|
+
}
|
|
11102
|
+
return {
|
|
11103
|
+
schema,
|
|
11104
|
+
currentValue,
|
|
11105
|
+
overrideId
|
|
10958
11106
|
};
|
|
10959
|
-
}, [
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
defaultProps,
|
|
10967
|
-
width,
|
|
10968
|
-
nonce,
|
|
10969
|
-
parentName,
|
|
10970
|
-
schema,
|
|
10971
|
-
compProps.calculateMetadata,
|
|
10972
|
-
registerComposition,
|
|
10973
|
-
unregisterComposition
|
|
10974
|
-
]);
|
|
10975
|
-
const resolved = useResolvedVideoConfig(id);
|
|
10976
|
-
if (environment.isStudio && video && video.component === lazy && video.id === id) {
|
|
10977
|
-
const Comp = lazy;
|
|
10978
|
-
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
10979
|
-
return null;
|
|
11107
|
+
}, [schema, currentValue, overrideId, visualModeEnabled]);
|
|
11108
|
+
return useMemo26(() => {
|
|
11109
|
+
if (controls === undefined || currentValue === null || schema === null || !visualModeEnabled) {
|
|
11110
|
+
return {
|
|
11111
|
+
controls: undefined,
|
|
11112
|
+
values: currentValue ?? {}
|
|
11113
|
+
};
|
|
10980
11114
|
}
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
11115
|
+
const overrideValues = overrides[overrideId] ?? {};
|
|
11116
|
+
const propStatus = codeValues[overrideId];
|
|
11117
|
+
const currentValueKeys = Object.keys(currentValue);
|
|
11118
|
+
const keysToUpdate = [...new Set(currentValueKeys)];
|
|
11119
|
+
const merged = {};
|
|
11120
|
+
for (const key of keysToUpdate) {
|
|
11121
|
+
const codeValueStatus = propStatus?.[key] ?? null;
|
|
11122
|
+
merged[key] = getEffectiveVisualModeValue({
|
|
11123
|
+
codeValue: codeValueStatus,
|
|
11124
|
+
runtimeValue: currentValue[key],
|
|
11125
|
+
dragOverrideValue: overrideValues[key],
|
|
11126
|
+
defaultValue: schema[key]?.default,
|
|
11127
|
+
shouldResortToDefaultValueIfUndefined: false
|
|
11128
|
+
});
|
|
10994
11129
|
}
|
|
10995
|
-
return
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11130
|
+
return {
|
|
11131
|
+
controls,
|
|
11132
|
+
values: merged
|
|
11133
|
+
};
|
|
11134
|
+
}, [
|
|
11135
|
+
controls,
|
|
11136
|
+
currentValue,
|
|
11137
|
+
overrideId,
|
|
11138
|
+
overrides,
|
|
11139
|
+
codeValues,
|
|
11140
|
+
schema,
|
|
11141
|
+
visualModeEnabled
|
|
11142
|
+
]);
|
|
11143
|
+
};
|
|
11144
|
+
var getNestedValue = (obj, key) => {
|
|
11145
|
+
const parts = key.split(".");
|
|
11146
|
+
let current = obj;
|
|
11147
|
+
for (const part of parts) {
|
|
11148
|
+
if (current === null || current === undefined || typeof current !== "object")
|
|
11149
|
+
return;
|
|
11150
|
+
current = current[part];
|
|
11003
11151
|
}
|
|
11004
|
-
return
|
|
11152
|
+
return current;
|
|
11005
11153
|
};
|
|
11006
|
-
var
|
|
11007
|
-
const {
|
|
11008
|
-
|
|
11009
|
-
|
|
11154
|
+
var mergeValues = (props2, values, schemaKeys) => {
|
|
11155
|
+
const merged = { ...props2 };
|
|
11156
|
+
for (const key of schemaKeys) {
|
|
11157
|
+
const value = values[key];
|
|
11158
|
+
const parts = key.split(".");
|
|
11159
|
+
if (parts.length === 1) {
|
|
11160
|
+
merged[key] = value;
|
|
11161
|
+
continue;
|
|
11162
|
+
}
|
|
11163
|
+
let current = merged;
|
|
11164
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
11165
|
+
const part = parts[i];
|
|
11166
|
+
if (typeof current[part] === "object" && current[part] !== null) {
|
|
11167
|
+
current[part] = { ...current[part] };
|
|
11168
|
+
} else {
|
|
11169
|
+
current[part] = {};
|
|
11170
|
+
}
|
|
11171
|
+
current = current[part];
|
|
11172
|
+
}
|
|
11173
|
+
current[parts[parts.length - 1]] = value;
|
|
11010
11174
|
}
|
|
11011
|
-
return
|
|
11012
|
-
...props2
|
|
11013
|
-
});
|
|
11175
|
+
return merged;
|
|
11014
11176
|
};
|
|
11015
|
-
var
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
const [handle] = useState14(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
|
|
11026
|
-
retries: delayRenderRetries ?? undefined,
|
|
11027
|
-
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
11028
|
-
}));
|
|
11029
|
-
const didLoad = useCallback12((e) => {
|
|
11030
|
-
continueRender2(handle);
|
|
11031
|
-
onLoad?.(e);
|
|
11032
|
-
}, [handle, onLoad, continueRender2]);
|
|
11033
|
-
const didGetError = useCallback12((e) => {
|
|
11034
|
-
continueRender2(handle);
|
|
11035
|
-
if (onError) {
|
|
11036
|
-
onError(e);
|
|
11037
|
-
} else {
|
|
11038
|
-
console.error("Error loading iframe:", e, "Handle the event using the onError() prop to make this message disappear.");
|
|
11177
|
+
var wrapInSchema = (Component, schema) => {
|
|
11178
|
+
const schemaKeys = Object.keys(schema);
|
|
11179
|
+
const Wrapped = forwardRef8((props2, ref) => {
|
|
11180
|
+
const env = useRemotionEnvironment();
|
|
11181
|
+
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
11182
|
+
return React23.createElement(Component, {
|
|
11183
|
+
...props2,
|
|
11184
|
+
controls: null,
|
|
11185
|
+
ref
|
|
11186
|
+
});
|
|
11039
11187
|
}
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
|
|
11188
|
+
const schemaInput = useMemo27(() => {
|
|
11189
|
+
const input = {};
|
|
11190
|
+
for (const key of schemaKeys) {
|
|
11191
|
+
input[key] = getNestedValue(props2, key);
|
|
11192
|
+
}
|
|
11193
|
+
return input;
|
|
11194
|
+
}, schemaKeys.map((key) => getNestedValue(props2, key)));
|
|
11195
|
+
const { controls, values } = useSchema(schema, schemaInput);
|
|
11196
|
+
const mergedProps = mergeValues(props2, values, schemaKeys);
|
|
11197
|
+
return React23.createElement(Component, {
|
|
11198
|
+
...mergedProps,
|
|
11199
|
+
controls,
|
|
11200
|
+
ref
|
|
11201
|
+
});
|
|
11047
11202
|
});
|
|
11203
|
+
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
11204
|
+
return Wrapped;
|
|
11048
11205
|
};
|
|
11049
|
-
var IFrame = forwardRef7(IFrameRefForwarding);
|
|
11050
11206
|
function exponentialBackoff(errorCount) {
|
|
11051
11207
|
return 1000 * 2 ** (errorCount - 1);
|
|
11052
11208
|
}
|
|
11053
|
-
var
|
|
11209
|
+
var imgSchema = {
|
|
11210
|
+
"style.translate": {
|
|
11211
|
+
type: "translate",
|
|
11212
|
+
step: 1,
|
|
11213
|
+
default: "0px 0px",
|
|
11214
|
+
description: "Position"
|
|
11215
|
+
},
|
|
11216
|
+
"style.scale": {
|
|
11217
|
+
type: "number",
|
|
11218
|
+
min: 0.05,
|
|
11219
|
+
max: 100,
|
|
11220
|
+
step: 0.01,
|
|
11221
|
+
default: 1,
|
|
11222
|
+
description: "Scale"
|
|
11223
|
+
},
|
|
11224
|
+
"style.rotate": {
|
|
11225
|
+
type: "rotation",
|
|
11226
|
+
step: 1,
|
|
11227
|
+
default: "0deg",
|
|
11228
|
+
description: "Rotation"
|
|
11229
|
+
},
|
|
11230
|
+
"style.opacity": {
|
|
11231
|
+
type: "number",
|
|
11232
|
+
min: 0,
|
|
11233
|
+
max: 1,
|
|
11234
|
+
step: 0.01,
|
|
11235
|
+
default: 1,
|
|
11236
|
+
description: "Opacity"
|
|
11237
|
+
}
|
|
11238
|
+
};
|
|
11239
|
+
var ImgInner = ({
|
|
11054
11240
|
onError,
|
|
11055
11241
|
maxRetries = 2,
|
|
11056
11242
|
src,
|
|
@@ -11062,13 +11248,15 @@ var ImgRefForwarding = ({
|
|
|
11062
11248
|
showInTimeline,
|
|
11063
11249
|
name,
|
|
11064
11250
|
stack,
|
|
11251
|
+
ref,
|
|
11252
|
+
controls,
|
|
11065
11253
|
...props2
|
|
11066
|
-
}
|
|
11254
|
+
}) => {
|
|
11067
11255
|
const imageRef = useRef17(null);
|
|
11068
11256
|
const errors = useRef17({});
|
|
11069
11257
|
const { delayPlayback } = useBufferState();
|
|
11070
|
-
const sequenceContext =
|
|
11071
|
-
const [timelineId] =
|
|
11258
|
+
const sequenceContext = useContext30(SequenceContext);
|
|
11259
|
+
const [timelineId] = useState16(() => String(Math.random()));
|
|
11072
11260
|
if (!src) {
|
|
11073
11261
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
11074
11262
|
}
|
|
@@ -11087,7 +11275,8 @@ var ImgRefForwarding = ({
|
|
|
11087
11275
|
showInTimeline: showInTimeline ?? true,
|
|
11088
11276
|
premountDisplay: sequenceContext?.premountDisplay ?? null,
|
|
11089
11277
|
postmountDisplay: sequenceContext?.postmountDisplay ?? null,
|
|
11090
|
-
loopDisplay: undefined
|
|
11278
|
+
loopDisplay: undefined,
|
|
11279
|
+
controls: controls ?? null
|
|
11091
11280
|
});
|
|
11092
11281
|
const actualSrc = usePreload(src);
|
|
11093
11282
|
const retryIn = useCallback13((timeout) => {
|
|
@@ -11210,9 +11399,9 @@ var ImgRefForwarding = ({
|
|
|
11210
11399
|
decoding: "sync"
|
|
11211
11400
|
});
|
|
11212
11401
|
};
|
|
11213
|
-
var Img =
|
|
11402
|
+
var Img = wrapInSchema(ImgInner, imgSchema);
|
|
11214
11403
|
addSequenceStackTraces(Img);
|
|
11215
|
-
var compositionsRef =
|
|
11404
|
+
var compositionsRef = React25.createRef();
|
|
11216
11405
|
var CompositionManagerProvider = ({
|
|
11217
11406
|
children,
|
|
11218
11407
|
onlyRenderComposition,
|
|
@@ -11220,9 +11409,9 @@ var CompositionManagerProvider = ({
|
|
|
11220
11409
|
initialCompositions,
|
|
11221
11410
|
initialCanvasContent
|
|
11222
11411
|
}) => {
|
|
11223
|
-
const [folders, setFolders] =
|
|
11224
|
-
const [canvasContent, setCanvasContent] =
|
|
11225
|
-
const [compositions, setCompositions] =
|
|
11412
|
+
const [folders, setFolders] = useState17([]);
|
|
11413
|
+
const [canvasContent, setCanvasContent] = useState17(initialCanvasContent);
|
|
11414
|
+
const [compositions, setCompositions] = useState17(initialCompositions);
|
|
11226
11415
|
const currentcompositionsRef = useRef18(compositions);
|
|
11227
11416
|
const updateCompositions = useCallback14((updateComps) => {
|
|
11228
11417
|
setCompositions((comps) => {
|
|
@@ -11266,7 +11455,7 @@ var CompositionManagerProvider = ({
|
|
|
11266
11455
|
getCompositions: () => currentcompositionsRef.current
|
|
11267
11456
|
};
|
|
11268
11457
|
}, []);
|
|
11269
|
-
const compositionManagerSetters =
|
|
11458
|
+
const compositionManagerSetters = useMemo28(() => {
|
|
11270
11459
|
return {
|
|
11271
11460
|
registerComposition,
|
|
11272
11461
|
unregisterComposition,
|
|
@@ -11282,7 +11471,7 @@ var CompositionManagerProvider = ({
|
|
|
11282
11471
|
unregisterFolder,
|
|
11283
11472
|
onlyRenderComposition
|
|
11284
11473
|
]);
|
|
11285
|
-
const compositionManagerContextValue =
|
|
11474
|
+
const compositionManagerContextValue = useMemo28(() => {
|
|
11286
11475
|
return {
|
|
11287
11476
|
compositions,
|
|
11288
11477
|
folders,
|
|
@@ -11356,32 +11545,11 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
11356
11545
|
}
|
|
11357
11546
|
`;
|
|
11358
11547
|
};
|
|
11359
|
-
var getEffectiveVisualModeValue = ({
|
|
11360
|
-
codeValue,
|
|
11361
|
-
runtimeValue,
|
|
11362
|
-
dragOverrideValue,
|
|
11363
|
-
defaultValue,
|
|
11364
|
-
shouldResortToDefaultValueIfUndefined = false
|
|
11365
|
-
}) => {
|
|
11366
|
-
if (dragOverrideValue !== undefined) {
|
|
11367
|
-
return dragOverrideValue;
|
|
11368
|
-
}
|
|
11369
|
-
if (!codeValue) {
|
|
11370
|
-
return runtimeValue;
|
|
11371
|
-
}
|
|
11372
|
-
if (!codeValue.canUpdate) {
|
|
11373
|
-
return runtimeValue;
|
|
11374
|
-
}
|
|
11375
|
-
if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
|
|
11376
|
-
return defaultValue;
|
|
11377
|
-
}
|
|
11378
|
-
return codeValue.codeValue;
|
|
11379
|
-
};
|
|
11380
11548
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
11381
11549
|
var getPreviewDomElement = () => {
|
|
11382
11550
|
return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
|
|
11383
11551
|
};
|
|
11384
|
-
var MaxMediaCacheSizeContext =
|
|
11552
|
+
var MaxMediaCacheSizeContext = React26.createContext(null);
|
|
11385
11553
|
var Root = null;
|
|
11386
11554
|
var listeners = [];
|
|
11387
11555
|
var getRoot = () => {
|
|
@@ -11401,7 +11569,7 @@ var waitForRoot = (fn) => {
|
|
|
11401
11569
|
};
|
|
11402
11570
|
var MediaEnabledContext = createContext20(null);
|
|
11403
11571
|
var useVideoEnabled = () => {
|
|
11404
|
-
const context =
|
|
11572
|
+
const context = useContext31(MediaEnabledContext);
|
|
11405
11573
|
if (!context) {
|
|
11406
11574
|
return window.remotion_videoEnabled;
|
|
11407
11575
|
}
|
|
@@ -11411,7 +11579,7 @@ var useVideoEnabled = () => {
|
|
|
11411
11579
|
return context.videoEnabled;
|
|
11412
11580
|
};
|
|
11413
11581
|
var useAudioEnabled = () => {
|
|
11414
|
-
const context =
|
|
11582
|
+
const context = useContext31(MediaEnabledContext);
|
|
11415
11583
|
if (!context) {
|
|
11416
11584
|
return window.remotion_audioEnabled;
|
|
11417
11585
|
}
|
|
@@ -11425,7 +11593,7 @@ var MediaEnabledProvider = ({
|
|
|
11425
11593
|
videoEnabled,
|
|
11426
11594
|
audioEnabled
|
|
11427
11595
|
}) => {
|
|
11428
|
-
const value =
|
|
11596
|
+
const value = useMemo29(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
11429
11597
|
return /* @__PURE__ */ jsx26(MediaEnabledContext.Provider, {
|
|
11430
11598
|
value,
|
|
11431
11599
|
children
|
|
@@ -11441,13 +11609,13 @@ var RemotionRootContexts = ({
|
|
|
11441
11609
|
frameState,
|
|
11442
11610
|
visualModeEnabled
|
|
11443
11611
|
}) => {
|
|
11444
|
-
const nonceContext =
|
|
11612
|
+
const nonceContext = useMemo30(() => {
|
|
11445
11613
|
let counter = 0;
|
|
11446
11614
|
return {
|
|
11447
11615
|
getNonce: () => counter++
|
|
11448
11616
|
};
|
|
11449
11617
|
}, []);
|
|
11450
|
-
const logging =
|
|
11618
|
+
const logging = useMemo30(() => {
|
|
11451
11619
|
return { logLevel, mountTime: Date.now() };
|
|
11452
11620
|
}, [logLevel]);
|
|
11453
11621
|
return /* @__PURE__ */ jsx27(LogLevelContext.Provider, {
|
|
@@ -11646,7 +11814,7 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
11646
11814
|
};
|
|
11647
11815
|
}
|
|
11648
11816
|
};
|
|
11649
|
-
var SequenceStackTracesUpdateContext =
|
|
11817
|
+
var SequenceStackTracesUpdateContext = React28.createContext(() => {});
|
|
11650
11818
|
var getEnvVariables = () => {
|
|
11651
11819
|
if (getRemotionEnvironment().isRendering) {
|
|
11652
11820
|
const param = window.remotion_envVariables;
|
|
@@ -11672,7 +11840,7 @@ var setupEnvVariables = () => {
|
|
|
11672
11840
|
window.process.env[key] = env[key];
|
|
11673
11841
|
});
|
|
11674
11842
|
};
|
|
11675
|
-
var CurrentScaleContext =
|
|
11843
|
+
var CurrentScaleContext = React29.createContext(null);
|
|
11676
11844
|
var PreviewSizeContext = createContext21({
|
|
11677
11845
|
setSize: () => {
|
|
11678
11846
|
return;
|
|
@@ -11696,75 +11864,6 @@ var calculateScale = ({
|
|
|
11696
11864
|
}
|
|
11697
11865
|
return Number(previewSize);
|
|
11698
11866
|
};
|
|
11699
|
-
var useSchema = (schema, currentValue) => {
|
|
11700
|
-
const env = useRemotionEnvironment();
|
|
11701
|
-
const earlyReturn = useMemo29(() => {
|
|
11702
|
-
if (!env.isStudio || env.isReadOnlyStudio) {
|
|
11703
|
-
return {
|
|
11704
|
-
controls: undefined,
|
|
11705
|
-
values: currentValue ?? {}
|
|
11706
|
-
};
|
|
11707
|
-
}
|
|
11708
|
-
return;
|
|
11709
|
-
}, [env.isStudio, env.isReadOnlyStudio, currentValue]);
|
|
11710
|
-
if (earlyReturn) {
|
|
11711
|
-
return earlyReturn;
|
|
11712
|
-
}
|
|
11713
|
-
const [overrideId] = useState17(() => String(Math.random()));
|
|
11714
|
-
const {
|
|
11715
|
-
visualModeEnabled,
|
|
11716
|
-
dragOverrides: overrides,
|
|
11717
|
-
codeValues
|
|
11718
|
-
} = useContext31(VisualModeOverridesContext);
|
|
11719
|
-
const controls = useMemo29(() => {
|
|
11720
|
-
if (!visualModeEnabled) {
|
|
11721
|
-
return;
|
|
11722
|
-
}
|
|
11723
|
-
if (schema === null || currentValue === null) {
|
|
11724
|
-
return;
|
|
11725
|
-
}
|
|
11726
|
-
return {
|
|
11727
|
-
schema,
|
|
11728
|
-
currentValue,
|
|
11729
|
-
overrideId
|
|
11730
|
-
};
|
|
11731
|
-
}, [schema, currentValue, overrideId, visualModeEnabled]);
|
|
11732
|
-
return useMemo29(() => {
|
|
11733
|
-
if (controls === undefined || currentValue === null || schema === null || !visualModeEnabled) {
|
|
11734
|
-
return {
|
|
11735
|
-
controls: undefined,
|
|
11736
|
-
values: currentValue ?? {}
|
|
11737
|
-
};
|
|
11738
|
-
}
|
|
11739
|
-
const overrideValues = overrides[overrideId] ?? {};
|
|
11740
|
-
const propStatus = codeValues[overrideId];
|
|
11741
|
-
const currentValueKeys = Object.keys(currentValue);
|
|
11742
|
-
const keysToUpdate = [...new Set(currentValueKeys)];
|
|
11743
|
-
const merged = {};
|
|
11744
|
-
for (const key of keysToUpdate) {
|
|
11745
|
-
const codeValueStatus = propStatus?.[key] ?? null;
|
|
11746
|
-
merged[key] = getEffectiveVisualModeValue({
|
|
11747
|
-
codeValue: codeValueStatus,
|
|
11748
|
-
runtimeValue: currentValue[key],
|
|
11749
|
-
dragOverrideValue: overrideValues[key],
|
|
11750
|
-
defaultValue: schema[key]?.default,
|
|
11751
|
-
shouldResortToDefaultValueIfUndefined: false
|
|
11752
|
-
});
|
|
11753
|
-
}
|
|
11754
|
-
return {
|
|
11755
|
-
controls,
|
|
11756
|
-
values: merged
|
|
11757
|
-
};
|
|
11758
|
-
}, [
|
|
11759
|
-
controls,
|
|
11760
|
-
currentValue,
|
|
11761
|
-
overrideId,
|
|
11762
|
-
overrides,
|
|
11763
|
-
codeValues,
|
|
11764
|
-
schema,
|
|
11765
|
-
visualModeEnabled
|
|
11766
|
-
]);
|
|
11767
|
-
};
|
|
11768
11867
|
var useSequenceControlOverride = (key) => {
|
|
11769
11868
|
const seqContext = useContext32(SequenceContext);
|
|
11770
11869
|
const { dragOverrides: overrides } = useContext32(VisualModeOverridesContext);
|
|
@@ -11810,7 +11909,7 @@ var OffthreadVideoForRendering = ({
|
|
|
11810
11909
|
if (!src) {
|
|
11811
11910
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
11812
11911
|
}
|
|
11813
|
-
const id =
|
|
11912
|
+
const id = useMemo31(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
11814
11913
|
src,
|
|
11815
11914
|
sequenceContext?.cumulatedFrom,
|
|
11816
11915
|
sequenceContext?.relativeFrom,
|
|
@@ -11865,14 +11964,14 @@ var OffthreadVideoForRendering = ({
|
|
|
11865
11964
|
sequenceContext?.relativeFrom,
|
|
11866
11965
|
audioStreamIndex
|
|
11867
11966
|
]);
|
|
11868
|
-
const currentTime =
|
|
11967
|
+
const currentTime = useMemo31(() => {
|
|
11869
11968
|
return getExpectedMediaFrameUncorrected({
|
|
11870
11969
|
frame,
|
|
11871
11970
|
playbackRate: playbackRate || 1,
|
|
11872
11971
|
startFrom: -mediaStartsAt
|
|
11873
11972
|
}) / videoConfig.fps;
|
|
11874
11973
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
11875
|
-
const actualSrc =
|
|
11974
|
+
const actualSrc = useMemo31(() => {
|
|
11876
11975
|
return getOffthreadVideoSource({
|
|
11877
11976
|
src,
|
|
11878
11977
|
currentTime,
|
|
@@ -11960,7 +12059,7 @@ var OffthreadVideoForRendering = ({
|
|
|
11960
12059
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
11961
12060
|
}
|
|
11962
12061
|
}, [imageSrc, onError]);
|
|
11963
|
-
const className =
|
|
12062
|
+
const className = useMemo31(() => {
|
|
11964
12063
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy2).join(" ");
|
|
11965
12064
|
}, [props2.className]);
|
|
11966
12065
|
const onImageFrame = useCallback15((img) => {
|
|
@@ -12014,7 +12113,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
12014
12113
|
throw new Error("SharedAudioContext not found");
|
|
12015
12114
|
}
|
|
12016
12115
|
const videoRef = useRef19(null);
|
|
12017
|
-
const sharedSource =
|
|
12116
|
+
const sharedSource = useMemo322(() => {
|
|
12018
12117
|
if (!context.audioContext) {
|
|
12019
12118
|
return null;
|
|
12020
12119
|
}
|
|
@@ -12023,7 +12122,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
12023
12122
|
ref: videoRef
|
|
12024
12123
|
});
|
|
12025
12124
|
}, [context.audioContext]);
|
|
12026
|
-
const effectToUse =
|
|
12125
|
+
const effectToUse = React31.useInsertionEffect ?? React31.useLayoutEffect;
|
|
12027
12126
|
effectToUse(() => {
|
|
12028
12127
|
return () => {
|
|
12029
12128
|
requestAnimationFrame(() => {
|
|
@@ -12200,7 +12299,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
12200
12299
|
current.preload = "auto";
|
|
12201
12300
|
}
|
|
12202
12301
|
}, []);
|
|
12203
|
-
const actualStyle =
|
|
12302
|
+
const actualStyle = useMemo322(() => {
|
|
12204
12303
|
return {
|
|
12205
12304
|
...style,
|
|
12206
12305
|
opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
|
|
@@ -12381,68 +12480,6 @@ var OffthreadVideo = ({
|
|
|
12381
12480
|
};
|
|
12382
12481
|
addSequenceStackTraces(OffthreadVideo);
|
|
12383
12482
|
var WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged";
|
|
12384
|
-
var getNestedValue = (obj, key) => {
|
|
12385
|
-
const parts = key.split(".");
|
|
12386
|
-
let current = obj;
|
|
12387
|
-
for (const part of parts) {
|
|
12388
|
-
if (current === null || current === undefined || typeof current !== "object")
|
|
12389
|
-
return;
|
|
12390
|
-
current = current[part];
|
|
12391
|
-
}
|
|
12392
|
-
return current;
|
|
12393
|
-
};
|
|
12394
|
-
var mergeValues = (props2, values, schemaKeys) => {
|
|
12395
|
-
const merged = { ...props2 };
|
|
12396
|
-
for (const key of schemaKeys) {
|
|
12397
|
-
const value = values[key];
|
|
12398
|
-
const parts = key.split(".");
|
|
12399
|
-
if (parts.length === 1) {
|
|
12400
|
-
merged[key] = value;
|
|
12401
|
-
continue;
|
|
12402
|
-
}
|
|
12403
|
-
let current = merged;
|
|
12404
|
-
for (let i = 0;i < parts.length - 1; i++) {
|
|
12405
|
-
const part = parts[i];
|
|
12406
|
-
if (typeof current[part] === "object" && current[part] !== null) {
|
|
12407
|
-
current[part] = { ...current[part] };
|
|
12408
|
-
} else {
|
|
12409
|
-
current[part] = {};
|
|
12410
|
-
}
|
|
12411
|
-
current = current[part];
|
|
12412
|
-
}
|
|
12413
|
-
current[parts[parts.length - 1]] = value;
|
|
12414
|
-
}
|
|
12415
|
-
return merged;
|
|
12416
|
-
};
|
|
12417
|
-
var wrapInSchema = (Component, schema) => {
|
|
12418
|
-
const schemaKeys = Object.keys(schema);
|
|
12419
|
-
const Wrapped = forwardRef10((props2, ref) => {
|
|
12420
|
-
const env = useRemotionEnvironment();
|
|
12421
|
-
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
12422
|
-
return React32.createElement(Component, {
|
|
12423
|
-
...props2,
|
|
12424
|
-
controls: null,
|
|
12425
|
-
ref
|
|
12426
|
-
});
|
|
12427
|
-
}
|
|
12428
|
-
const schemaInput = useMemo32(() => {
|
|
12429
|
-
const input = {};
|
|
12430
|
-
for (const key of schemaKeys) {
|
|
12431
|
-
input[key] = getNestedValue(props2, key);
|
|
12432
|
-
}
|
|
12433
|
-
return input;
|
|
12434
|
-
}, schemaKeys.map((key) => getNestedValue(props2, key)));
|
|
12435
|
-
const { controls, values } = useSchema(schema, schemaInput);
|
|
12436
|
-
const mergedProps = mergeValues(props2, values, schemaKeys);
|
|
12437
|
-
return React32.createElement(Component, {
|
|
12438
|
-
...mergedProps,
|
|
12439
|
-
controls,
|
|
12440
|
-
ref
|
|
12441
|
-
});
|
|
12442
|
-
});
|
|
12443
|
-
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
12444
|
-
return Wrapped;
|
|
12445
|
-
};
|
|
12446
12483
|
function useRemotionContexts() {
|
|
12447
12484
|
const compositionManagerCtx = React33.useContext(CompositionManager);
|
|
12448
12485
|
const timelineContext = React33.useContext(TimelineContext);
|
|
@@ -12691,7 +12728,7 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
|
12691
12728
|
children
|
|
12692
12729
|
});
|
|
12693
12730
|
};
|
|
12694
|
-
var SeriesSequence =
|
|
12731
|
+
var SeriesSequence = forwardRef10(SeriesSequenceRefForwardingFunction);
|
|
12695
12732
|
var Series = (props2) => {
|
|
12696
12733
|
const childrenValue = useMemo34(() => {
|
|
12697
12734
|
let startFrame = 0;
|
|
@@ -12747,19 +12784,17 @@ var Series = (props2) => {
|
|
|
12747
12784
|
});
|
|
12748
12785
|
});
|
|
12749
12786
|
}, [props2.children]);
|
|
12750
|
-
if (ENABLE_V5_BREAKING_CHANGES) {
|
|
12751
|
-
return /* @__PURE__ */ jsx332(IsInsideSeriesContainer, {
|
|
12752
|
-
children: /* @__PURE__ */ jsx332(Sequence, {
|
|
12753
|
-
...props2,
|
|
12754
|
-
children: childrenValue
|
|
12755
|
-
})
|
|
12756
|
-
});
|
|
12757
|
-
}
|
|
12758
12787
|
return /* @__PURE__ */ jsx332(IsInsideSeriesContainer, {
|
|
12759
|
-
children:
|
|
12788
|
+
children: /* @__PURE__ */ jsx332(Sequence, {
|
|
12789
|
+
layout: "none",
|
|
12790
|
+
name: "<Series>",
|
|
12791
|
+
...props2,
|
|
12792
|
+
children: childrenValue
|
|
12793
|
+
})
|
|
12760
12794
|
});
|
|
12761
12795
|
};
|
|
12762
12796
|
Series.Sequence = SeriesSequence;
|
|
12797
|
+
addSequenceStackTraces(Series);
|
|
12763
12798
|
addSequenceStackTraces(SeriesSequence);
|
|
12764
12799
|
var validateSpringDuration = (dur) => {
|
|
12765
12800
|
if (typeof dur === "undefined") {
|
|
@@ -13415,7 +13450,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
13415
13450
|
...props2
|
|
13416
13451
|
});
|
|
13417
13452
|
};
|
|
13418
|
-
var VideoForRendering =
|
|
13453
|
+
var VideoForRendering = forwardRef11(VideoForRenderingForwardFunction);
|
|
13419
13454
|
var VideoForwardingFunction = (props2, ref) => {
|
|
13420
13455
|
const {
|
|
13421
13456
|
startFrom,
|
|
@@ -13520,7 +13555,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
13520
13555
|
onAutoPlayError: onAutoPlayError ?? undefined
|
|
13521
13556
|
});
|
|
13522
13557
|
};
|
|
13523
|
-
var Html5Video =
|
|
13558
|
+
var Html5Video = forwardRef12(VideoForwardingFunction);
|
|
13524
13559
|
addSequenceStackTraces(Html5Video);
|
|
13525
13560
|
checkMultipleRemotionVersions();
|
|
13526
13561
|
var proxyObj = {};
|
|
@@ -13545,6 +13580,7 @@ var Config = new Proxy(proxyObj, {
|
|
|
13545
13580
|
});
|
|
13546
13581
|
Sequence.displayName = "Sequence";
|
|
13547
13582
|
addSequenceStackTraces(Sequence);
|
|
13583
|
+
addSequenceStackTraces(Composition);
|
|
13548
13584
|
|
|
13549
13585
|
// ../design/dist/esm/index.mjs
|
|
13550
13586
|
import { jsx as jsx36, Fragment } from "react/jsx-runtime";
|
|
@@ -13564,49 +13600,49 @@ import { jsx as jsx113 } from "react/jsx-runtime";
|
|
|
13564
13600
|
import * as React342 from "react";
|
|
13565
13601
|
import * as ReactDOM4 from "react-dom";
|
|
13566
13602
|
import React9 from "react";
|
|
13567
|
-
import * as
|
|
13603
|
+
import * as React62 from "react";
|
|
13568
13604
|
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
13569
13605
|
import * as React7 from "react";
|
|
13570
|
-
import * as
|
|
13606
|
+
import * as React8 from "react";
|
|
13571
13607
|
import { Fragment as Fragment3, jsx as jsx132 } from "react/jsx-runtime";
|
|
13572
13608
|
import { jsx as jsx142 } from "react/jsx-runtime";
|
|
13573
13609
|
import * as React102 from "react";
|
|
13574
13610
|
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
13575
|
-
import * as
|
|
13576
|
-
import * as
|
|
13611
|
+
import * as React14 from "react";
|
|
13612
|
+
import * as React11 from "react";
|
|
13577
13613
|
import * as ReactDOM from "react-dom";
|
|
13578
13614
|
import { jsx as jsx162 } from "react/jsx-runtime";
|
|
13579
|
-
import * as
|
|
13580
|
-
import * as
|
|
13615
|
+
import * as React122 from "react";
|
|
13616
|
+
import * as React132 from "react";
|
|
13581
13617
|
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
13582
|
-
import * as
|
|
13618
|
+
import * as React15 from "react";
|
|
13583
13619
|
import * as React162 from "react";
|
|
13584
13620
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
13585
|
-
import * as
|
|
13621
|
+
import * as React182 from "react";
|
|
13586
13622
|
import * as React172 from "react";
|
|
13587
13623
|
import * as React22 from "react";
|
|
13588
|
-
import * as
|
|
13624
|
+
import * as React192 from "react";
|
|
13589
13625
|
import { useLayoutEffect as useLayoutEffect32, useEffect as useEffect82 } from "react";
|
|
13590
13626
|
import * as ReactDOM2 from "react-dom";
|
|
13591
|
-
import * as
|
|
13627
|
+
import * as React20 from "react";
|
|
13592
13628
|
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
13593
13629
|
import * as React21 from "react";
|
|
13594
13630
|
import { jsx as jsx202 } from "react/jsx-runtime";
|
|
13595
|
-
import * as
|
|
13631
|
+
import * as React232 from "react";
|
|
13596
13632
|
import ReactDOM3 from "react-dom";
|
|
13597
13633
|
import { jsx as jsx212 } from "react/jsx-runtime";
|
|
13598
|
-
import * as
|
|
13634
|
+
import * as React24 from "react";
|
|
13599
13635
|
import * as React252 from "react";
|
|
13600
|
-
import * as
|
|
13636
|
+
import * as React262 from "react";
|
|
13601
13637
|
import { jsx as jsx223 } from "react/jsx-runtime";
|
|
13602
13638
|
import * as React332 from "react";
|
|
13603
|
-
import * as
|
|
13639
|
+
import * as React292 from "react";
|
|
13604
13640
|
import { useState as useState112 } from "react";
|
|
13605
|
-
import * as
|
|
13641
|
+
import * as React27 from "react";
|
|
13606
13642
|
import * as React282 from "react";
|
|
13607
|
-
import * as
|
|
13608
|
-
import * as
|
|
13609
|
-
import * as
|
|
13643
|
+
import * as React32 from "react";
|
|
13644
|
+
import * as React312 from "react";
|
|
13645
|
+
import * as React30 from "react";
|
|
13610
13646
|
import { Fragment as Fragment62, jsx as jsx233, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
13611
13647
|
import { forwardRef as forwardRef132, createElement as createElement7 } from "react";
|
|
13612
13648
|
import { forwardRef as forwardRef122, createElement as createElement6 } from "react";
|
|
@@ -13661,7 +13697,7 @@ var getChildNodeFrom = (htmlElement) => {
|
|
|
13661
13697
|
return childNode;
|
|
13662
13698
|
};
|
|
13663
13699
|
var useHoverTransforms = (ref, disabled) => {
|
|
13664
|
-
const [state, setState] =
|
|
13700
|
+
const [state, setState] = React2.useState({
|
|
13665
13701
|
progress: 0,
|
|
13666
13702
|
isActive: false
|
|
13667
13703
|
});
|
|
@@ -13673,7 +13709,7 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
13673
13709
|
eventTarget.dispatchEvent(new Event("enabled"));
|
|
13674
13710
|
}
|
|
13675
13711
|
}, [disabled, eventTarget]);
|
|
13676
|
-
|
|
13712
|
+
React2.useEffect(() => {
|
|
13677
13713
|
const element = ref.current;
|
|
13678
13714
|
if (!element)
|
|
13679
13715
|
return;
|
|
@@ -13748,8 +13784,8 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
13748
13784
|
return state;
|
|
13749
13785
|
};
|
|
13750
13786
|
var useClickTransforms = (ref) => {
|
|
13751
|
-
const [hoverProgress, setHoverProgress] =
|
|
13752
|
-
|
|
13787
|
+
const [hoverProgress, setHoverProgress] = React2.useState(0);
|
|
13788
|
+
React2.useEffect(() => {
|
|
13753
13789
|
const element = getChildNodeFrom(ref.current);
|
|
13754
13790
|
if (!element) {
|
|
13755
13791
|
return;
|
|
@@ -14236,18 +14272,18 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
14236
14272
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
14237
14273
|
let defaultContexts = [];
|
|
14238
14274
|
function createContext32(rootComponentName, defaultContext) {
|
|
14239
|
-
const BaseContext =
|
|
14275
|
+
const BaseContext = React62.createContext(defaultContext);
|
|
14240
14276
|
const index = defaultContexts.length;
|
|
14241
14277
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
14242
14278
|
function Provider(props) {
|
|
14243
14279
|
const { scope, children, ...context } = props;
|
|
14244
14280
|
const Context = scope?.[scopeName][index] || BaseContext;
|
|
14245
|
-
const value =
|
|
14281
|
+
const value = React62.useMemo(() => context, Object.values(context));
|
|
14246
14282
|
return /* @__PURE__ */ jsx122(Context.Provider, { value, children });
|
|
14247
14283
|
}
|
|
14248
14284
|
function useContext210(consumerName, scope) {
|
|
14249
14285
|
const Context = scope?.[scopeName][index] || BaseContext;
|
|
14250
|
-
const context =
|
|
14286
|
+
const context = React62.useContext(Context);
|
|
14251
14287
|
if (context)
|
|
14252
14288
|
return context;
|
|
14253
14289
|
if (defaultContext !== undefined)
|
|
@@ -14259,11 +14295,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
14259
14295
|
}
|
|
14260
14296
|
const createScope = () => {
|
|
14261
14297
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
14262
|
-
return
|
|
14298
|
+
return React62.createContext(defaultContext);
|
|
14263
14299
|
});
|
|
14264
14300
|
return function useScope(scope) {
|
|
14265
14301
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
14266
|
-
return
|
|
14302
|
+
return React62.useMemo(() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), [scope, contexts]);
|
|
14267
14303
|
};
|
|
14268
14304
|
};
|
|
14269
14305
|
createScope.scopeName = scopeName;
|
|
@@ -14284,7 +14320,7 @@ function composeContextScopes(...scopes) {
|
|
|
14284
14320
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
14285
14321
|
return { ...nextScopes2, ...currentScope };
|
|
14286
14322
|
}, {});
|
|
14287
|
-
return
|
|
14323
|
+
return React62.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
14288
14324
|
};
|
|
14289
14325
|
};
|
|
14290
14326
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -14303,43 +14339,43 @@ function composeRefs(...refs) {
|
|
|
14303
14339
|
function useComposedRefs(...refs) {
|
|
14304
14340
|
return React7.useCallback(composeRefs(...refs), refs);
|
|
14305
14341
|
}
|
|
14306
|
-
var Slot =
|
|
14342
|
+
var Slot = React8.forwardRef((props, forwardedRef) => {
|
|
14307
14343
|
const { children, ...slotProps } = props;
|
|
14308
|
-
const childrenArray =
|
|
14344
|
+
const childrenArray = React8.Children.toArray(children);
|
|
14309
14345
|
const slottable = childrenArray.find(isSlottable);
|
|
14310
14346
|
if (slottable) {
|
|
14311
14347
|
const newElement = slottable.props.children;
|
|
14312
14348
|
const newChildren = childrenArray.map((child) => {
|
|
14313
14349
|
if (child === slottable) {
|
|
14314
|
-
if (
|
|
14315
|
-
return
|
|
14316
|
-
return
|
|
14350
|
+
if (React8.Children.count(newElement) > 1)
|
|
14351
|
+
return React8.Children.only(null);
|
|
14352
|
+
return React8.isValidElement(newElement) ? newElement.props.children : null;
|
|
14317
14353
|
} else {
|
|
14318
14354
|
return child;
|
|
14319
14355
|
}
|
|
14320
14356
|
});
|
|
14321
|
-
return /* @__PURE__ */ jsx132(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
14357
|
+
return /* @__PURE__ */ jsx132(SlotClone, { ...slotProps, ref: forwardedRef, children: React8.isValidElement(newElement) ? React8.cloneElement(newElement, undefined, newChildren) : null });
|
|
14322
14358
|
}
|
|
14323
14359
|
return /* @__PURE__ */ jsx132(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
14324
14360
|
});
|
|
14325
14361
|
Slot.displayName = "Slot";
|
|
14326
|
-
var SlotClone =
|
|
14362
|
+
var SlotClone = React8.forwardRef((props, forwardedRef) => {
|
|
14327
14363
|
const { children, ...slotProps } = props;
|
|
14328
|
-
if (
|
|
14364
|
+
if (React8.isValidElement(children)) {
|
|
14329
14365
|
const childrenRef = getElementRef(children);
|
|
14330
|
-
return
|
|
14366
|
+
return React8.cloneElement(children, {
|
|
14331
14367
|
...mergeProps(slotProps, children.props),
|
|
14332
14368
|
ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef
|
|
14333
14369
|
});
|
|
14334
14370
|
}
|
|
14335
|
-
return
|
|
14371
|
+
return React8.Children.count(children) > 1 ? React8.Children.only(null) : null;
|
|
14336
14372
|
});
|
|
14337
14373
|
SlotClone.displayName = "SlotClone";
|
|
14338
14374
|
var Slottable = ({ children }) => {
|
|
14339
14375
|
return /* @__PURE__ */ jsx132(Fragment3, { children });
|
|
14340
14376
|
};
|
|
14341
14377
|
function isSlottable(child) {
|
|
14342
|
-
return
|
|
14378
|
+
return React8.isValidElement(child) && child.type === Slottable;
|
|
14343
14379
|
}
|
|
14344
14380
|
function mergeProps(slotProps, childProps) {
|
|
14345
14381
|
const overrideProps = { ...childProps };
|
|
@@ -14453,7 +14489,7 @@ var NODES = [
|
|
|
14453
14489
|
"ul"
|
|
14454
14490
|
];
|
|
14455
14491
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
14456
|
-
const Node2 =
|
|
14492
|
+
const Node2 = React11.forwardRef((props, forwardedRef) => {
|
|
14457
14493
|
const { asChild, ...primitiveProps } = props;
|
|
14458
14494
|
const Comp = asChild ? Slot : node;
|
|
14459
14495
|
if (typeof window !== "undefined") {
|
|
@@ -14469,15 +14505,15 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
14469
14505
|
ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
14470
14506
|
}
|
|
14471
14507
|
function useCallbackRef(callback) {
|
|
14472
|
-
const callbackRef =
|
|
14473
|
-
|
|
14508
|
+
const callbackRef = React122.useRef(callback);
|
|
14509
|
+
React122.useEffect(() => {
|
|
14474
14510
|
callbackRef.current = callback;
|
|
14475
14511
|
});
|
|
14476
|
-
return
|
|
14512
|
+
return React122.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
14477
14513
|
}
|
|
14478
14514
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
14479
14515
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
14480
|
-
|
|
14516
|
+
React132.useEffect(() => {
|
|
14481
14517
|
const handleKeyDown = (event) => {
|
|
14482
14518
|
if (event.key === "Escape") {
|
|
14483
14519
|
onEscapeKeyDown(event);
|
|
@@ -14492,12 +14528,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
14492
14528
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
14493
14529
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
14494
14530
|
var originalBodyPointerEvents;
|
|
14495
|
-
var DismissableLayerContext =
|
|
14531
|
+
var DismissableLayerContext = React14.createContext({
|
|
14496
14532
|
layers: /* @__PURE__ */ new Set,
|
|
14497
14533
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set,
|
|
14498
14534
|
branches: /* @__PURE__ */ new Set
|
|
14499
14535
|
});
|
|
14500
|
-
var DismissableLayer =
|
|
14536
|
+
var DismissableLayer = React14.forwardRef((props, forwardedRef) => {
|
|
14501
14537
|
const {
|
|
14502
14538
|
disableOutsidePointerEvents = false,
|
|
14503
14539
|
onEscapeKeyDown,
|
|
@@ -14507,10 +14543,10 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
14507
14543
|
onDismiss,
|
|
14508
14544
|
...layerProps
|
|
14509
14545
|
} = props;
|
|
14510
|
-
const context =
|
|
14511
|
-
const [node, setNode] =
|
|
14546
|
+
const context = React14.useContext(DismissableLayerContext);
|
|
14547
|
+
const [node, setNode] = React14.useState(null);
|
|
14512
14548
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
14513
|
-
const [, force] =
|
|
14549
|
+
const [, force] = React14.useState({});
|
|
14514
14550
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
14515
14551
|
const layers = Array.from(context.layers);
|
|
14516
14552
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -14548,7 +14584,7 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
14548
14584
|
onDismiss();
|
|
14549
14585
|
}
|
|
14550
14586
|
}, ownerDocument);
|
|
14551
|
-
|
|
14587
|
+
React14.useEffect(() => {
|
|
14552
14588
|
if (!node)
|
|
14553
14589
|
return;
|
|
14554
14590
|
if (disableOutsidePointerEvents) {
|
|
@@ -14566,7 +14602,7 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
14566
14602
|
}
|
|
14567
14603
|
};
|
|
14568
14604
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
14569
|
-
|
|
14605
|
+
React14.useEffect(() => {
|
|
14570
14606
|
return () => {
|
|
14571
14607
|
if (!node)
|
|
14572
14608
|
return;
|
|
@@ -14575,7 +14611,7 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
14575
14611
|
dispatchUpdate();
|
|
14576
14612
|
};
|
|
14577
14613
|
}, [node, context]);
|
|
14578
|
-
|
|
14614
|
+
React14.useEffect(() => {
|
|
14579
14615
|
const handleUpdate = () => force({});
|
|
14580
14616
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
14581
14617
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -14594,11 +14630,11 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
14594
14630
|
});
|
|
14595
14631
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
14596
14632
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
14597
|
-
var DismissableLayerBranch =
|
|
14598
|
-
const context =
|
|
14599
|
-
const ref =
|
|
14633
|
+
var DismissableLayerBranch = React14.forwardRef((props, forwardedRef) => {
|
|
14634
|
+
const context = React14.useContext(DismissableLayerContext);
|
|
14635
|
+
const ref = React14.useRef(null);
|
|
14600
14636
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14601
|
-
|
|
14637
|
+
React14.useEffect(() => {
|
|
14602
14638
|
const node = ref.current;
|
|
14603
14639
|
if (node) {
|
|
14604
14640
|
context.branches.add(node);
|
|
@@ -14612,9 +14648,9 @@ var DismissableLayerBranch = React142.forwardRef((props, forwardedRef) => {
|
|
|
14612
14648
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
14613
14649
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
14614
14650
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
14615
|
-
const isPointerInsideReactTreeRef =
|
|
14616
|
-
const handleClickRef =
|
|
14617
|
-
|
|
14651
|
+
const isPointerInsideReactTreeRef = React14.useRef(false);
|
|
14652
|
+
const handleClickRef = React14.useRef(() => {});
|
|
14653
|
+
React14.useEffect(() => {
|
|
14618
14654
|
const handlePointerDown = (event) => {
|
|
14619
14655
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
14620
14656
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -14649,8 +14685,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
14649
14685
|
}
|
|
14650
14686
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
14651
14687
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
14652
|
-
const isFocusInsideReactTreeRef =
|
|
14653
|
-
|
|
14688
|
+
const isFocusInsideReactTreeRef = React14.useRef(false);
|
|
14689
|
+
React14.useEffect(() => {
|
|
14654
14690
|
const handleFocus = (event) => {
|
|
14655
14691
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
14656
14692
|
const eventDetail = { originalEvent: event };
|
|
@@ -14684,7 +14720,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
14684
14720
|
}
|
|
14685
14721
|
var count = 0;
|
|
14686
14722
|
function useFocusGuards() {
|
|
14687
|
-
|
|
14723
|
+
React15.useEffect(() => {
|
|
14688
14724
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
14689
14725
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
14690
14726
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -14920,12 +14956,12 @@ function removeLinks(items) {
|
|
|
14920
14956
|
return items.filter((item) => item.tagName !== "A");
|
|
14921
14957
|
}
|
|
14922
14958
|
var useLayoutEffect22 = Boolean(globalThis?.document) ? React172.useLayoutEffect : () => {};
|
|
14923
|
-
var useReactId =
|
|
14959
|
+
var useReactId = React182["useId".toString()] || (() => {
|
|
14924
14960
|
return;
|
|
14925
14961
|
});
|
|
14926
14962
|
var count2 = 0;
|
|
14927
14963
|
function useId(deterministicId) {
|
|
14928
|
-
const [id, setId] =
|
|
14964
|
+
const [id, setId] = React182.useState(useReactId());
|
|
14929
14965
|
useLayoutEffect22(() => {
|
|
14930
14966
|
if (!deterministicId)
|
|
14931
14967
|
setId((reactId) => reactId ?? String(count2++));
|
|
@@ -16504,7 +16540,7 @@ function roundByDPR(element, value) {
|
|
|
16504
16540
|
return Math.round(value * dpr) / dpr;
|
|
16505
16541
|
}
|
|
16506
16542
|
function useLatestRef(value) {
|
|
16507
|
-
const ref =
|
|
16543
|
+
const ref = React192.useRef(value);
|
|
16508
16544
|
index(() => {
|
|
16509
16545
|
ref.current = value;
|
|
16510
16546
|
});
|
|
@@ -16527,7 +16563,7 @@ function useFloating(options) {
|
|
|
16527
16563
|
whileElementsMounted,
|
|
16528
16564
|
open
|
|
16529
16565
|
} = options;
|
|
16530
|
-
const [data, setData] =
|
|
16566
|
+
const [data, setData] = React192.useState({
|
|
16531
16567
|
x: 0,
|
|
16532
16568
|
y: 0,
|
|
16533
16569
|
strategy,
|
|
@@ -16535,19 +16571,19 @@ function useFloating(options) {
|
|
|
16535
16571
|
middlewareData: {},
|
|
16536
16572
|
isPositioned: false
|
|
16537
16573
|
});
|
|
16538
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
16574
|
+
const [latestMiddleware, setLatestMiddleware] = React192.useState(middleware);
|
|
16539
16575
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
16540
16576
|
setLatestMiddleware(middleware);
|
|
16541
16577
|
}
|
|
16542
|
-
const [_reference, _setReference] =
|
|
16543
|
-
const [_floating, _setFloating] =
|
|
16544
|
-
const setReference =
|
|
16578
|
+
const [_reference, _setReference] = React192.useState(null);
|
|
16579
|
+
const [_floating, _setFloating] = React192.useState(null);
|
|
16580
|
+
const setReference = React192.useCallback((node) => {
|
|
16545
16581
|
if (node !== referenceRef.current) {
|
|
16546
16582
|
referenceRef.current = node;
|
|
16547
16583
|
_setReference(node);
|
|
16548
16584
|
}
|
|
16549
16585
|
}, []);
|
|
16550
|
-
const setFloating =
|
|
16586
|
+
const setFloating = React192.useCallback((node) => {
|
|
16551
16587
|
if (node !== floatingRef.current) {
|
|
16552
16588
|
floatingRef.current = node;
|
|
16553
16589
|
_setFloating(node);
|
|
@@ -16555,13 +16591,13 @@ function useFloating(options) {
|
|
|
16555
16591
|
}, []);
|
|
16556
16592
|
const referenceEl = externalReference || _reference;
|
|
16557
16593
|
const floatingEl = externalFloating || _floating;
|
|
16558
|
-
const referenceRef =
|
|
16559
|
-
const floatingRef =
|
|
16560
|
-
const dataRef =
|
|
16594
|
+
const referenceRef = React192.useRef(null);
|
|
16595
|
+
const floatingRef = React192.useRef(null);
|
|
16596
|
+
const dataRef = React192.useRef(data);
|
|
16561
16597
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
16562
16598
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
16563
16599
|
const platformRef = useLatestRef(platform2);
|
|
16564
|
-
const update =
|
|
16600
|
+
const update = React192.useCallback(() => {
|
|
16565
16601
|
if (!referenceRef.current || !floatingRef.current) {
|
|
16566
16602
|
return;
|
|
16567
16603
|
}
|
|
@@ -16595,7 +16631,7 @@ function useFloating(options) {
|
|
|
16595
16631
|
}));
|
|
16596
16632
|
}
|
|
16597
16633
|
}, [open]);
|
|
16598
|
-
const isMountedRef =
|
|
16634
|
+
const isMountedRef = React192.useRef(false);
|
|
16599
16635
|
index(() => {
|
|
16600
16636
|
isMountedRef.current = true;
|
|
16601
16637
|
return () => {
|
|
@@ -16614,17 +16650,17 @@ function useFloating(options) {
|
|
|
16614
16650
|
update();
|
|
16615
16651
|
}
|
|
16616
16652
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
16617
|
-
const refs =
|
|
16653
|
+
const refs = React192.useMemo(() => ({
|
|
16618
16654
|
reference: referenceRef,
|
|
16619
16655
|
floating: floatingRef,
|
|
16620
16656
|
setReference,
|
|
16621
16657
|
setFloating
|
|
16622
16658
|
}), [setReference, setFloating]);
|
|
16623
|
-
const elements =
|
|
16659
|
+
const elements = React192.useMemo(() => ({
|
|
16624
16660
|
reference: referenceEl,
|
|
16625
16661
|
floating: floatingEl
|
|
16626
16662
|
}), [referenceEl, floatingEl]);
|
|
16627
|
-
const floatingStyles =
|
|
16663
|
+
const floatingStyles = React192.useMemo(() => {
|
|
16628
16664
|
const initialStyles = {
|
|
16629
16665
|
position: strategy,
|
|
16630
16666
|
left: 0,
|
|
@@ -16650,7 +16686,7 @@ function useFloating(options) {
|
|
|
16650
16686
|
top: y
|
|
16651
16687
|
};
|
|
16652
16688
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
16653
|
-
return
|
|
16689
|
+
return React192.useMemo(() => ({
|
|
16654
16690
|
...data,
|
|
16655
16691
|
update,
|
|
16656
16692
|
refs,
|
|
@@ -16718,7 +16754,7 @@ var arrow3 = (options, deps) => ({
|
|
|
16718
16754
|
options: [options, deps]
|
|
16719
16755
|
});
|
|
16720
16756
|
var NAME = "Arrow";
|
|
16721
|
-
var Arrow =
|
|
16757
|
+
var Arrow = React20.forwardRef((props, forwardedRef) => {
|
|
16722
16758
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
16723
16759
|
return /* @__PURE__ */ jsx192(Primitive.svg, {
|
|
16724
16760
|
...arrowProps,
|
|
@@ -16999,9 +17035,9 @@ var Anchor = PopperAnchor;
|
|
|
16999
17035
|
var Content = PopperContent;
|
|
17000
17036
|
var Arrow2 = PopperArrow;
|
|
17001
17037
|
var PORTAL_NAME = "Portal";
|
|
17002
|
-
var Portal =
|
|
17038
|
+
var Portal = React232.forwardRef((props, forwardedRef) => {
|
|
17003
17039
|
const { container: containerProp, ...portalProps } = props;
|
|
17004
|
-
const [mounted, setMounted] =
|
|
17040
|
+
const [mounted, setMounted] = React232.useState(false);
|
|
17005
17041
|
useLayoutEffect22(() => setMounted(true), []);
|
|
17006
17042
|
const container22 = containerProp || mounted && globalThis?.document?.body;
|
|
17007
17043
|
return container22 ? ReactDOM3.createPortal(/* @__PURE__ */ jsx212(Primitive.div, { ...portalProps, ref: forwardedRef }), container22) : null;
|
|
@@ -17016,7 +17052,7 @@ function useControllableState({
|
|
|
17016
17052
|
const isControlled = prop !== undefined;
|
|
17017
17053
|
const value = isControlled ? prop : uncontrolledProp;
|
|
17018
17054
|
const handleChange = useCallbackRef(onChange);
|
|
17019
|
-
const setValue =
|
|
17055
|
+
const setValue = React24.useCallback((nextValue) => {
|
|
17020
17056
|
if (isControlled) {
|
|
17021
17057
|
const setter = nextValue;
|
|
17022
17058
|
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
@@ -17032,11 +17068,11 @@ function useUncontrolledState({
|
|
|
17032
17068
|
defaultProp,
|
|
17033
17069
|
onChange
|
|
17034
17070
|
}) {
|
|
17035
|
-
const uncontrolledState =
|
|
17071
|
+
const uncontrolledState = React24.useState(defaultProp);
|
|
17036
17072
|
const [value] = uncontrolledState;
|
|
17037
|
-
const prevValueRef =
|
|
17073
|
+
const prevValueRef = React24.useRef(value);
|
|
17038
17074
|
const handleChange = useCallbackRef(onChange);
|
|
17039
|
-
|
|
17075
|
+
React24.useEffect(() => {
|
|
17040
17076
|
if (prevValueRef.current !== value) {
|
|
17041
17077
|
handleChange(value);
|
|
17042
17078
|
prevValueRef.current = value;
|
|
@@ -17055,7 +17091,7 @@ function usePrevious(value) {
|
|
|
17055
17091
|
}, [value]);
|
|
17056
17092
|
}
|
|
17057
17093
|
var NAME2 = "VisuallyHidden";
|
|
17058
|
-
var VisuallyHidden =
|
|
17094
|
+
var VisuallyHidden = React262.forwardRef((props, forwardedRef) => {
|
|
17059
17095
|
return /* @__PURE__ */ jsx223(Primitive.span, {
|
|
17060
17096
|
...props,
|
|
17061
17097
|
ref: forwardedRef,
|
|
@@ -17263,7 +17299,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
17263
17299
|
ref.callback = callback;
|
|
17264
17300
|
return ref.facade;
|
|
17265
17301
|
}
|
|
17266
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
17302
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React27.useLayoutEffect : React27.useEffect;
|
|
17267
17303
|
var currentValues = new WeakMap;
|
|
17268
17304
|
function useMergeRefs(refs, defaultValue) {
|
|
17269
17305
|
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
@@ -17396,9 +17432,9 @@ var effectCar = createSidecarMedium();
|
|
|
17396
17432
|
var nothing = function() {
|
|
17397
17433
|
return;
|
|
17398
17434
|
};
|
|
17399
|
-
var RemoveScroll =
|
|
17400
|
-
var ref =
|
|
17401
|
-
var _a =
|
|
17435
|
+
var RemoveScroll = React292.forwardRef(function(props, parentRef) {
|
|
17436
|
+
var ref = React292.useRef(null);
|
|
17437
|
+
var _a = React292.useState({
|
|
17402
17438
|
onScrollCapture: nothing,
|
|
17403
17439
|
onWheelCapture: nothing,
|
|
17404
17440
|
onTouchMoveCapture: nothing
|
|
@@ -17407,7 +17443,7 @@ var RemoveScroll = React29.forwardRef(function(props, parentRef) {
|
|
|
17407
17443
|
var SideCar2 = sideCar;
|
|
17408
17444
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
17409
17445
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
17410
|
-
return
|
|
17446
|
+
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));
|
|
17411
17447
|
});
|
|
17412
17448
|
RemoveScroll.defaultProps = {
|
|
17413
17449
|
enabled: true,
|
|
@@ -17475,7 +17511,7 @@ var stylesheetSingleton = function() {
|
|
|
17475
17511
|
var styleHookSingleton = function() {
|
|
17476
17512
|
var sheet = stylesheetSingleton();
|
|
17477
17513
|
return function(styles, isDynamic) {
|
|
17478
|
-
|
|
17514
|
+
React30.useEffect(function() {
|
|
17479
17515
|
sheet.add(styles);
|
|
17480
17516
|
return function() {
|
|
17481
17517
|
sheet.remove();
|
|
@@ -17580,7 +17616,7 @@ var getCurrentUseCounter = function() {
|
|
|
17580
17616
|
return isFinite(counter) ? counter : 0;
|
|
17581
17617
|
};
|
|
17582
17618
|
var useLockAttribute = function() {
|
|
17583
|
-
|
|
17619
|
+
React312.useEffect(function() {
|
|
17584
17620
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
17585
17621
|
return function() {
|
|
17586
17622
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -17595,10 +17631,10 @@ var useLockAttribute = function() {
|
|
|
17595
17631
|
var RemoveScrollBar = function(_a) {
|
|
17596
17632
|
var { noRelative, noImportant, gapMode: _b } = _a, gapMode = _b === undefined ? "margin" : _b;
|
|
17597
17633
|
useLockAttribute();
|
|
17598
|
-
var gap =
|
|
17634
|
+
var gap = React312.useMemo(function() {
|
|
17599
17635
|
return getGapWidth(gapMode);
|
|
17600
17636
|
}, [gapMode]);
|
|
17601
|
-
return
|
|
17637
|
+
return React312.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
17602
17638
|
};
|
|
17603
17639
|
var passiveSupported = false;
|
|
17604
17640
|
if (typeof window !== "undefined") {
|
|
@@ -17725,16 +17761,16 @@ var generateStyle = function(id) {
|
|
|
17725
17761
|
var idCounter = 0;
|
|
17726
17762
|
var lockStack = [];
|
|
17727
17763
|
function RemoveScrollSideCar(props) {
|
|
17728
|
-
var shouldPreventQueue =
|
|
17729
|
-
var touchStartRef =
|
|
17730
|
-
var activeAxis =
|
|
17731
|
-
var id =
|
|
17732
|
-
var Style2 =
|
|
17733
|
-
var lastProps =
|
|
17734
|
-
|
|
17764
|
+
var shouldPreventQueue = React32.useRef([]);
|
|
17765
|
+
var touchStartRef = React32.useRef([0, 0]);
|
|
17766
|
+
var activeAxis = React32.useRef();
|
|
17767
|
+
var id = React32.useState(idCounter++)[0];
|
|
17768
|
+
var Style2 = React32.useState(styleSingleton)[0];
|
|
17769
|
+
var lastProps = React32.useRef(props);
|
|
17770
|
+
React32.useEffect(function() {
|
|
17735
17771
|
lastProps.current = props;
|
|
17736
17772
|
}, [props]);
|
|
17737
|
-
|
|
17773
|
+
React32.useEffect(function() {
|
|
17738
17774
|
if (props.inert) {
|
|
17739
17775
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
17740
17776
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
@@ -17750,7 +17786,7 @@ function RemoveScrollSideCar(props) {
|
|
|
17750
17786
|
}
|
|
17751
17787
|
return;
|
|
17752
17788
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
17753
|
-
var shouldCancelEvent =
|
|
17789
|
+
var shouldCancelEvent = React32.useCallback(function(event, parent) {
|
|
17754
17790
|
if ("touches" in event && event.touches.length === 2) {
|
|
17755
17791
|
return !lastProps.current.allowPinchZoom;
|
|
17756
17792
|
}
|
|
@@ -17786,7 +17822,7 @@ function RemoveScrollSideCar(props) {
|
|
|
17786
17822
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
17787
17823
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
17788
17824
|
}, []);
|
|
17789
|
-
var shouldPrevent =
|
|
17825
|
+
var shouldPrevent = React32.useCallback(function(_event) {
|
|
17790
17826
|
var event = _event;
|
|
17791
17827
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
17792
17828
|
return;
|
|
@@ -17813,7 +17849,7 @@ function RemoveScrollSideCar(props) {
|
|
|
17813
17849
|
}
|
|
17814
17850
|
}
|
|
17815
17851
|
}, []);
|
|
17816
|
-
var shouldCancel =
|
|
17852
|
+
var shouldCancel = React32.useCallback(function(name, delta, target, should) {
|
|
17817
17853
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
17818
17854
|
shouldPreventQueue.current.push(event);
|
|
17819
17855
|
setTimeout(function() {
|
|
@@ -17822,17 +17858,17 @@ function RemoveScrollSideCar(props) {
|
|
|
17822
17858
|
});
|
|
17823
17859
|
}, 1);
|
|
17824
17860
|
}, []);
|
|
17825
|
-
var scrollTouchStart =
|
|
17861
|
+
var scrollTouchStart = React32.useCallback(function(event) {
|
|
17826
17862
|
touchStartRef.current = getTouchXY(event);
|
|
17827
17863
|
activeAxis.current = undefined;
|
|
17828
17864
|
}, []);
|
|
17829
|
-
var scrollWheel =
|
|
17865
|
+
var scrollWheel = React32.useCallback(function(event) {
|
|
17830
17866
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
17831
17867
|
}, []);
|
|
17832
|
-
var scrollTouchMove =
|
|
17868
|
+
var scrollTouchMove = React32.useCallback(function(event) {
|
|
17833
17869
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
17834
17870
|
}, []);
|
|
17835
|
-
|
|
17871
|
+
React32.useEffect(function() {
|
|
17836
17872
|
lockStack.push(Style2);
|
|
17837
17873
|
props.setCallbacks({
|
|
17838
17874
|
onScrollCapture: scrollWheel,
|
|
@@ -17852,7 +17888,7 @@ function RemoveScrollSideCar(props) {
|
|
|
17852
17888
|
};
|
|
17853
17889
|
}, []);
|
|
17854
17890
|
var { removeScrollBar, inert } = props;
|
|
17855
|
-
return
|
|
17891
|
+
return React32.createElement(React32.Fragment, null, inert ? React32.createElement(Style2, { styles: generateStyle(id) }) : null, removeScrollBar ? React32.createElement(RemoveScrollBar, { gapMode: props.gapMode }) : null);
|
|
17856
17892
|
}
|
|
17857
17893
|
function getOutermostShadowParent(node) {
|
|
17858
17894
|
var shadowParent = null;
|
|
@@ -18961,7 +18997,7 @@ var Switch = ({ active, onToggle }) => {
|
|
|
18961
18997
|
onClick: onToggle,
|
|
18962
18998
|
children: /* @__PURE__ */ jsx252("div", {
|
|
18963
18999
|
"data-active": active,
|
|
18964
|
-
className: "h-[20px] w-[20px]
|
|
19000
|
+
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)]"
|
|
18965
19001
|
})
|
|
18966
19002
|
});
|
|
18967
19003
|
};
|