@remotion/promo-pages 4.0.441 → 4.0.443
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Homepage.js +1427 -1356
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/Homepage.js +101 -54
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/design.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/experts.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/homepage/Pricing.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsGallery.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsShow.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsSubmit.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/template-modal-content.js +2 -2
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/templates.js +4 -3
- package/dist/cn.d.ts +2 -0
- package/dist/cn.js +5 -0
- package/dist/components/3DEngine/ButtonDemo.d.ts +2 -0
- package/dist/components/3DEngine/ButtonDemo.js +43 -0
- package/dist/components/3DEngine/Faces.d.ts +5 -0
- package/dist/components/3DEngine/Faces.js +7 -0
- package/dist/components/3DEngine/Outer.d.ts +8 -0
- package/dist/components/3DEngine/Outer.js +56 -0
- package/dist/components/3DEngine/Switch.d.ts +4 -0
- package/dist/components/3DEngine/Switch.js +4 -0
- package/dist/components/3DEngine/get-child-node-from.d.ts +1 -0
- package/dist/components/3DEngine/get-child-node-from.js +14 -0
- package/dist/components/3DEngine/hover-transforms.d.ts +9 -0
- package/dist/components/3DEngine/hover-transforms.js +177 -0
- package/dist/components/BackButton.d.ts +6 -0
- package/dist/components/BackButton.js +9 -0
- package/dist/components/CommandCopyButton.d.ts +5 -0
- package/dist/components/CommandCopyButton.js +4 -0
- package/dist/components/Homepage.d.ts +6 -0
- package/dist/components/Homepage.js +20 -0
- package/dist/components/ManageTeamMembers.d.ts +2 -0
- package/dist/components/ManageTeamMembers.js +42 -0
- package/dist/components/Spinner.d.ts +3 -0
- package/dist/components/Spinner.js +4 -0
- package/dist/components/TeamPicture.d.ts +1 -0
- package/dist/components/TeamPicture.js +4 -0
- package/dist/components/design.d.ts +1 -0
- package/dist/components/design.js +33 -0
- package/dist/components/experts/ExpertsPage.d.ts +11 -0
- package/dist/components/experts/ExpertsPage.js +50 -0
- package/dist/components/experts/experts-data.d.ts +15 -0
- package/dist/components/experts/experts-data.js +263 -0
- package/dist/components/experts/experts-icons.d.ts +7 -0
- package/dist/components/experts/experts-icons.js +36 -0
- package/dist/components/experts.d.ts +3 -0
- package/dist/components/experts.js +2 -0
- package/dist/components/homepage/BackgroundAnimation.d.ts +2 -0
- package/dist/components/homepage/BackgroundAnimation.js +66 -0
- package/dist/components/homepage/ChooseTemplate.d.ts +2 -0
- package/dist/components/homepage/ChooseTemplate.js +25 -0
- package/dist/components/homepage/CommunityStats.d.ts +3 -0
- package/dist/components/homepage/CommunityStats.js +6 -0
- package/dist/components/homepage/CommunityStatsItems.d.ts +7 -0
- package/dist/components/homepage/CommunityStatsItems.js +58 -0
- package/dist/components/homepage/Demo/Card.d.ts +15 -0
- package/dist/components/homepage/Demo/Card.js +174 -0
- package/dist/components/homepage/Demo/Cards.d.ts +15 -0
- package/dist/components/homepage/Demo/Cards.js +57 -0
- package/dist/components/homepage/Demo/Comp.d.ts +38 -0
- package/dist/components/homepage/Demo/Comp.js +72 -0
- package/dist/components/homepage/Demo/CurrentCountry.d.ts +9 -0
- package/dist/components/homepage/Demo/CurrentCountry.js +48 -0
- package/dist/components/homepage/Demo/DemoError.d.ts +2 -0
- package/dist/components/homepage/Demo/DemoError.js +10 -0
- package/dist/components/homepage/Demo/DemoErrorIcon.d.ts +2 -0
- package/dist/components/homepage/Demo/DemoErrorIcon.js +16 -0
- package/dist/components/homepage/Demo/DemoRender.d.ts +33 -0
- package/dist/components/homepage/Demo/DemoRender.js +107 -0
- package/dist/components/homepage/Demo/DigitWheel.d.ts +9 -0
- package/dist/components/homepage/Demo/DigitWheel.js +94 -0
- package/dist/components/homepage/Demo/DisplayedEmoji.d.ts +5 -0
- package/dist/components/homepage/Demo/DisplayedEmoji.js +59 -0
- package/dist/components/homepage/Demo/DoneCheckmark.d.ts +2 -0
- package/dist/components/homepage/Demo/DoneCheckmark.js +20 -0
- package/dist/components/homepage/Demo/DownloadNudge.d.ts +2 -0
- package/dist/components/homepage/Demo/DownloadNudge.js +27 -0
- package/dist/components/homepage/Demo/DragAndDropNudge.d.ts +3 -0
- package/dist/components/homepage/Demo/DragAndDropNudge.js +26 -0
- package/dist/components/homepage/Demo/EmojiCard.d.ts +10 -0
- package/dist/components/homepage/Demo/EmojiCard.js +120 -0
- package/dist/components/homepage/Demo/Minus.d.ts +5 -0
- package/dist/components/homepage/Demo/Minus.js +11 -0
- package/dist/components/homepage/Demo/PlayPauseButton.d.ts +5 -0
- package/dist/components/homepage/Demo/PlayPauseButton.js +47 -0
- package/dist/components/homepage/Demo/PlayerControls.d.ts +8 -0
- package/dist/components/homepage/Demo/PlayerControls.js +15 -0
- package/dist/components/homepage/Demo/PlayerSeekBar.d.ts +11 -0
- package/dist/components/homepage/Demo/PlayerSeekBar.js +216 -0
- package/dist/components/homepage/Demo/PlayerVolume.d.ts +5 -0
- package/dist/components/homepage/Demo/PlayerVolume.js +53 -0
- package/dist/components/homepage/Demo/Progress.d.ts +4 -0
- package/dist/components/homepage/Demo/Progress.js +14 -0
- package/dist/components/homepage/Demo/Spinner.d.ts +5 -0
- package/dist/components/homepage/Demo/Spinner.js +37 -0
- package/dist/components/homepage/Demo/Switcher.d.ts +6 -0
- package/dist/components/homepage/Demo/Switcher.js +25 -0
- package/dist/components/homepage/Demo/Temperature.d.ts +6 -0
- package/dist/components/homepage/Demo/Temperature.js +21 -0
- package/dist/components/homepage/Demo/TemperatureNumber.d.ts +5 -0
- package/dist/components/homepage/Demo/TemperatureNumber.js +36 -0
- package/dist/components/homepage/Demo/ThemeNudge.d.ts +3 -0
- package/dist/components/homepage/Demo/ThemeNudge.js +35 -0
- package/dist/components/homepage/Demo/TimeDisplay.d.ts +6 -0
- package/dist/components/homepage/Demo/TimeDisplay.js +27 -0
- package/dist/components/homepage/Demo/TrendingRepos.d.ts +6 -0
- package/dist/components/homepage/Demo/TrendingRepos.js +65 -0
- package/dist/components/homepage/Demo/icons.d.ts +10 -0
- package/dist/components/homepage/Demo/icons.js +22 -0
- package/dist/components/homepage/Demo/index.d.ts +2 -0
- package/dist/components/homepage/Demo/index.js +95 -0
- package/dist/components/homepage/Demo/math.d.ts +10 -0
- package/dist/components/homepage/Demo/math.js +29 -0
- package/dist/components/homepage/Demo/types.d.ts +6 -0
- package/dist/components/homepage/Demo/types.js +0 -0
- package/dist/components/homepage/EditorStarterSection.d.ts +3 -0
- package/dist/components/homepage/EditorStarterSection.js +8 -0
- package/dist/components/homepage/EvaluateRemotion.d.ts +3 -0
- package/dist/components/homepage/EvaluateRemotion.js +21 -0
- package/dist/components/homepage/FreePricing.d.ts +4 -0
- package/dist/components/homepage/FreePricing.js +134 -0
- package/dist/components/homepage/GetStartedStrip.d.ts +2 -0
- package/dist/components/homepage/GetStartedStrip.js +14 -0
- package/dist/components/homepage/GitHubButton.d.ts +2 -0
- package/dist/components/homepage/GitHubButton.js +7 -0
- package/dist/components/homepage/IconForTemplate.d.ts +6 -0
- package/dist/components/homepage/IconForTemplate.js +105 -0
- package/dist/components/homepage/IfYouKnowReact.d.ts +3 -0
- package/dist/components/homepage/IfYouKnowReact.js +23 -0
- package/dist/components/homepage/InfoTooltip.d.ts +6 -0
- package/dist/components/homepage/InfoTooltip.js +6 -0
- package/dist/components/homepage/MoreTemplatesButton.d.ts +2 -0
- package/dist/components/homepage/MoreTemplatesButton.js +11 -0
- package/dist/components/homepage/MuxVideo.d.ts +7 -0
- package/dist/components/homepage/MuxVideo.js +45 -0
- package/dist/components/homepage/NewsletterButton.d.ts +2 -0
- package/dist/components/homepage/NewsletterButton.js +38 -0
- package/dist/components/homepage/ParameterizeAndEdit.d.ts +2 -0
- package/dist/components/homepage/ParameterizeAndEdit.js +22 -0
- package/dist/components/homepage/Pricing.d.ts +2 -0
- package/dist/components/homepage/Pricing.js +15 -0
- package/dist/components/homepage/PricingBulletPoint.d.ts +6 -0
- package/dist/components/homepage/PricingBulletPoint.js +19 -0
- package/dist/components/homepage/RealMp4Videos.d.ts +2 -0
- package/dist/components/homepage/RealMp4Videos.js +41 -0
- package/dist/components/homepage/Spacer.d.ts +2 -0
- package/dist/components/homepage/Spacer.js +4 -0
- package/dist/components/homepage/TemplateIcon.d.ts +5 -0
- package/dist/components/homepage/TemplateIcon.js +24 -0
- package/dist/components/homepage/TextInput.d.ts +7 -0
- package/dist/components/homepage/TextInput.js +34 -0
- package/dist/components/homepage/TrustedByBanner.d.ts +2 -0
- package/dist/components/homepage/TrustedByBanner.js +27 -0
- package/dist/components/homepage/VideoApps.d.ts +4 -0
- package/dist/components/homepage/VideoApps.js +72 -0
- package/dist/components/homepage/VideoAppsShowcase.d.ts +3 -0
- package/dist/components/homepage/VideoAppsShowcase.js +139 -0
- package/dist/components/homepage/VideoAppsTitle.d.ts +4 -0
- package/dist/components/homepage/VideoAppsTitle.js +4 -0
- package/dist/components/homepage/VideoPlayerWithControls.d.ts +20 -0
- package/dist/components/homepage/VideoPlayerWithControls.js +105 -0
- package/dist/components/homepage/WriteInReact.d.ts +2 -0
- package/dist/components/homepage/WriteInReact.js +10 -0
- package/dist/components/homepage/YouAreHere.d.ts +2 -0
- package/dist/components/homepage/YouAreHere.js +23 -0
- package/dist/components/homepage/layout/Button.d.ts +22 -0
- package/dist/components/homepage/layout/Button.js +30 -0
- package/dist/components/homepage/layout/colors.d.ts +13 -0
- package/dist/components/homepage/layout/colors.js +14 -0
- package/dist/components/homepage/layout/use-color-mode.d.ts +21 -0
- package/dist/components/homepage/layout/use-color-mode.js +22 -0
- package/dist/components/homepage/layout/use-el-size.d.ts +5 -0
- package/dist/components/homepage/layout/use-el-size.js +40 -0
- package/dist/components/homepage/layout/use-mobile-layout.d.ts +1 -0
- package/dist/components/homepage/layout/use-mobile-layout.js +6 -0
- package/dist/components/icons/blank.d.ts +3 -0
- package/dist/components/icons/blank.js +4 -0
- package/dist/components/icons/brain.d.ts +2 -0
- package/dist/components/icons/brain.js +4 -0
- package/dist/components/icons/clone.d.ts +2 -0
- package/dist/components/icons/clone.js +2 -0
- package/dist/components/icons/code-hike.d.ts +3 -0
- package/dist/components/icons/code-hike.js +4 -0
- package/dist/components/icons/cubes.d.ts +3 -0
- package/dist/components/icons/cubes.js +4 -0
- package/dist/components/icons/editor.d.ts +3 -0
- package/dist/components/icons/editor.js +4 -0
- package/dist/components/icons/electron.d.ts +4 -0
- package/dist/components/icons/electron.js +4 -0
- package/dist/components/icons/js.d.ts +3 -0
- package/dist/components/icons/js.js +4 -0
- package/dist/components/icons/music.d.ts +2 -0
- package/dist/components/icons/music.js +4 -0
- package/dist/components/icons/next.d.ts +4 -0
- package/dist/components/icons/next.js +4 -0
- package/dist/components/icons/overlay.d.ts +3 -0
- package/dist/components/icons/overlay.js +4 -0
- package/dist/components/icons/prompt-to-video.d.ts +2 -0
- package/dist/components/icons/prompt-to-video.js +4 -0
- package/dist/components/icons/recorder.d.ts +3 -0
- package/dist/components/icons/recorder.js +4 -0
- package/dist/components/icons/remix.d.ts +3 -0
- package/dist/components/icons/remix.js +4 -0
- package/dist/components/icons/render-server.d.ts +3 -0
- package/dist/components/icons/render-server.js +4 -0
- package/dist/components/icons/skia.d.ts +3 -0
- package/dist/components/icons/skia.js +4 -0
- package/dist/components/icons/stargazer.d.ts +3 -0
- package/dist/components/icons/stargazer.js +4 -0
- package/dist/components/icons/still.d.ts +3 -0
- package/dist/components/icons/still.js +4 -0
- package/dist/components/icons/tailwind.d.ts +3 -0
- package/dist/components/icons/tailwind.js +4 -0
- package/dist/components/icons/tiktok.d.ts +3 -0
- package/dist/components/icons/tiktok.js +4 -0
- package/dist/components/icons/timeline.d.ts +3 -0
- package/dist/components/icons/timeline.js +4 -0
- package/dist/components/icons/ts.d.ts +3 -0
- package/dist/components/icons/ts.js +4 -0
- package/dist/components/icons/undo.d.ts +3 -0
- package/dist/components/icons/undo.js +2 -0
- package/dist/components/icons/vercel.d.ts +4 -0
- package/dist/components/icons/vercel.js +4 -0
- package/dist/components/icons/waveform.d.ts +3 -0
- package/dist/components/icons/waveform.js +4 -0
- package/dist/components/prompts/CardLikeButton.d.ts +5 -0
- package/dist/components/prompts/CardLikeButton.js +49 -0
- package/dist/components/prompts/ClipboardIcon.d.ts +5 -0
- package/dist/components/prompts/ClipboardIcon.js +4 -0
- package/dist/components/prompts/CopyPromptButton.d.ts +4 -0
- package/dist/components/prompts/CopyPromptButton.js +13 -0
- package/dist/components/prompts/LikeButton.d.ts +5 -0
- package/dist/components/prompts/LikeButton.js +49 -0
- package/dist/components/prompts/MuxPlayer.d.ts +8 -0
- package/dist/components/prompts/MuxPlayer.js +21 -0
- package/dist/components/prompts/NewBackButton.d.ts +5 -0
- package/dist/components/prompts/NewBackButton.js +8 -0
- package/dist/components/prompts/Page.d.ts +8 -0
- package/dist/components/prompts/Page.js +7 -0
- package/dist/components/prompts/PromptsGallery.d.ts +7 -0
- package/dist/components/prompts/PromptsGallery.js +60 -0
- package/dist/components/prompts/PromptsShow.d.ts +5 -0
- package/dist/components/prompts/PromptsShow.js +17 -0
- package/dist/components/prompts/PromptsSubmit.d.ts +2 -0
- package/dist/components/prompts/PromptsSubmit.js +173 -0
- package/dist/components/prompts/config.d.ts +1 -0
- package/dist/components/prompts/config.js +1 -0
- package/dist/components/prompts/prompt-helpers.d.ts +8 -0
- package/dist/components/prompts/prompt-helpers.js +76 -0
- package/dist/components/prompts/prompt-types.d.ts +14 -0
- package/dist/components/prompts/prompt-types.js +0 -0
- package/dist/components/prompts/use-heart-animation.d.ts +5 -0
- package/dist/components/prompts/use-heart-animation.js +29 -0
- package/dist/components/team/TeamCards.d.ts +6 -0
- package/dist/components/team/TeamCards.js +19 -0
- package/dist/components/team/TitleTeamCards.d.ts +2 -0
- package/dist/components/team/TitleTeamCards.js +6 -0
- package/dist/components/team/TrustSection.d.ts +2 -0
- package/dist/components/team/TrustSection.js +59 -0
- package/dist/components/team.d.ts +3 -0
- package/dist/components/team.js +14 -0
- package/dist/components/template-modal-content.d.ts +5 -0
- package/dist/components/template-modal-content.js +73 -0
- package/dist/components/templates.d.ts +2 -0
- package/dist/components/templates.js +27 -0
- package/dist/design.js +1500 -1464
- package/dist/experts.js +1385 -1349
- package/dist/helpers/mobile-layout.d.ts +1 -0
- package/dist/helpers/mobile-layout.js +6 -0
- package/dist/helpers/use-el-size.d.ts +5 -0
- package/dist/helpers/use-el-size.js +40 -0
- package/dist/homepage/Pricing.js +1500 -1464
- package/dist/main.d.ts +1 -0
- package/dist/main.js +6 -0
- package/dist/prompts/PromptsGallery.js +1504 -1467
- package/dist/prompts/PromptsShow.js +1481 -1445
- package/dist/prompts/PromptsSubmit.js +1483 -1447
- package/dist/prompts-show.d.ts +1 -0
- package/dist/prompts-show.js +20 -0
- package/dist/prompts-submit.d.ts +1 -0
- package/dist/prompts-submit.js +6 -0
- package/dist/prompts.d.ts +1 -0
- package/dist/prompts.js +6 -0
- package/dist/tailwind.css +0 -3
- package/dist/team.d.ts +1 -0
- package/dist/team.js +1500 -1464
- package/dist/template-modal-content.js +1504 -1468
- package/dist/templates.js +1501 -1464
- package/package.json +13 -13
package/dist/homepage/Pricing.js
CHANGED
|
@@ -1375,7 +1375,7 @@ var getDefaultConfig = () => {
|
|
|
1375
1375
|
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
1376
1376
|
|
|
1377
1377
|
// ../design/dist/esm/index.mjs
|
|
1378
|
-
import
|
|
1378
|
+
import React2, { useEffect as useEffect18, useMemo as useMemo36, useState as useState20 } from "react";
|
|
1379
1379
|
|
|
1380
1380
|
// ../paths/dist/esm/index.mjs
|
|
1381
1381
|
var cutLInstruction = ({
|
|
@@ -5714,176 +5714,176 @@ var extrudeAndTransformElement = (options) => {
|
|
|
5714
5714
|
|
|
5715
5715
|
// ../core/dist/esm/index.mjs
|
|
5716
5716
|
import { createContext } from "react";
|
|
5717
|
-
import {
|
|
5717
|
+
import { Suspense, useContext as useContext9, useEffect as useEffect2 } from "react";
|
|
5718
|
+
import { createPortal } from "react-dom";
|
|
5719
|
+
import { createContext as createContext2 } from "react";
|
|
5718
5720
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
5721
|
+
import { createContext as createContext3 } from "react";
|
|
5722
|
+
import { createContext as createContext5, useContext as useContext2, useEffect, useMemo as useMemo2 } from "react";
|
|
5723
|
+
import { createContext as createContext4, useCallback, useContext, useMemo as useMemo3, useRef } from "react";
|
|
5724
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
5725
|
+
import { createContext as createContext6, useContext as useContext3 } from "react";
|
|
5726
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
5727
|
+
import { forwardRef, useMemo as useMemo32 } from "react";
|
|
5728
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
5729
|
+
import { jsx as jsx52, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
5730
|
+
import { createContext as createContext8, createRef, useContext as useContext5, useMemo as useMemo5 } from "react";
|
|
5731
|
+
import React3, { createContext as createContext7, useCallback as useCallback2, useMemo as useMemo4 } from "react";
|
|
5732
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
5733
|
+
import { useContext as useContext4, useState } from "react";
|
|
5734
|
+
import React4 from "react";
|
|
5735
|
+
import { createContext as createContext10, useCallback as useCallback3, useContext as useContext7 } from "react";
|
|
5736
|
+
import { createContext as createContext9 } from "react";
|
|
5737
|
+
import * as React5 from "react";
|
|
5738
|
+
import React6, { useMemo as useMemo6, useRef as useRef2 } from "react";
|
|
5739
|
+
import { useContext as useContext8, useMemo as useMemo7 } from "react";
|
|
5740
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
5719
5741
|
import {
|
|
5720
5742
|
forwardRef as forwardRef2,
|
|
5721
|
-
useContext as
|
|
5722
|
-
useEffect,
|
|
5723
|
-
useMemo as
|
|
5743
|
+
useContext as useContext15,
|
|
5744
|
+
useEffect as useEffect3,
|
|
5745
|
+
useMemo as useMemo13,
|
|
5724
5746
|
useState as useState4
|
|
5725
5747
|
} from "react";
|
|
5726
|
-
import {
|
|
5727
|
-
import {
|
|
5728
|
-
import { useContext as
|
|
5729
|
-
import { createContext as createContext3 } from "react";
|
|
5730
|
-
import { useContext as useContext7, useMemo as useMemo6 } from "react";
|
|
5748
|
+
import { useContext as useContext14, useMemo as useMemo11 } from "react";
|
|
5749
|
+
import { createContext as createContext11 } from "react";
|
|
5750
|
+
import { useContext as useContext10, useMemo as useMemo9 } from "react";
|
|
5731
5751
|
import {
|
|
5732
|
-
createContext as
|
|
5752
|
+
createContext as createContext12,
|
|
5733
5753
|
useLayoutEffect,
|
|
5734
|
-
useMemo as
|
|
5735
|
-
useRef,
|
|
5754
|
+
useMemo as useMemo8,
|
|
5755
|
+
useRef as useRef3,
|
|
5736
5756
|
useState as useState2
|
|
5737
5757
|
} from "react";
|
|
5738
|
-
import { createContext as createContext5, useCallback, useContext as useContext4 } from "react";
|
|
5739
|
-
import { createContext as createContext4 } from "react";
|
|
5740
|
-
import * as React2 from "react";
|
|
5741
|
-
import { useContext as useContext3, useState } from "react";
|
|
5742
|
-
import React3 from "react";
|
|
5743
|
-
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
5744
|
-
import { useContext as useContext6, useMemo as useMemo5 } from "react";
|
|
5745
|
-
import { createContext as createContext7 } from "react";
|
|
5746
|
-
import { createContext as createContext9, createRef, useContext as useContext5, useMemo as useMemo4 } from "react";
|
|
5747
|
-
import React5, { createContext as createContext8, useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
5748
|
-
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
5749
|
-
import { useContext as useContext8 } from "react";
|
|
5750
|
-
import { createContext as createContext10 } from "react";
|
|
5751
|
-
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
5752
|
-
import { useContext as useContext10 } from "react";
|
|
5753
|
-
import { useContext as useContext9, useMemo as useMemo7 } from "react";
|
|
5754
|
-
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
5755
|
-
import { createContext as createContext11, useCallback as useCallback3, useContext as useContext12, useMemo as useMemo9, useRef as useRef2 } from "react";
|
|
5756
|
-
import { createContext as createContext12 } from "react";
|
|
5757
|
-
import React8, { useCallback as useCallback4, useMemo as useMemo10, useRef as useRef3, useState as useState3 } from "react";
|
|
5758
|
-
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
5759
5758
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
5759
|
+
import { useContext as useContext11 } from "react";
|
|
5760
|
+
import { useContext as useContext13 } from "react";
|
|
5761
|
+
import { useContext as useContext12, useMemo as useMemo10 } from "react";
|
|
5762
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5763
|
+
import { createContext as createContext13 } from "react";
|
|
5764
|
+
import React10, { useCallback as useCallback4, useMemo as useMemo12, useRef as useRef4, useState as useState3 } from "react";
|
|
5765
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
5766
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
5760
5767
|
import {
|
|
5761
5768
|
forwardRef as forwardRef3,
|
|
5762
|
-
useEffect as
|
|
5769
|
+
useEffect as useEffect4,
|
|
5763
5770
|
useImperativeHandle as useImperativeHandle2,
|
|
5764
5771
|
useLayoutEffect as useLayoutEffect2,
|
|
5765
|
-
useRef as
|
|
5772
|
+
useRef as useRef6,
|
|
5766
5773
|
useState as useState5
|
|
5767
5774
|
} from "react";
|
|
5768
|
-
import
|
|
5769
|
-
import { jsx as
|
|
5770
|
-
import { jsx as
|
|
5771
|
-
import { useContext as
|
|
5775
|
+
import React12, { useCallback as useCallback5, useImperativeHandle, useRef as useRef5 } from "react";
|
|
5776
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5777
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
5778
|
+
import { useContext as useContext16, useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
|
|
5772
5779
|
import {
|
|
5773
|
-
createContext as
|
|
5780
|
+
createContext as createContext14,
|
|
5774
5781
|
useCallback as useCallback6,
|
|
5775
5782
|
useImperativeHandle as useImperativeHandle3,
|
|
5776
5783
|
useLayoutEffect as useLayoutEffect3,
|
|
5777
|
-
useMemo as
|
|
5778
|
-
useRef as
|
|
5784
|
+
useMemo as useMemo14,
|
|
5785
|
+
useRef as useRef7,
|
|
5779
5786
|
useState as useState6
|
|
5780
5787
|
} from "react";
|
|
5781
|
-
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
5782
|
-
import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext26 } from "react";
|
|
5783
|
-
import React11, { createContext as createContext14, useMemo as useMemo13 } from "react";
|
|
5784
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5785
|
-
import { useContext as useContext15 } from "react";
|
|
5786
|
-
import { createContext as createContext15, useEffect as useEffect3, useState as useState8 } from "react";
|
|
5787
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
5788
|
-
import { createContext as createContext16, useMemo as useMemo14, useReducer } from "react";
|
|
5789
5788
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
5790
|
-
import
|
|
5789
|
+
import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext28 } from "react";
|
|
5790
|
+
import React13, { createContext as createContext15, useMemo as useMemo15 } from "react";
|
|
5791
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
5792
|
+
import { useContext as useContext17 } from "react";
|
|
5793
|
+
import { createContext as createContext16, useEffect as useEffect5, useState as useState8 } from "react";
|
|
5794
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5795
|
+
import { createContext as createContext17, useMemo as useMemo16, useReducer } from "react";
|
|
5796
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5797
|
+
import React19, {
|
|
5791
5798
|
forwardRef as forwardRef4,
|
|
5792
|
-
useContext as
|
|
5793
|
-
useEffect as
|
|
5799
|
+
useContext as useContext26,
|
|
5800
|
+
useEffect as useEffect12,
|
|
5794
5801
|
useImperativeHandle as useImperativeHandle4,
|
|
5795
|
-
useMemo as
|
|
5796
|
-
useRef as
|
|
5802
|
+
useMemo as useMemo24,
|
|
5803
|
+
useRef as useRef15,
|
|
5797
5804
|
useState as useState13
|
|
5798
5805
|
} from "react";
|
|
5799
|
-
import { useContext as
|
|
5800
|
-
import
|
|
5801
|
-
createContext as
|
|
5806
|
+
import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useRef as useRef10 } from "react";
|
|
5807
|
+
import React16, {
|
|
5808
|
+
createContext as createContext18,
|
|
5802
5809
|
createRef as createRef2,
|
|
5803
5810
|
useCallback as useCallback7,
|
|
5804
|
-
useContext as
|
|
5805
|
-
useMemo as
|
|
5806
|
-
useRef as
|
|
5811
|
+
useContext as useContext18,
|
|
5812
|
+
useMemo as useMemo18,
|
|
5813
|
+
useRef as useRef8,
|
|
5807
5814
|
useState as useState9
|
|
5808
5815
|
} from "react";
|
|
5809
|
-
import { useMemo as
|
|
5810
|
-
import { jsx as
|
|
5811
|
-
import { useRef as
|
|
5812
|
-
import { useContext as
|
|
5813
|
-
import { useContext as
|
|
5816
|
+
import { useMemo as useMemo17 } from "react";
|
|
5817
|
+
import { jsx as jsx18, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5818
|
+
import { useRef as useRef9 } from "react";
|
|
5819
|
+
import { useContext as useContext21, useEffect as useEffect6, useMemo as useMemo19, useState as useState10 } from "react";
|
|
5820
|
+
import { useContext as useContext20 } from "react";
|
|
5814
5821
|
import {
|
|
5815
5822
|
useCallback as useCallback10,
|
|
5816
|
-
useContext as
|
|
5817
|
-
useEffect as
|
|
5823
|
+
useContext as useContext24,
|
|
5824
|
+
useEffect as useEffect10,
|
|
5818
5825
|
useLayoutEffect as useLayoutEffect7,
|
|
5819
|
-
useRef as
|
|
5826
|
+
useRef as useRef14
|
|
5820
5827
|
} from "react";
|
|
5821
|
-
import { useCallback as useCallback9, useMemo as
|
|
5822
|
-
import { useContext as
|
|
5823
|
-
import
|
|
5828
|
+
import { useCallback as useCallback9, useMemo as useMemo22, useRef as useRef12 } from "react";
|
|
5829
|
+
import { useContext as useContext23, useMemo as useMemo21 } from "react";
|
|
5830
|
+
import React17, {
|
|
5824
5831
|
useCallback as useCallback8,
|
|
5825
|
-
useContext as
|
|
5826
|
-
useEffect as
|
|
5832
|
+
useContext as useContext22,
|
|
5833
|
+
useEffect as useEffect7,
|
|
5827
5834
|
useLayoutEffect as useLayoutEffect6,
|
|
5828
|
-
useMemo as
|
|
5829
|
-
useRef as
|
|
5835
|
+
useMemo as useMemo20,
|
|
5836
|
+
useRef as useRef11,
|
|
5830
5837
|
useState as useState11
|
|
5831
5838
|
} from "react";
|
|
5832
|
-
import { jsx as
|
|
5833
|
-
import
|
|
5834
|
-
import { useEffect as
|
|
5835
|
-
import { useEffect as
|
|
5836
|
-
import { useEffect as
|
|
5837
|
-
import { createContext as
|
|
5838
|
-
import { jsx as
|
|
5839
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
5840
|
+
import React18 from "react";
|
|
5841
|
+
import { useEffect as useEffect8, useState as useState12 } from "react";
|
|
5842
|
+
import { useEffect as useEffect9, useRef as useRef13 } from "react";
|
|
5843
|
+
import { useEffect as useEffect11 } from "react";
|
|
5844
|
+
import { createContext as createContext19, useContext as useContext25, useMemo as useMemo23 } from "react";
|
|
5845
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
5839
5846
|
import {
|
|
5840
5847
|
forwardRef as forwardRef5,
|
|
5841
|
-
useContext as
|
|
5842
|
-
useEffect as
|
|
5848
|
+
useContext as useContext27,
|
|
5849
|
+
useEffect as useEffect13,
|
|
5843
5850
|
useImperativeHandle as useImperativeHandle5,
|
|
5844
5851
|
useLayoutEffect as useLayoutEffect8,
|
|
5845
|
-
useMemo as
|
|
5846
|
-
useRef as
|
|
5852
|
+
useMemo as useMemo25,
|
|
5853
|
+
useRef as useRef16
|
|
5847
5854
|
} from "react";
|
|
5848
|
-
import { jsx as
|
|
5849
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
5850
|
-
import { Suspense, useContext as useContext28, useEffect as useEffect13 } from "react";
|
|
5851
|
-
import { createPortal } from "react-dom";
|
|
5852
|
-
import { createContext as createContext19, useContext as useContext27, useEffect as useEffect12, useMemo as useMemo24 } from "react";
|
|
5853
|
-
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
5854
|
-
import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5855
|
-
import React20, { useMemo as useMemo25, useRef as useRef16 } from "react";
|
|
5855
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
5856
5856
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
5857
5857
|
import { forwardRef as forwardRef7, useCallback as useCallback12, useState as useState14 } from "react";
|
|
5858
5858
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5859
5859
|
import {
|
|
5860
|
-
forwardRef as forwardRef8,
|
|
5861
5860
|
useCallback as useCallback13,
|
|
5862
|
-
useContext as
|
|
5861
|
+
useContext as useContext30,
|
|
5863
5862
|
useImperativeHandle as useImperativeHandle6,
|
|
5864
5863
|
useLayoutEffect as useLayoutEffect9,
|
|
5865
5864
|
useRef as useRef17,
|
|
5866
|
-
useState as
|
|
5865
|
+
useState as useState16
|
|
5867
5866
|
} from "react";
|
|
5867
|
+
import React23, { forwardRef as forwardRef8, useMemo as useMemo27 } from "react";
|
|
5868
|
+
import { useContext as useContext29, useMemo as useMemo26, useState as useState15 } from "react";
|
|
5868
5869
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
5869
5870
|
import { createRef as createRef3 } from "react";
|
|
5870
|
-
import
|
|
5871
|
+
import React25 from "react";
|
|
5871
5872
|
import {
|
|
5872
5873
|
useCallback as useCallback14,
|
|
5873
5874
|
useImperativeHandle as useImperativeHandle7,
|
|
5874
|
-
useMemo as
|
|
5875
|
+
useMemo as useMemo28,
|
|
5875
5876
|
useRef as useRef18,
|
|
5876
|
-
useState as
|
|
5877
|
+
useState as useState17
|
|
5877
5878
|
} from "react";
|
|
5878
5879
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
5879
|
-
import
|
|
5880
|
-
import { useMemo as
|
|
5881
|
-
import { createContext as createContext20, useContext as
|
|
5880
|
+
import React26 from "react";
|
|
5881
|
+
import { useMemo as useMemo30 } from "react";
|
|
5882
|
+
import { createContext as createContext20, useContext as useContext31, useMemo as useMemo29 } from "react";
|
|
5882
5883
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
5883
5884
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
5884
|
-
import
|
|
5885
|
-
import
|
|
5886
|
-
import { useContext as useContext31, useMemo as useMemo29, useState as useState17 } from "react";
|
|
5885
|
+
import React28 from "react";
|
|
5886
|
+
import React29, { createContext as createContext21 } from "react";
|
|
5887
5887
|
import { useContext as useContext32 } from "react";
|
|
5888
5888
|
import { useCallback as useCallback16 } from "react";
|
|
5889
5889
|
import {
|
|
@@ -5891,34 +5891,33 @@ import {
|
|
|
5891
5891
|
useContext as useContext33,
|
|
5892
5892
|
useEffect as useEffect14,
|
|
5893
5893
|
useLayoutEffect as useLayoutEffect10,
|
|
5894
|
-
useMemo as
|
|
5894
|
+
useMemo as useMemo31,
|
|
5895
5895
|
useState as useState18
|
|
5896
5896
|
} from "react";
|
|
5897
5897
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
5898
|
-
import
|
|
5898
|
+
import React31, {
|
|
5899
5899
|
forwardRef as forwardRef9,
|
|
5900
5900
|
useContext as useContext34,
|
|
5901
5901
|
useEffect as useEffect16,
|
|
5902
5902
|
useImperativeHandle as useImperativeHandle8,
|
|
5903
|
-
useMemo as
|
|
5903
|
+
useMemo as useMemo322,
|
|
5904
5904
|
useRef as useRef19,
|
|
5905
5905
|
useState as useState19
|
|
5906
5906
|
} from "react";
|
|
5907
5907
|
import { useEffect as useEffect15 } from "react";
|
|
5908
5908
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
5909
5909
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
5910
|
-
import React32, { forwardRef as forwardRef10, useMemo as useMemo32 } from "react";
|
|
5911
5910
|
import React33, { useMemo as useMemo33 } from "react";
|
|
5912
5911
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
5913
|
-
import { Children, forwardRef as
|
|
5912
|
+
import { Children, forwardRef as forwardRef10, useMemo as useMemo34 } from "react";
|
|
5914
5913
|
import React34 from "react";
|
|
5915
5914
|
import React35, { createContext as createContext22 } from "react";
|
|
5916
5915
|
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
5917
5916
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
5918
5917
|
import React37 from "react";
|
|
5919
|
-
import { forwardRef as
|
|
5918
|
+
import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext36 } from "react";
|
|
5920
5919
|
import {
|
|
5921
|
-
forwardRef as
|
|
5920
|
+
forwardRef as forwardRef11,
|
|
5922
5921
|
useContext as useContext35,
|
|
5923
5922
|
useEffect as useEffect17,
|
|
5924
5923
|
useImperativeHandle as useImperativeHandle9,
|
|
@@ -5953,53 +5952,171 @@ if (typeof createContext !== "function") {
|
|
|
5953
5952
|
throw new Error(err.join(`
|
|
5954
5953
|
`));
|
|
5955
5954
|
}
|
|
5956
|
-
var
|
|
5957
|
-
var
|
|
5958
|
-
|
|
5959
|
-
componentsToAddStacksTo.push(component);
|
|
5960
|
-
};
|
|
5961
|
-
var IsPlayerContext = createContext2(false);
|
|
5962
|
-
var IsPlayerContextProvider = ({
|
|
5963
|
-
children
|
|
5964
|
-
}) => {
|
|
5965
|
-
return /* @__PURE__ */ jsx11(IsPlayerContext.Provider, {
|
|
5955
|
+
var CanUseRemotionHooks = createContext2(false);
|
|
5956
|
+
var CanUseRemotionHooksProvider = ({ children }) => {
|
|
5957
|
+
return /* @__PURE__ */ jsx11(CanUseRemotionHooks.Provider, {
|
|
5966
5958
|
value: true,
|
|
5967
5959
|
children
|
|
5968
5960
|
});
|
|
5969
5961
|
};
|
|
5970
|
-
var
|
|
5971
|
-
|
|
5962
|
+
var CompositionManager = createContext3({
|
|
5963
|
+
compositions: [],
|
|
5964
|
+
folders: [],
|
|
5965
|
+
currentCompositionMetadata: null,
|
|
5966
|
+
canvasContent: null
|
|
5967
|
+
});
|
|
5968
|
+
var CompositionSetters = createContext3({
|
|
5969
|
+
registerComposition: () => {
|
|
5970
|
+
return;
|
|
5971
|
+
},
|
|
5972
|
+
unregisterComposition: () => {
|
|
5973
|
+
return;
|
|
5974
|
+
},
|
|
5975
|
+
registerFolder: () => {
|
|
5976
|
+
return;
|
|
5977
|
+
},
|
|
5978
|
+
unregisterFolder: () => {
|
|
5979
|
+
return;
|
|
5980
|
+
},
|
|
5981
|
+
setCanvasContent: () => {
|
|
5982
|
+
return;
|
|
5983
|
+
},
|
|
5984
|
+
onlyRenderComposition: null
|
|
5985
|
+
});
|
|
5986
|
+
var NonceContext = createContext4({
|
|
5987
|
+
getNonce: () => 0
|
|
5988
|
+
});
|
|
5989
|
+
var fastRefreshNonce = 0;
|
|
5990
|
+
try {
|
|
5991
|
+
if (typeof __webpack_module__ !== "undefined") {
|
|
5992
|
+
if (__webpack_module__.hot) {
|
|
5993
|
+
__webpack_module__.hot.addStatusHandler((status) => {
|
|
5994
|
+
if (status === "idle") {
|
|
5995
|
+
fastRefreshNonce++;
|
|
5996
|
+
}
|
|
5997
|
+
});
|
|
5998
|
+
}
|
|
5999
|
+
}
|
|
6000
|
+
} catch {}
|
|
6001
|
+
var useNonce = () => {
|
|
6002
|
+
const context = useContext(NonceContext);
|
|
6003
|
+
const nonce = context.getNonce();
|
|
6004
|
+
const nonceRef = useRef(nonce);
|
|
6005
|
+
nonceRef.current = nonce;
|
|
6006
|
+
const history = useRef([[fastRefreshNonce, nonce]]);
|
|
6007
|
+
const get = useCallback(() => {
|
|
6008
|
+
if (fastRefreshNonce !== history.current[history.current.length - 1][0]) {
|
|
6009
|
+
history.current = [
|
|
6010
|
+
...history.current,
|
|
6011
|
+
[fastRefreshNonce, nonceRef.current]
|
|
6012
|
+
];
|
|
6013
|
+
}
|
|
6014
|
+
return history.current;
|
|
6015
|
+
}, [history]);
|
|
6016
|
+
return useMemo3(() => {
|
|
6017
|
+
return { get };
|
|
6018
|
+
}, [get]);
|
|
5972
6019
|
};
|
|
5973
6020
|
function truthy2(value) {
|
|
5974
6021
|
return Boolean(value);
|
|
5975
6022
|
}
|
|
5976
|
-
var
|
|
5977
|
-
var
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
6023
|
+
var getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
6024
|
+
var invalidFolderNameErrorMessage = `Folder name must match ${String(getRegex())}`;
|
|
6025
|
+
var FolderContext = createContext5({
|
|
6026
|
+
folderName: null,
|
|
6027
|
+
parentName: null
|
|
6028
|
+
});
|
|
6029
|
+
function getNodeEnvString() {
|
|
6030
|
+
return ["NOD", "E_EN", "V"].join("");
|
|
6031
|
+
}
|
|
6032
|
+
var getEnvString = () => {
|
|
6033
|
+
return ["e", "nv"].join("");
|
|
6034
|
+
};
|
|
6035
|
+
var getRemotionEnvironment = () => {
|
|
6036
|
+
const isPlayer = typeof window !== "undefined" && window.remotion_isPlayer;
|
|
6037
|
+
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");
|
|
6038
|
+
const isStudio = typeof window !== "undefined" && window.remotion_isStudio;
|
|
6039
|
+
const isReadOnlyStudio = typeof window !== "undefined" && window.remotion_isReadOnlyStudio;
|
|
6040
|
+
return {
|
|
6041
|
+
isStudio,
|
|
6042
|
+
isRendering,
|
|
6043
|
+
isPlayer,
|
|
6044
|
+
isReadOnlyStudio,
|
|
6045
|
+
isClientSideRendering: false
|
|
5986
6046
|
};
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
6047
|
+
};
|
|
6048
|
+
var DATE_TOKEN = "remotion-date:";
|
|
6049
|
+
var FILE_TOKEN = "remotion-file:";
|
|
6050
|
+
var serializeJSONWithSpecialTypes = ({
|
|
6051
|
+
data,
|
|
6052
|
+
indent,
|
|
6053
|
+
staticBase
|
|
6054
|
+
}) => {
|
|
6055
|
+
let customDateUsed = false;
|
|
6056
|
+
let customFileUsed = false;
|
|
6057
|
+
let mapUsed = false;
|
|
6058
|
+
let setUsed = false;
|
|
6059
|
+
try {
|
|
6060
|
+
const serializedString = JSON.stringify(data, function(key, value) {
|
|
6061
|
+
const item = this[key];
|
|
6062
|
+
if (item instanceof Date) {
|
|
6063
|
+
customDateUsed = true;
|
|
6064
|
+
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
6065
|
+
}
|
|
6066
|
+
if (item instanceof Map) {
|
|
6067
|
+
mapUsed = true;
|
|
6068
|
+
return value;
|
|
6069
|
+
}
|
|
6070
|
+
if (item instanceof Set) {
|
|
6071
|
+
setUsed = true;
|
|
6072
|
+
return value;
|
|
6073
|
+
}
|
|
6074
|
+
if (typeof item === "string" && staticBase !== null && item.startsWith(staticBase)) {
|
|
6075
|
+
customFileUsed = true;
|
|
6076
|
+
return `${FILE_TOKEN}${item.replace(staticBase + "/", "")}`;
|
|
6077
|
+
}
|
|
6078
|
+
return value;
|
|
6079
|
+
}, indent);
|
|
6080
|
+
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
6081
|
+
} catch (err) {
|
|
6082
|
+
throw new Error("Could not serialize the passed input props to JSON: " + err.message);
|
|
6083
|
+
}
|
|
6084
|
+
};
|
|
6085
|
+
var deserializeJSONWithSpecialTypes = (data) => {
|
|
6086
|
+
return JSON.parse(data, (_, value) => {
|
|
6087
|
+
if (typeof value === "string" && value.startsWith(DATE_TOKEN)) {
|
|
6088
|
+
return new Date(value.replace(DATE_TOKEN, ""));
|
|
5991
6089
|
}
|
|
5992
|
-
if (typeof
|
|
5993
|
-
|
|
5994
|
-
return;
|
|
6090
|
+
if (typeof value === "string" && value.startsWith(FILE_TOKEN)) {
|
|
6091
|
+
return `${window.remotion_staticBase}/${value.replace(FILE_TOKEN, "")}`;
|
|
5995
6092
|
}
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6093
|
+
return value;
|
|
6094
|
+
});
|
|
6095
|
+
};
|
|
6096
|
+
var serializeThenDeserialize = (props) => {
|
|
6097
|
+
return deserializeJSONWithSpecialTypes(serializeJSONWithSpecialTypes({
|
|
6098
|
+
data: props,
|
|
6099
|
+
indent: 2,
|
|
6100
|
+
staticBase: window.remotion_staticBase
|
|
6101
|
+
}).serializedString);
|
|
6102
|
+
};
|
|
6103
|
+
var serializeThenDeserializeInStudio = (props) => {
|
|
6104
|
+
if (getRemotionEnvironment().isStudio) {
|
|
6105
|
+
return serializeThenDeserialize(props);
|
|
6001
6106
|
}
|
|
6002
|
-
|
|
6107
|
+
return props;
|
|
6108
|
+
};
|
|
6109
|
+
var IsPlayerContext = createContext6(false);
|
|
6110
|
+
var IsPlayerContextProvider = ({
|
|
6111
|
+
children
|
|
6112
|
+
}) => {
|
|
6113
|
+
return /* @__PURE__ */ jsx32(IsPlayerContext.Provider, {
|
|
6114
|
+
value: true,
|
|
6115
|
+
children
|
|
6116
|
+
});
|
|
6117
|
+
};
|
|
6118
|
+
var useIsPlayer = () => {
|
|
6119
|
+
return useContext3(IsPlayerContext);
|
|
6003
6120
|
};
|
|
6004
6121
|
var hasTailwindClassName = ({
|
|
6005
6122
|
className,
|
|
@@ -6023,7 +6140,7 @@ var hasTailwindClassName = ({
|
|
|
6023
6140
|
};
|
|
6024
6141
|
var AbsoluteFillRefForwarding = (props, ref) => {
|
|
6025
6142
|
const { style, ...other } = props;
|
|
6026
|
-
const actualStyle =
|
|
6143
|
+
const actualStyle = useMemo32(() => {
|
|
6027
6144
|
return {
|
|
6028
6145
|
position: "absolute",
|
|
6029
6146
|
top: hasTailwindClassName({
|
|
@@ -6086,168 +6203,402 @@ var AbsoluteFillRefForwarding = (props, ref) => {
|
|
|
6086
6203
|
...style
|
|
6087
6204
|
};
|
|
6088
6205
|
}, [other.className, style]);
|
|
6089
|
-
return /* @__PURE__ */
|
|
6206
|
+
return /* @__PURE__ */ jsx42("div", {
|
|
6090
6207
|
ref,
|
|
6091
6208
|
style: actualStyle,
|
|
6092
6209
|
...other
|
|
6093
6210
|
});
|
|
6094
6211
|
};
|
|
6095
6212
|
var AbsoluteFill = forwardRef(AbsoluteFillRefForwarding);
|
|
6096
|
-
var
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
}
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6213
|
+
var rotate = {
|
|
6214
|
+
transform: `rotate(90deg)`
|
|
6215
|
+
};
|
|
6216
|
+
var ICON_SIZE = 40;
|
|
6217
|
+
var label = {
|
|
6218
|
+
color: "white",
|
|
6219
|
+
fontSize: 14,
|
|
6220
|
+
fontFamily: "sans-serif"
|
|
6221
|
+
};
|
|
6222
|
+
var container = {
|
|
6223
|
+
justifyContent: "center",
|
|
6224
|
+
alignItems: "center"
|
|
6225
|
+
};
|
|
6226
|
+
var Loading = () => {
|
|
6227
|
+
return /* @__PURE__ */ jsxs2(AbsoluteFill, {
|
|
6228
|
+
style: container,
|
|
6229
|
+
id: "remotion-comp-loading",
|
|
6230
|
+
children: [
|
|
6231
|
+
/* @__PURE__ */ jsx52("style", {
|
|
6232
|
+
type: "text/css",
|
|
6233
|
+
children: `
|
|
6234
|
+
@keyframes anim {
|
|
6235
|
+
from {
|
|
6236
|
+
opacity: 0
|
|
6237
|
+
}
|
|
6238
|
+
to {
|
|
6239
|
+
opacity: 1
|
|
6240
|
+
}
|
|
6241
|
+
}
|
|
6242
|
+
#remotion-comp-loading {
|
|
6243
|
+
animation: anim 2s;
|
|
6244
|
+
animation-fill-mode: forwards;
|
|
6245
|
+
}
|
|
6246
|
+
`
|
|
6247
|
+
}),
|
|
6248
|
+
/* @__PURE__ */ jsx52("svg", {
|
|
6249
|
+
width: ICON_SIZE,
|
|
6250
|
+
height: ICON_SIZE,
|
|
6251
|
+
viewBox: "-100 -100 400 400",
|
|
6252
|
+
style: rotate,
|
|
6253
|
+
children: /* @__PURE__ */ jsx52("path", {
|
|
6254
|
+
fill: "#555",
|
|
6255
|
+
stroke: "#555",
|
|
6256
|
+
strokeWidth: "100",
|
|
6257
|
+
strokeLinejoin: "round",
|
|
6258
|
+
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"
|
|
6259
|
+
})
|
|
6260
|
+
}),
|
|
6261
|
+
/* @__PURE__ */ jsxs2("p", {
|
|
6262
|
+
style: label,
|
|
6263
|
+
children: [
|
|
6264
|
+
"Resolving ",
|
|
6265
|
+
"<Suspense>",
|
|
6266
|
+
"..."
|
|
6267
|
+
]
|
|
6268
|
+
})
|
|
6269
|
+
]
|
|
6270
|
+
});
|
|
6271
|
+
};
|
|
6272
|
+
var _portalNode = null;
|
|
6273
|
+
var portalNode = () => {
|
|
6274
|
+
if (!_portalNode) {
|
|
6275
|
+
if (typeof document === "undefined") {
|
|
6276
|
+
throw new Error("Tried to call an API that only works in the browser from outside the browser");
|
|
6277
|
+
}
|
|
6278
|
+
_portalNode = document.createElement("div");
|
|
6279
|
+
_portalNode.style.position = "absolute";
|
|
6280
|
+
_portalNode.style.top = "0px";
|
|
6281
|
+
_portalNode.style.left = "0px";
|
|
6282
|
+
_portalNode.style.right = "0px";
|
|
6283
|
+
_portalNode.style.bottom = "0px";
|
|
6284
|
+
_portalNode.style.width = "100%";
|
|
6285
|
+
_portalNode.style.height = "100%";
|
|
6286
|
+
_portalNode.style.display = "flex";
|
|
6287
|
+
_portalNode.style.flexDirection = "column";
|
|
6288
|
+
const containerNode = document.createElement("div");
|
|
6289
|
+
containerNode.style.position = "fixed";
|
|
6290
|
+
containerNode.style.top = -999999 + "px";
|
|
6291
|
+
containerNode.appendChild(_portalNode);
|
|
6292
|
+
document.body.appendChild(containerNode);
|
|
6137
6293
|
}
|
|
6138
|
-
|
|
6294
|
+
return _portalNode;
|
|
6139
6295
|
};
|
|
6140
|
-
var
|
|
6141
|
-
|
|
6142
|
-
return stack.startsWith("Error:") ? stack : `${error.message}
|
|
6143
|
-
${stack}`;
|
|
6296
|
+
var getKey = () => {
|
|
6297
|
+
return `remotion_inputPropsOverride` + window.location.origin;
|
|
6144
6298
|
};
|
|
6145
|
-
var
|
|
6146
|
-
if (
|
|
6147
|
-
return
|
|
6299
|
+
var getInputPropsOverride = () => {
|
|
6300
|
+
if (typeof localStorage === "undefined")
|
|
6301
|
+
return null;
|
|
6302
|
+
const override = localStorage.getItem(getKey());
|
|
6303
|
+
if (!override)
|
|
6304
|
+
return null;
|
|
6305
|
+
return JSON.parse(override);
|
|
6306
|
+
};
|
|
6307
|
+
var setInputPropsOverride = (override) => {
|
|
6308
|
+
if (typeof localStorage === "undefined")
|
|
6309
|
+
return;
|
|
6310
|
+
if (override === null) {
|
|
6311
|
+
localStorage.removeItem(getKey());
|
|
6312
|
+
return;
|
|
6148
6313
|
}
|
|
6149
|
-
|
|
6150
|
-
|
|
6314
|
+
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
6315
|
+
};
|
|
6316
|
+
var didWarnSSRImport = false;
|
|
6317
|
+
var warnOnceSSRImport = () => {
|
|
6318
|
+
if (didWarnSSRImport) {
|
|
6319
|
+
return;
|
|
6151
6320
|
}
|
|
6152
|
-
|
|
6153
|
-
|
|
6321
|
+
didWarnSSRImport = true;
|
|
6322
|
+
console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.");
|
|
6323
|
+
console.warn("To hide this warning, don't call this function on the server:");
|
|
6324
|
+
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
6325
|
+
};
|
|
6326
|
+
var getInputProps = () => {
|
|
6327
|
+
if (typeof window === "undefined") {
|
|
6328
|
+
warnOnceSSRImport();
|
|
6329
|
+
return {};
|
|
6154
6330
|
}
|
|
6155
|
-
if (
|
|
6156
|
-
|
|
6331
|
+
if (getRemotionEnvironment().isPlayer) {
|
|
6332
|
+
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.");
|
|
6157
6333
|
}
|
|
6158
|
-
|
|
6159
|
-
|
|
6334
|
+
const override = getInputPropsOverride();
|
|
6335
|
+
if (override) {
|
|
6336
|
+
return override;
|
|
6160
6337
|
}
|
|
6161
|
-
if (
|
|
6162
|
-
|
|
6338
|
+
if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
|
|
6339
|
+
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.");
|
|
6163
6340
|
}
|
|
6164
|
-
|
|
6165
|
-
|
|
6341
|
+
const param = window.remotion_inputProps;
|
|
6342
|
+
if (!param) {
|
|
6343
|
+
return {};
|
|
6166
6344
|
}
|
|
6167
|
-
|
|
6345
|
+
const parsed = deserializeJSONWithSpecialTypes(param);
|
|
6346
|
+
return parsed;
|
|
6168
6347
|
};
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
if (!error.stack) {
|
|
6174
|
-
error.stack = new Error(error.message).stack;
|
|
6175
|
-
}
|
|
6176
|
-
} else if (typeof err === "string") {
|
|
6177
|
-
error = Error(err);
|
|
6178
|
-
} else {
|
|
6179
|
-
error = Error("Rendering was cancelled");
|
|
6180
|
-
}
|
|
6181
|
-
if (scope) {
|
|
6182
|
-
scope.remotion_cancelledError = getErrorStackWithMessage(error);
|
|
6348
|
+
var EditorPropsContext = createContext7({
|
|
6349
|
+
props: {},
|
|
6350
|
+
updateProps: () => {
|
|
6351
|
+
throw new Error("Not implemented");
|
|
6183
6352
|
}
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
};
|
|
6207
|
-
};
|
|
6208
|
-
var logLevels = ["trace", "verbose", "info", "warn", "error"];
|
|
6209
|
-
var getNumberForLogLevel = (level) => {
|
|
6210
|
-
return logLevels.indexOf(level);
|
|
6353
|
+
});
|
|
6354
|
+
var timeValueRef = React3.createRef();
|
|
6355
|
+
var EditorPropsProvider = ({ children }) => {
|
|
6356
|
+
const [props, setProps] = React3.useState({});
|
|
6357
|
+
const updateProps = useCallback2(({
|
|
6358
|
+
defaultProps,
|
|
6359
|
+
id,
|
|
6360
|
+
newProps
|
|
6361
|
+
}) => {
|
|
6362
|
+
setProps((prev) => {
|
|
6363
|
+
return {
|
|
6364
|
+
...prev,
|
|
6365
|
+
[id]: typeof newProps === "function" ? newProps(prev[id] ?? defaultProps) : newProps
|
|
6366
|
+
};
|
|
6367
|
+
});
|
|
6368
|
+
}, []);
|
|
6369
|
+
const ctx = useMemo4(() => {
|
|
6370
|
+
return { props, updateProps };
|
|
6371
|
+
}, [props, updateProps]);
|
|
6372
|
+
return /* @__PURE__ */ jsx62(EditorPropsContext.Provider, {
|
|
6373
|
+
value: ctx,
|
|
6374
|
+
children
|
|
6375
|
+
});
|
|
6211
6376
|
};
|
|
6212
|
-
var
|
|
6213
|
-
|
|
6377
|
+
var RemotionEnvironmentContext = React4.createContext(null);
|
|
6378
|
+
var useRemotionEnvironment = () => {
|
|
6379
|
+
const context = useContext4(RemotionEnvironmentContext);
|
|
6380
|
+
const [env] = useState(() => getRemotionEnvironment());
|
|
6381
|
+
return context ?? env;
|
|
6214
6382
|
};
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
tag
|
|
6219
|
-
}) => {
|
|
6220
|
-
const arr = [...args];
|
|
6221
|
-
if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6222
|
-
arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
|
|
6223
|
-
}
|
|
6224
|
-
if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6225
|
-
arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
|
|
6383
|
+
function validateDimension(amount, nameOfProp, location) {
|
|
6384
|
+
if (typeof amount !== "number") {
|
|
6385
|
+
throw new Error(`The "${nameOfProp}" prop ${location} must be a number, but you passed a value of type ${typeof amount}`);
|
|
6226
6386
|
}
|
|
6227
|
-
|
|
6228
|
-
};
|
|
6229
|
-
var verbose = (options, ...args) => {
|
|
6230
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
|
|
6231
|
-
return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
|
|
6387
|
+
if (isNaN(amount)) {
|
|
6388
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must not be NaN, but is NaN.`);
|
|
6232
6389
|
}
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
6236
|
-
return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
|
|
6390
|
+
if (!Number.isFinite(amount)) {
|
|
6391
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be finite, but is ${amount}.`);
|
|
6237
6392
|
}
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
|
|
6241
|
-
return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
|
|
6393
|
+
if (amount % 1 !== 0) {
|
|
6394
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be an integer, but is ${amount}.`);
|
|
6242
6395
|
}
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
|
|
6246
|
-
return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
|
|
6396
|
+
if (amount <= 0) {
|
|
6397
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be positive, but got ${amount}.`);
|
|
6247
6398
|
}
|
|
6248
|
-
}
|
|
6249
|
-
|
|
6250
|
-
|
|
6399
|
+
}
|
|
6400
|
+
function validateDurationInFrames(durationInFrames, options) {
|
|
6401
|
+
const { allowFloats, component } = options;
|
|
6402
|
+
if (typeof durationInFrames === "undefined") {
|
|
6403
|
+
throw new Error(`The "durationInFrames" prop ${component} is missing.`);
|
|
6404
|
+
}
|
|
6405
|
+
if (typeof durationInFrames !== "number") {
|
|
6406
|
+
throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
|
|
6407
|
+
}
|
|
6408
|
+
if (durationInFrames <= 0) {
|
|
6409
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
6410
|
+
}
|
|
6411
|
+
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
6412
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
6413
|
+
}
|
|
6414
|
+
if (!Number.isFinite(durationInFrames)) {
|
|
6415
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
6416
|
+
}
|
|
6417
|
+
}
|
|
6418
|
+
function validateFps(fps, location, isGif) {
|
|
6419
|
+
if (typeof fps !== "number") {
|
|
6420
|
+
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
6421
|
+
}
|
|
6422
|
+
if (!Number.isFinite(fps)) {
|
|
6423
|
+
throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
|
|
6424
|
+
}
|
|
6425
|
+
if (isNaN(fps)) {
|
|
6426
|
+
throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
|
|
6427
|
+
}
|
|
6428
|
+
if (fps <= 0) {
|
|
6429
|
+
throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
|
|
6430
|
+
}
|
|
6431
|
+
if (isGif && fps > 50) {
|
|
6432
|
+
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`);
|
|
6433
|
+
}
|
|
6434
|
+
}
|
|
6435
|
+
var ResolveCompositionContext = createContext8(null);
|
|
6436
|
+
var resolveCompositionsRef = createRef();
|
|
6437
|
+
var needsResolution = (composition) => {
|
|
6438
|
+
return Boolean(composition.calculateMetadata);
|
|
6439
|
+
};
|
|
6440
|
+
var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
6441
|
+
const context = useContext5(ResolveCompositionContext);
|
|
6442
|
+
const { props: allEditorProps } = useContext5(EditorPropsContext);
|
|
6443
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext5(CompositionManager);
|
|
6444
|
+
const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
6445
|
+
const compositionId = preferredCompositionId ?? currentComposition;
|
|
6446
|
+
const composition = compositions.find((c) => c.id === compositionId);
|
|
6447
|
+
const selectedEditorProps = useMemo5(() => {
|
|
6448
|
+
return composition ? allEditorProps[composition.id] ?? {} : {};
|
|
6449
|
+
}, [allEditorProps, composition]);
|
|
6450
|
+
const env = useRemotionEnvironment();
|
|
6451
|
+
return useMemo5(() => {
|
|
6452
|
+
if (!composition) {
|
|
6453
|
+
return null;
|
|
6454
|
+
}
|
|
6455
|
+
if (currentCompositionMetadata) {
|
|
6456
|
+
return {
|
|
6457
|
+
type: "success",
|
|
6458
|
+
result: {
|
|
6459
|
+
...currentCompositionMetadata,
|
|
6460
|
+
id: composition.id,
|
|
6461
|
+
defaultProps: composition.defaultProps ?? {}
|
|
6462
|
+
}
|
|
6463
|
+
};
|
|
6464
|
+
}
|
|
6465
|
+
if (!needsResolution(composition)) {
|
|
6466
|
+
validateDurationInFrames(composition.durationInFrames, {
|
|
6467
|
+
allowFloats: false,
|
|
6468
|
+
component: `in <Composition id="${composition.id}">`
|
|
6469
|
+
});
|
|
6470
|
+
validateFps(composition.fps, `in <Composition id="${composition.id}">`, false);
|
|
6471
|
+
validateDimension(composition.width, "width", `in <Composition id="${composition.id}">`);
|
|
6472
|
+
validateDimension(composition.height, "height", `in <Composition id="${composition.id}">`);
|
|
6473
|
+
return {
|
|
6474
|
+
type: "success",
|
|
6475
|
+
result: {
|
|
6476
|
+
width: composition.width,
|
|
6477
|
+
height: composition.height,
|
|
6478
|
+
fps: composition.fps,
|
|
6479
|
+
id: composition.id,
|
|
6480
|
+
durationInFrames: composition.durationInFrames,
|
|
6481
|
+
defaultProps: composition.defaultProps ?? {},
|
|
6482
|
+
props: {
|
|
6483
|
+
...composition.defaultProps ?? {},
|
|
6484
|
+
...selectedEditorProps ?? {},
|
|
6485
|
+
...typeof window === "undefined" || env.isPlayer || !window.remotion_inputProps ? {} : getInputProps() ?? {}
|
|
6486
|
+
},
|
|
6487
|
+
defaultCodec: null,
|
|
6488
|
+
defaultOutName: null,
|
|
6489
|
+
defaultVideoImageFormat: null,
|
|
6490
|
+
defaultPixelFormat: null,
|
|
6491
|
+
defaultProResProfile: null
|
|
6492
|
+
}
|
|
6493
|
+
};
|
|
6494
|
+
}
|
|
6495
|
+
if (!context) {
|
|
6496
|
+
return null;
|
|
6497
|
+
}
|
|
6498
|
+
if (!context[composition.id]) {
|
|
6499
|
+
return null;
|
|
6500
|
+
}
|
|
6501
|
+
return context[composition.id];
|
|
6502
|
+
}, [
|
|
6503
|
+
composition,
|
|
6504
|
+
context,
|
|
6505
|
+
currentCompositionMetadata,
|
|
6506
|
+
selectedEditorProps,
|
|
6507
|
+
env.isPlayer
|
|
6508
|
+
]);
|
|
6509
|
+
};
|
|
6510
|
+
var getErrorStackWithMessage = (error) => {
|
|
6511
|
+
const stack = error.stack ?? "";
|
|
6512
|
+
return stack.startsWith("Error:") ? stack : `${error.message}
|
|
6513
|
+
${stack}`;
|
|
6514
|
+
};
|
|
6515
|
+
var isErrorLike = (err) => {
|
|
6516
|
+
if (err instanceof Error) {
|
|
6517
|
+
return true;
|
|
6518
|
+
}
|
|
6519
|
+
if (err === null) {
|
|
6520
|
+
return false;
|
|
6521
|
+
}
|
|
6522
|
+
if (typeof err !== "object") {
|
|
6523
|
+
return false;
|
|
6524
|
+
}
|
|
6525
|
+
if (!("stack" in err)) {
|
|
6526
|
+
return false;
|
|
6527
|
+
}
|
|
6528
|
+
if (typeof err.stack !== "string") {
|
|
6529
|
+
return false;
|
|
6530
|
+
}
|
|
6531
|
+
if (!("message" in err)) {
|
|
6532
|
+
return false;
|
|
6533
|
+
}
|
|
6534
|
+
if (typeof err.message !== "string") {
|
|
6535
|
+
return false;
|
|
6536
|
+
}
|
|
6537
|
+
return true;
|
|
6538
|
+
};
|
|
6539
|
+
function cancelRenderInternal(scope, err) {
|
|
6540
|
+
let error;
|
|
6541
|
+
if (isErrorLike(err)) {
|
|
6542
|
+
error = err;
|
|
6543
|
+
if (!error.stack) {
|
|
6544
|
+
error.stack = new Error(error.message).stack;
|
|
6545
|
+
}
|
|
6546
|
+
} else if (typeof err === "string") {
|
|
6547
|
+
error = Error(err);
|
|
6548
|
+
} else {
|
|
6549
|
+
error = Error("Rendering was cancelled");
|
|
6550
|
+
}
|
|
6551
|
+
if (scope) {
|
|
6552
|
+
scope.remotion_cancelledError = getErrorStackWithMessage(error);
|
|
6553
|
+
}
|
|
6554
|
+
throw error;
|
|
6555
|
+
}
|
|
6556
|
+
function cancelRender(err) {
|
|
6557
|
+
return cancelRenderInternal(typeof window !== "undefined" ? window : undefined, err);
|
|
6558
|
+
}
|
|
6559
|
+
var logLevels = ["trace", "verbose", "info", "warn", "error"];
|
|
6560
|
+
var getNumberForLogLevel = (level) => {
|
|
6561
|
+
return logLevels.indexOf(level);
|
|
6562
|
+
};
|
|
6563
|
+
var isEqualOrBelowLogLevel = (currentLevel, level) => {
|
|
6564
|
+
return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
|
|
6565
|
+
};
|
|
6566
|
+
var transformArgs = ({
|
|
6567
|
+
args,
|
|
6568
|
+
logLevel,
|
|
6569
|
+
tag
|
|
6570
|
+
}) => {
|
|
6571
|
+
const arr = [...args];
|
|
6572
|
+
if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6573
|
+
arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
|
|
6574
|
+
}
|
|
6575
|
+
if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6576
|
+
arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
|
|
6577
|
+
}
|
|
6578
|
+
return arr;
|
|
6579
|
+
};
|
|
6580
|
+
var verbose = (options, ...args) => {
|
|
6581
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
|
|
6582
|
+
return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
|
|
6583
|
+
}
|
|
6584
|
+
};
|
|
6585
|
+
var trace = (options, ...args) => {
|
|
6586
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
6587
|
+
return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
|
|
6588
|
+
}
|
|
6589
|
+
};
|
|
6590
|
+
var info = (options, ...args) => {
|
|
6591
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
|
|
6592
|
+
return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
|
|
6593
|
+
}
|
|
6594
|
+
};
|
|
6595
|
+
var warn = (options, ...args) => {
|
|
6596
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
|
|
6597
|
+
return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
|
|
6598
|
+
}
|
|
6599
|
+
};
|
|
6600
|
+
var error = (options, ...args) => {
|
|
6601
|
+
return console.error(...transformArgs({ args, logLevel: "error", tag: options.tag }));
|
|
6251
6602
|
};
|
|
6252
6603
|
var Log = {
|
|
6253
6604
|
trace,
|
|
@@ -6271,11 +6622,11 @@ var defaultTimeout = 30000;
|
|
|
6271
6622
|
var delayRenderInternal = ({
|
|
6272
6623
|
scope,
|
|
6273
6624
|
environment,
|
|
6274
|
-
label,
|
|
6625
|
+
label: label2,
|
|
6275
6626
|
options
|
|
6276
6627
|
}) => {
|
|
6277
|
-
if (typeof
|
|
6278
|
-
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(
|
|
6628
|
+
if (typeof label2 !== "string" && label2 !== null) {
|
|
6629
|
+
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label2));
|
|
6279
6630
|
}
|
|
6280
6631
|
const handle = Math.random();
|
|
6281
6632
|
scope.remotion_delayRenderHandles.push(handle);
|
|
@@ -6284,12 +6635,12 @@ var delayRenderInternal = ({
|
|
|
6284
6635
|
const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
|
|
6285
6636
|
const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
|
|
6286
6637
|
scope.remotion_delayRenderTimeouts[handle] = {
|
|
6287
|
-
label:
|
|
6638
|
+
label: label2 ?? null,
|
|
6288
6639
|
startTime: Date.now(),
|
|
6289
6640
|
timeout: setTimeout(() => {
|
|
6290
6641
|
const message = [
|
|
6291
6642
|
`A delayRender()`,
|
|
6292
|
-
|
|
6643
|
+
label2 ? `"${label2}"` : null,
|
|
6293
6644
|
`was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
|
|
6294
6645
|
retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
|
|
6295
6646
|
retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
|
|
@@ -6325,10 +6676,10 @@ var continueRenderInternal = ({
|
|
|
6325
6676
|
if (!scope.remotion_delayRenderTimeouts[handle]) {
|
|
6326
6677
|
return false;
|
|
6327
6678
|
}
|
|
6328
|
-
const { label, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
|
|
6679
|
+
const { label: label2, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
|
|
6329
6680
|
clearTimeout(timeout);
|
|
6330
6681
|
const message = [
|
|
6331
|
-
|
|
6682
|
+
label2 ? `"${label2}"` : "A handle",
|
|
6332
6683
|
DELAY_RENDER_CLEAR_TOKEN,
|
|
6333
6684
|
`${Date.now() - startTime}ms`
|
|
6334
6685
|
].filter(truthy2).join(" ");
|
|
@@ -6343,47 +6694,41 @@ var continueRenderInternal = ({
|
|
|
6343
6694
|
scope.remotion_renderReady = true;
|
|
6344
6695
|
}
|
|
6345
6696
|
};
|
|
6346
|
-
var LogLevelContext =
|
|
6697
|
+
var LogLevelContext = createContext9({
|
|
6347
6698
|
logLevel: "info",
|
|
6348
6699
|
mountTime: 0
|
|
6349
6700
|
});
|
|
6350
6701
|
var useLogLevel = () => {
|
|
6351
|
-
const { logLevel } =
|
|
6702
|
+
const { logLevel } = React5.useContext(LogLevelContext);
|
|
6352
6703
|
if (logLevel === null) {
|
|
6353
6704
|
throw new Error("useLogLevel must be used within a LogLevelProvider");
|
|
6354
6705
|
}
|
|
6355
6706
|
return logLevel;
|
|
6356
6707
|
};
|
|
6357
6708
|
var useMountTime = () => {
|
|
6358
|
-
const { mountTime } =
|
|
6709
|
+
const { mountTime } = React5.useContext(LogLevelContext);
|
|
6359
6710
|
if (mountTime === null) {
|
|
6360
6711
|
throw new Error("useMountTime must be used within a LogLevelProvider");
|
|
6361
6712
|
}
|
|
6362
6713
|
return mountTime;
|
|
6363
6714
|
};
|
|
6364
|
-
var
|
|
6365
|
-
var useRemotionEnvironment = () => {
|
|
6366
|
-
const context = useContext3(RemotionEnvironmentContext);
|
|
6367
|
-
const [env] = useState(() => getRemotionEnvironment());
|
|
6368
|
-
return context ?? env;
|
|
6369
|
-
};
|
|
6370
|
-
var DelayRenderContextType = createContext5(null);
|
|
6715
|
+
var DelayRenderContextType = createContext10(null);
|
|
6371
6716
|
var useDelayRender = () => {
|
|
6372
6717
|
const environment = useRemotionEnvironment();
|
|
6373
|
-
const scope =
|
|
6718
|
+
const scope = useContext7(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
|
|
6374
6719
|
const logLevel = useLogLevel();
|
|
6375
|
-
const delayRender2 =
|
|
6720
|
+
const delayRender2 = useCallback3((label2, options) => {
|
|
6376
6721
|
if (!scope) {
|
|
6377
6722
|
return Math.random();
|
|
6378
6723
|
}
|
|
6379
6724
|
return delayRenderInternal({
|
|
6380
6725
|
scope,
|
|
6381
6726
|
environment,
|
|
6382
|
-
label:
|
|
6727
|
+
label: label2 ?? null,
|
|
6383
6728
|
options: options ?? {}
|
|
6384
6729
|
});
|
|
6385
6730
|
}, [environment, scope]);
|
|
6386
|
-
const continueRender2 =
|
|
6731
|
+
const continueRender2 = useCallback3((handle) => {
|
|
6387
6732
|
if (!scope) {
|
|
6388
6733
|
return;
|
|
6389
6734
|
}
|
|
@@ -6394,404 +6739,362 @@ var useDelayRender = () => {
|
|
|
6394
6739
|
logLevel
|
|
6395
6740
|
});
|
|
6396
6741
|
}, [environment, logLevel, scope]);
|
|
6397
|
-
const cancelRender2 =
|
|
6742
|
+
const cancelRender2 = useCallback3((err) => {
|
|
6398
6743
|
return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
|
|
6399
6744
|
}, [scope]);
|
|
6400
6745
|
return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
|
|
6401
6746
|
};
|
|
6402
|
-
var
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6747
|
+
var useLazyComponent = ({
|
|
6748
|
+
compProps,
|
|
6749
|
+
componentName,
|
|
6750
|
+
noSuspense
|
|
6751
|
+
}) => {
|
|
6752
|
+
const componentRef = useRef2(null);
|
|
6753
|
+
if ("component" in compProps) {
|
|
6754
|
+
componentRef.current = compProps.component;
|
|
6408
6755
|
}
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
6421
|
-
if (typeof window !== "undefined") {
|
|
6422
|
-
useLayoutEffect(() => {
|
|
6423
|
-
window.remotion_setFrame = (f, composition, attempt) => {
|
|
6424
|
-
window.remotion_attempt = attempt;
|
|
6425
|
-
const id = delayRender2(`Setting the current frame to ${f}`);
|
|
6426
|
-
let asyncUpdate = true;
|
|
6427
|
-
setFrame((s) => {
|
|
6428
|
-
const currentFrame = s[composition] ?? window.remotion_initialFrame;
|
|
6429
|
-
if (currentFrame === f) {
|
|
6430
|
-
asyncUpdate = false;
|
|
6431
|
-
return s;
|
|
6432
|
-
}
|
|
6433
|
-
return {
|
|
6434
|
-
...s,
|
|
6435
|
-
[composition]: f
|
|
6436
|
-
};
|
|
6437
|
-
});
|
|
6438
|
-
if (asyncUpdate) {
|
|
6439
|
-
requestAnimationFrame(() => continueRender2(id));
|
|
6440
|
-
} else {
|
|
6441
|
-
continueRender2(id);
|
|
6442
|
-
}
|
|
6756
|
+
const lazy = useMemo6(() => {
|
|
6757
|
+
if ("component" in compProps) {
|
|
6758
|
+
if (typeof document === "undefined" || noSuspense) {
|
|
6759
|
+
return compProps.component;
|
|
6760
|
+
}
|
|
6761
|
+
if (typeof compProps.component === "undefined") {
|
|
6762
|
+
throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
6763
|
+
}
|
|
6764
|
+
const Wrapper = (props) => {
|
|
6765
|
+
const Comp = componentRef.current;
|
|
6766
|
+
return React6.createElement(Comp, props);
|
|
6443
6767
|
};
|
|
6444
|
-
|
|
6445
|
-
}
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
frame,
|
|
6450
|
-
playing,
|
|
6451
|
-
imperativePlaying,
|
|
6452
|
-
rootId: remotionRootId,
|
|
6453
|
-
playbackRate,
|
|
6454
|
-
setPlaybackRate,
|
|
6455
|
-
audioAndVideoTags
|
|
6456
|
-
};
|
|
6457
|
-
}, [frame, playbackRate, playing, remotionRootId]);
|
|
6458
|
-
const setTimelineContextValue = useMemo22(() => {
|
|
6459
|
-
return {
|
|
6460
|
-
setFrame,
|
|
6461
|
-
setPlaying
|
|
6462
|
-
};
|
|
6463
|
-
}, []);
|
|
6464
|
-
return /* @__PURE__ */ jsx32(AbsoluteTimeContext.Provider, {
|
|
6465
|
-
value: timelineContextValue,
|
|
6466
|
-
children: /* @__PURE__ */ jsx32(TimelineContext.Provider, {
|
|
6467
|
-
value: timelineContextValue,
|
|
6468
|
-
children: /* @__PURE__ */ jsx32(SetTimelineContext.Provider, {
|
|
6469
|
-
value: setTimelineContextValue,
|
|
6470
|
-
children
|
|
6471
|
-
})
|
|
6472
|
-
})
|
|
6473
|
-
});
|
|
6474
|
-
};
|
|
6475
|
-
var CompositionManager = createContext7({
|
|
6476
|
-
compositions: [],
|
|
6477
|
-
folders: [],
|
|
6478
|
-
currentCompositionMetadata: null,
|
|
6479
|
-
canvasContent: null
|
|
6480
|
-
});
|
|
6481
|
-
var CompositionSetters = createContext7({
|
|
6482
|
-
registerComposition: () => {
|
|
6483
|
-
return;
|
|
6484
|
-
},
|
|
6485
|
-
unregisterComposition: () => {
|
|
6486
|
-
return;
|
|
6487
|
-
},
|
|
6488
|
-
registerFolder: () => {
|
|
6489
|
-
return;
|
|
6490
|
-
},
|
|
6491
|
-
unregisterFolder: () => {
|
|
6492
|
-
return;
|
|
6493
|
-
},
|
|
6494
|
-
setCanvasContent: () => {
|
|
6495
|
-
return;
|
|
6496
|
-
},
|
|
6497
|
-
onlyRenderComposition: null
|
|
6498
|
-
});
|
|
6499
|
-
var getKey = () => {
|
|
6500
|
-
return `remotion_inputPropsOverride` + window.location.origin;
|
|
6501
|
-
};
|
|
6502
|
-
var getInputPropsOverride = () => {
|
|
6503
|
-
if (typeof localStorage === "undefined")
|
|
6504
|
-
return null;
|
|
6505
|
-
const override = localStorage.getItem(getKey());
|
|
6506
|
-
if (!override)
|
|
6507
|
-
return null;
|
|
6508
|
-
return JSON.parse(override);
|
|
6509
|
-
};
|
|
6510
|
-
var setInputPropsOverride = (override) => {
|
|
6511
|
-
if (typeof localStorage === "undefined")
|
|
6512
|
-
return;
|
|
6513
|
-
if (override === null) {
|
|
6514
|
-
localStorage.removeItem(getKey());
|
|
6515
|
-
return;
|
|
6516
|
-
}
|
|
6517
|
-
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
6518
|
-
};
|
|
6519
|
-
var DATE_TOKEN = "remotion-date:";
|
|
6520
|
-
var FILE_TOKEN = "remotion-file:";
|
|
6521
|
-
var serializeJSONWithSpecialTypes = ({
|
|
6522
|
-
data,
|
|
6523
|
-
indent,
|
|
6524
|
-
staticBase
|
|
6525
|
-
}) => {
|
|
6526
|
-
let customDateUsed = false;
|
|
6527
|
-
let customFileUsed = false;
|
|
6528
|
-
let mapUsed = false;
|
|
6529
|
-
let setUsed = false;
|
|
6530
|
-
try {
|
|
6531
|
-
const serializedString = JSON.stringify(data, function(key, value) {
|
|
6532
|
-
const item = this[key];
|
|
6533
|
-
if (item instanceof Date) {
|
|
6534
|
-
customDateUsed = true;
|
|
6535
|
-
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
6536
|
-
}
|
|
6537
|
-
if (item instanceof Map) {
|
|
6538
|
-
mapUsed = true;
|
|
6539
|
-
return value;
|
|
6540
|
-
}
|
|
6541
|
-
if (item instanceof Set) {
|
|
6542
|
-
setUsed = true;
|
|
6543
|
-
return value;
|
|
6544
|
-
}
|
|
6545
|
-
if (typeof item === "string" && staticBase !== null && item.startsWith(staticBase)) {
|
|
6546
|
-
customFileUsed = true;
|
|
6547
|
-
return `${FILE_TOKEN}${item.replace(staticBase + "/", "")}`;
|
|
6768
|
+
return Wrapper;
|
|
6769
|
+
}
|
|
6770
|
+
if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
|
|
6771
|
+
if (typeof compProps.lazyComponent === "undefined") {
|
|
6772
|
+
throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
6548
6773
|
}
|
|
6549
|
-
return
|
|
6550
|
-
}
|
|
6551
|
-
|
|
6552
|
-
}
|
|
6553
|
-
|
|
6554
|
-
}
|
|
6774
|
+
return React6.lazy(compProps.lazyComponent);
|
|
6775
|
+
}
|
|
6776
|
+
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
6777
|
+
}, [compProps.lazyComponent]);
|
|
6778
|
+
return lazy;
|
|
6555
6779
|
};
|
|
6556
|
-
var
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6780
|
+
var useVideo = () => {
|
|
6781
|
+
const { canvasContent, compositions, currentCompositionMetadata } = useContext8(CompositionManager);
|
|
6782
|
+
const selected = compositions.find((c) => {
|
|
6783
|
+
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
6784
|
+
});
|
|
6785
|
+
const resolved = useResolvedVideoConfig(selected?.id ?? null);
|
|
6786
|
+
return useMemo7(() => {
|
|
6787
|
+
if (!resolved) {
|
|
6788
|
+
return null;
|
|
6560
6789
|
}
|
|
6561
|
-
if (
|
|
6562
|
-
return
|
|
6790
|
+
if (resolved.type === "error") {
|
|
6791
|
+
return null;
|
|
6563
6792
|
}
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
}
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6793
|
+
if (resolved.type === "loading") {
|
|
6794
|
+
return null;
|
|
6795
|
+
}
|
|
6796
|
+
if (!selected) {
|
|
6797
|
+
return null;
|
|
6798
|
+
}
|
|
6799
|
+
return {
|
|
6800
|
+
...resolved.result,
|
|
6801
|
+
defaultProps: selected.defaultProps ?? {},
|
|
6802
|
+
id: selected.id,
|
|
6803
|
+
...currentCompositionMetadata ?? {},
|
|
6804
|
+
component: selected.component
|
|
6805
|
+
};
|
|
6806
|
+
}, [currentCompositionMetadata, resolved, selected]);
|
|
6573
6807
|
};
|
|
6574
|
-
var
|
|
6575
|
-
|
|
6576
|
-
|
|
6808
|
+
var getRegex2 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
6809
|
+
var isCompositionIdValid = (id) => id.match(getRegex2());
|
|
6810
|
+
var validateCompositionId = (id) => {
|
|
6811
|
+
if (!isCompositionIdValid(id)) {
|
|
6812
|
+
throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`);
|
|
6577
6813
|
}
|
|
6578
|
-
return props;
|
|
6579
6814
|
};
|
|
6580
|
-
var
|
|
6581
|
-
var
|
|
6582
|
-
if (
|
|
6815
|
+
var invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex2())}`;
|
|
6816
|
+
var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
6817
|
+
if (!defaultProps) {
|
|
6583
6818
|
return;
|
|
6584
6819
|
}
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
console.warn("To hide this warning, don't call this function on the server:");
|
|
6588
|
-
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
6589
|
-
};
|
|
6590
|
-
var getInputProps = () => {
|
|
6591
|
-
if (typeof window === "undefined") {
|
|
6592
|
-
warnOnceSSRImport();
|
|
6593
|
-
return {};
|
|
6594
|
-
}
|
|
6595
|
-
if (getRemotionEnvironment().isPlayer) {
|
|
6596
|
-
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.");
|
|
6597
|
-
}
|
|
6598
|
-
const override = getInputPropsOverride();
|
|
6599
|
-
if (override) {
|
|
6600
|
-
return override;
|
|
6601
|
-
}
|
|
6602
|
-
if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
|
|
6603
|
-
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.");
|
|
6820
|
+
if (typeof defaultProps !== "object") {
|
|
6821
|
+
throw new Error(`"${name}" must be an object, but you passed a value of type ${typeof defaultProps}`);
|
|
6604
6822
|
}
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
return {};
|
|
6823
|
+
if (Array.isArray(defaultProps)) {
|
|
6824
|
+
throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
|
|
6608
6825
|
}
|
|
6609
|
-
const parsed = deserializeJSONWithSpecialTypes(param);
|
|
6610
|
-
return parsed;
|
|
6611
6826
|
};
|
|
6612
|
-
var
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
});
|
|
6618
|
-
|
|
6619
|
-
var EditorPropsProvider = ({ children }) => {
|
|
6620
|
-
const [props, setProps] = React5.useState({});
|
|
6621
|
-
const updateProps = useCallback2(({
|
|
6622
|
-
defaultProps,
|
|
6623
|
-
id,
|
|
6624
|
-
newProps
|
|
6625
|
-
}) => {
|
|
6626
|
-
setProps((prev) => {
|
|
6627
|
-
return {
|
|
6628
|
-
...prev,
|
|
6629
|
-
[id]: typeof newProps === "function" ? newProps(prev[id] ?? defaultProps) : newProps
|
|
6630
|
-
};
|
|
6631
|
-
});
|
|
6632
|
-
}, []);
|
|
6633
|
-
const ctx = useMemo3(() => {
|
|
6634
|
-
return { props, updateProps };
|
|
6635
|
-
}, [props, updateProps]);
|
|
6636
|
-
return /* @__PURE__ */ jsx42(EditorPropsContext.Provider, {
|
|
6637
|
-
value: ctx,
|
|
6638
|
-
children
|
|
6639
|
-
});
|
|
6827
|
+
var Fallback = () => {
|
|
6828
|
+
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
6829
|
+
useEffect2(() => {
|
|
6830
|
+
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
6831
|
+
return () => continueRender2(fallback);
|
|
6832
|
+
}, [continueRender2, delayRender2]);
|
|
6833
|
+
return null;
|
|
6640
6834
|
};
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
const
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
if (typeof
|
|
6664
|
-
|
|
6665
|
-
}
|
|
6666
|
-
if (durationInFrames <= 0) {
|
|
6667
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
6668
|
-
}
|
|
6669
|
-
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
6670
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
6671
|
-
}
|
|
6672
|
-
if (!Number.isFinite(durationInFrames)) {
|
|
6673
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
6674
|
-
}
|
|
6675
|
-
}
|
|
6676
|
-
function validateFps(fps, location, isGif) {
|
|
6677
|
-
if (typeof fps !== "number") {
|
|
6678
|
-
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
6835
|
+
var InnerComposition = ({
|
|
6836
|
+
width,
|
|
6837
|
+
height,
|
|
6838
|
+
fps,
|
|
6839
|
+
durationInFrames,
|
|
6840
|
+
id,
|
|
6841
|
+
defaultProps,
|
|
6842
|
+
schema,
|
|
6843
|
+
...compProps
|
|
6844
|
+
}) => {
|
|
6845
|
+
const compManager = useContext9(CompositionSetters);
|
|
6846
|
+
const { registerComposition, unregisterComposition } = compManager;
|
|
6847
|
+
const video = useVideo();
|
|
6848
|
+
const lazy = useLazyComponent({
|
|
6849
|
+
compProps,
|
|
6850
|
+
componentName: "Composition",
|
|
6851
|
+
noSuspense: false
|
|
6852
|
+
});
|
|
6853
|
+
const nonce = useNonce();
|
|
6854
|
+
const isPlayer = useIsPlayer();
|
|
6855
|
+
const environment = useRemotionEnvironment();
|
|
6856
|
+
const canUseComposition = useContext9(CanUseRemotionHooks);
|
|
6857
|
+
if (typeof window !== "undefined") {
|
|
6858
|
+
window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
|
|
6679
6859
|
}
|
|
6680
|
-
if (
|
|
6681
|
-
|
|
6860
|
+
if (canUseComposition) {
|
|
6861
|
+
if (isPlayer) {
|
|
6862
|
+
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.");
|
|
6863
|
+
}
|
|
6864
|
+
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
6682
6865
|
}
|
|
6683
|
-
|
|
6684
|
-
|
|
6866
|
+
const { folderName, parentName } = useContext9(FolderContext);
|
|
6867
|
+
const stack = compProps.stack ?? null;
|
|
6868
|
+
useEffect2(() => {
|
|
6869
|
+
if (!id) {
|
|
6870
|
+
throw new Error("No id for composition passed.");
|
|
6871
|
+
}
|
|
6872
|
+
validateCompositionId(id);
|
|
6873
|
+
validateDefaultAndInputProps(defaultProps, "defaultProps", id);
|
|
6874
|
+
registerComposition({
|
|
6875
|
+
durationInFrames: durationInFrames ?? undefined,
|
|
6876
|
+
fps: fps ?? undefined,
|
|
6877
|
+
height: height ?? undefined,
|
|
6878
|
+
width: width ?? undefined,
|
|
6879
|
+
id,
|
|
6880
|
+
folderName,
|
|
6881
|
+
component: lazy,
|
|
6882
|
+
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
6883
|
+
nonce: nonce.get(),
|
|
6884
|
+
parentFolderName: parentName,
|
|
6885
|
+
schema: schema ?? null,
|
|
6886
|
+
calculateMetadata: compProps.calculateMetadata ?? null,
|
|
6887
|
+
stack
|
|
6888
|
+
});
|
|
6889
|
+
return () => {
|
|
6890
|
+
unregisterComposition(id);
|
|
6891
|
+
};
|
|
6892
|
+
}, [
|
|
6893
|
+
durationInFrames,
|
|
6894
|
+
fps,
|
|
6895
|
+
height,
|
|
6896
|
+
lazy,
|
|
6897
|
+
id,
|
|
6898
|
+
folderName,
|
|
6899
|
+
defaultProps,
|
|
6900
|
+
width,
|
|
6901
|
+
nonce,
|
|
6902
|
+
parentName,
|
|
6903
|
+
schema,
|
|
6904
|
+
compProps.calculateMetadata,
|
|
6905
|
+
stack,
|
|
6906
|
+
registerComposition,
|
|
6907
|
+
unregisterComposition
|
|
6908
|
+
]);
|
|
6909
|
+
const resolved = useResolvedVideoConfig(id);
|
|
6910
|
+
if (environment.isStudio && video && video.component === lazy && video.id === id) {
|
|
6911
|
+
const Comp = lazy;
|
|
6912
|
+
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
6913
|
+
return null;
|
|
6914
|
+
}
|
|
6915
|
+
return createPortal(/* @__PURE__ */ jsx72(CanUseRemotionHooksProvider, {
|
|
6916
|
+
children: /* @__PURE__ */ jsx72(Suspense, {
|
|
6917
|
+
fallback: /* @__PURE__ */ jsx72(Loading, {}),
|
|
6918
|
+
children: /* @__PURE__ */ jsx72(Comp, {
|
|
6919
|
+
...resolved.result.props ?? {}
|
|
6920
|
+
})
|
|
6921
|
+
})
|
|
6922
|
+
}), portalNode());
|
|
6685
6923
|
}
|
|
6686
|
-
if (
|
|
6687
|
-
|
|
6924
|
+
if (environment.isRendering && video && video.component === lazy && video.id === id) {
|
|
6925
|
+
const Comp = lazy;
|
|
6926
|
+
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
6927
|
+
return null;
|
|
6928
|
+
}
|
|
6929
|
+
return createPortal(/* @__PURE__ */ jsx72(CanUseRemotionHooksProvider, {
|
|
6930
|
+
children: /* @__PURE__ */ jsx72(Suspense, {
|
|
6931
|
+
fallback: /* @__PURE__ */ jsx72(Fallback, {}),
|
|
6932
|
+
children: /* @__PURE__ */ jsx72(Comp, {
|
|
6933
|
+
...resolved.result.props ?? {}
|
|
6934
|
+
})
|
|
6935
|
+
})
|
|
6936
|
+
}), portalNode());
|
|
6688
6937
|
}
|
|
6689
|
-
|
|
6690
|
-
|
|
6938
|
+
return null;
|
|
6939
|
+
};
|
|
6940
|
+
var Composition = (props) => {
|
|
6941
|
+
const { onlyRenderComposition } = useContext9(CompositionSetters);
|
|
6942
|
+
if (onlyRenderComposition && onlyRenderComposition !== props.id) {
|
|
6943
|
+
return null;
|
|
6691
6944
|
}
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
var needsResolution = (composition) => {
|
|
6696
|
-
return Boolean(composition.calculateMetadata);
|
|
6945
|
+
return /* @__PURE__ */ jsx72(InnerComposition, {
|
|
6946
|
+
...props
|
|
6947
|
+
});
|
|
6697
6948
|
};
|
|
6698
|
-
var
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
return
|
|
6707
|
-
}
|
|
6708
|
-
const
|
|
6709
|
-
|
|
6710
|
-
if (
|
|
6711
|
-
|
|
6949
|
+
var componentsToAddStacksTo = [];
|
|
6950
|
+
var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
6951
|
+
var addSequenceStackTraces = (component) => {
|
|
6952
|
+
componentsToAddStacksTo.push(component);
|
|
6953
|
+
};
|
|
6954
|
+
var VERSION = "4.0.443";
|
|
6955
|
+
var checkMultipleRemotionVersions = () => {
|
|
6956
|
+
if (typeof globalThis === "undefined") {
|
|
6957
|
+
return;
|
|
6958
|
+
}
|
|
6959
|
+
const set = () => {
|
|
6960
|
+
globalThis.remotion_imported = VERSION;
|
|
6961
|
+
if (typeof window !== "undefined") {
|
|
6962
|
+
window.remotion_imported = VERSION;
|
|
6712
6963
|
}
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
id: composition.id,
|
|
6719
|
-
defaultProps: composition.defaultProps ?? {}
|
|
6720
|
-
}
|
|
6721
|
-
};
|
|
6964
|
+
};
|
|
6965
|
+
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
6966
|
+
if (alreadyImported) {
|
|
6967
|
+
if (alreadyImported === VERSION) {
|
|
6968
|
+
return;
|
|
6722
6969
|
}
|
|
6723
|
-
if (
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6970
|
+
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
6971
|
+
set();
|
|
6972
|
+
return;
|
|
6973
|
+
}
|
|
6974
|
+
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
6975
|
+
VERSION,
|
|
6976
|
+
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
6977
|
+
].filter(truthy2).join(" and ")}. This will cause things to break in an unexpected way.
|
|
6978
|
+
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.`);
|
|
6979
|
+
}
|
|
6980
|
+
set();
|
|
6981
|
+
};
|
|
6982
|
+
var SequenceContext = createContext11(null);
|
|
6983
|
+
var exports_timeline_position_state = {};
|
|
6984
|
+
__export2(exports_timeline_position_state, {
|
|
6985
|
+
useTimelineSetFrame: () => useTimelineSetFrame,
|
|
6986
|
+
useTimelinePosition: () => useTimelinePosition,
|
|
6987
|
+
useTimelineContext: () => useTimelineContext,
|
|
6988
|
+
usePlayingState: () => usePlayingState,
|
|
6989
|
+
useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
|
|
6990
|
+
persistCurrentFrame: () => persistCurrentFrame,
|
|
6991
|
+
getInitialFrameState: () => getInitialFrameState,
|
|
6992
|
+
getFrameForComposition: () => getFrameForComposition
|
|
6993
|
+
});
|
|
6994
|
+
function mulberry32(a) {
|
|
6995
|
+
let t = a + 1831565813;
|
|
6996
|
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
6997
|
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
6998
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
6999
|
+
}
|
|
7000
|
+
function hashCode(str) {
|
|
7001
|
+
let i = 0;
|
|
7002
|
+
let chr = 0;
|
|
7003
|
+
let hash = 0;
|
|
7004
|
+
for (i = 0;i < str.length; i++) {
|
|
7005
|
+
chr = str.charCodeAt(i);
|
|
7006
|
+
hash = (hash << 5) - hash + chr;
|
|
7007
|
+
hash |= 0;
|
|
7008
|
+
}
|
|
7009
|
+
return hash;
|
|
7010
|
+
}
|
|
7011
|
+
var random = (seed, dummy) => {
|
|
7012
|
+
if (dummy !== undefined) {
|
|
7013
|
+
throw new TypeError("random() takes only one argument");
|
|
7014
|
+
}
|
|
7015
|
+
if (seed === null) {
|
|
7016
|
+
return Math.random();
|
|
7017
|
+
}
|
|
7018
|
+
if (typeof seed === "string") {
|
|
7019
|
+
return mulberry32(hashCode(seed));
|
|
7020
|
+
}
|
|
7021
|
+
if (typeof seed === "number") {
|
|
7022
|
+
return mulberry32(seed * 10000000000);
|
|
7023
|
+
}
|
|
7024
|
+
throw new Error("random() argument must be a number or a string");
|
|
7025
|
+
};
|
|
7026
|
+
var SetTimelineContext = createContext12({
|
|
7027
|
+
setFrame: () => {
|
|
7028
|
+
throw new Error("default");
|
|
7029
|
+
},
|
|
7030
|
+
setPlaying: () => {
|
|
7031
|
+
throw new Error("default");
|
|
7032
|
+
}
|
|
7033
|
+
});
|
|
7034
|
+
var TimelineContext = createContext12(null);
|
|
7035
|
+
var AbsoluteTimeContext = createContext12(null);
|
|
7036
|
+
var TimelineContextProvider = ({ children, frameState }) => {
|
|
7037
|
+
const [playing, setPlaying] = useState2(false);
|
|
7038
|
+
const imperativePlaying = useRef3(false);
|
|
7039
|
+
const [playbackRate, setPlaybackRate] = useState2(1);
|
|
7040
|
+
const audioAndVideoTags = useRef3([]);
|
|
7041
|
+
const [remotionRootId] = useState2(() => String(random(null)));
|
|
7042
|
+
const [_frame, setFrame] = useState2(() => getInitialFrameState());
|
|
7043
|
+
const frame = frameState ?? _frame;
|
|
7044
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
7045
|
+
if (typeof window !== "undefined") {
|
|
7046
|
+
useLayoutEffect(() => {
|
|
7047
|
+
window.remotion_setFrame = (f, composition, attempt) => {
|
|
7048
|
+
window.remotion_attempt = attempt;
|
|
7049
|
+
const id = delayRender2(`Setting the current frame to ${f}`);
|
|
7050
|
+
let asyncUpdate = true;
|
|
7051
|
+
setFrame((s) => {
|
|
7052
|
+
const currentFrame = s[composition] ?? window.remotion_initialFrame;
|
|
7053
|
+
if (currentFrame === f) {
|
|
7054
|
+
asyncUpdate = false;
|
|
7055
|
+
return s;
|
|
7056
|
+
}
|
|
7057
|
+
return {
|
|
7058
|
+
...s,
|
|
7059
|
+
[composition]: f
|
|
7060
|
+
};
|
|
7061
|
+
});
|
|
7062
|
+
if (asyncUpdate) {
|
|
7063
|
+
requestAnimationFrame(() => continueRender2(id));
|
|
7064
|
+
} else {
|
|
7065
|
+
continueRender2(id);
|
|
6750
7066
|
}
|
|
6751
7067
|
};
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
if (!context[composition.id]) {
|
|
6757
|
-
return null;
|
|
6758
|
-
}
|
|
6759
|
-
return context[composition.id];
|
|
6760
|
-
}, [
|
|
6761
|
-
composition,
|
|
6762
|
-
context,
|
|
6763
|
-
currentCompositionMetadata,
|
|
6764
|
-
selectedEditorProps,
|
|
6765
|
-
env.isPlayer
|
|
6766
|
-
]);
|
|
6767
|
-
};
|
|
6768
|
-
var useVideo = () => {
|
|
6769
|
-
const { canvasContent, compositions, currentCompositionMetadata } = useContext6(CompositionManager);
|
|
6770
|
-
const selected = compositions.find((c) => {
|
|
6771
|
-
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
6772
|
-
});
|
|
6773
|
-
const resolved = useResolvedVideoConfig(selected?.id ?? null);
|
|
6774
|
-
return useMemo5(() => {
|
|
6775
|
-
if (!resolved) {
|
|
6776
|
-
return null;
|
|
6777
|
-
}
|
|
6778
|
-
if (resolved.type === "error") {
|
|
6779
|
-
return null;
|
|
6780
|
-
}
|
|
6781
|
-
if (resolved.type === "loading") {
|
|
6782
|
-
return null;
|
|
6783
|
-
}
|
|
6784
|
-
if (!selected) {
|
|
6785
|
-
return null;
|
|
6786
|
-
}
|
|
7068
|
+
window.remotion_isPlayer = false;
|
|
7069
|
+
}, [continueRender2, delayRender2]);
|
|
7070
|
+
}
|
|
7071
|
+
const timelineContextValue = useMemo8(() => {
|
|
6787
7072
|
return {
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
7073
|
+
frame,
|
|
7074
|
+
playing,
|
|
7075
|
+
imperativePlaying,
|
|
7076
|
+
rootId: remotionRootId,
|
|
7077
|
+
playbackRate,
|
|
7078
|
+
setPlaybackRate,
|
|
7079
|
+
audioAndVideoTags
|
|
6793
7080
|
};
|
|
6794
|
-
}, [
|
|
7081
|
+
}, [frame, playbackRate, playing, remotionRootId]);
|
|
7082
|
+
const setTimelineContextValue = useMemo8(() => {
|
|
7083
|
+
return {
|
|
7084
|
+
setFrame,
|
|
7085
|
+
setPlaying
|
|
7086
|
+
};
|
|
7087
|
+
}, []);
|
|
7088
|
+
return /* @__PURE__ */ jsx82(AbsoluteTimeContext.Provider, {
|
|
7089
|
+
value: timelineContextValue,
|
|
7090
|
+
children: /* @__PURE__ */ jsx82(TimelineContext.Provider, {
|
|
7091
|
+
value: timelineContextValue,
|
|
7092
|
+
children: /* @__PURE__ */ jsx82(SetTimelineContext.Provider, {
|
|
7093
|
+
value: setTimelineContextValue,
|
|
7094
|
+
children
|
|
7095
|
+
})
|
|
7096
|
+
})
|
|
7097
|
+
});
|
|
6795
7098
|
};
|
|
6796
7099
|
var makeKey = () => {
|
|
6797
7100
|
return `remotion.time-all`;
|
|
@@ -6825,7 +7128,7 @@ var useTimelinePositionFromContext = (state) => {
|
|
|
6825
7128
|
return Math.min(videoConfig.durationInFrames - 1, unclamped);
|
|
6826
7129
|
};
|
|
6827
7130
|
var useTimelineContext = () => {
|
|
6828
|
-
const state =
|
|
7131
|
+
const state = useContext10(TimelineContext);
|
|
6829
7132
|
if (state === null) {
|
|
6830
7133
|
throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
6831
7134
|
}
|
|
@@ -6836,30 +7139,23 @@ var useTimelinePosition = () => {
|
|
|
6836
7139
|
return useTimelinePositionFromContext(state);
|
|
6837
7140
|
};
|
|
6838
7141
|
var useAbsoluteTimelinePosition = () => {
|
|
6839
|
-
const state =
|
|
7142
|
+
const state = useContext10(AbsoluteTimeContext);
|
|
6840
7143
|
if (state === null) {
|
|
6841
7144
|
throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
6842
7145
|
}
|
|
6843
7146
|
return useTimelinePositionFromContext(state);
|
|
6844
7147
|
};
|
|
6845
7148
|
var useTimelineSetFrame = () => {
|
|
6846
|
-
const { setFrame } =
|
|
7149
|
+
const { setFrame } = useContext10(SetTimelineContext);
|
|
6847
7150
|
return setFrame;
|
|
6848
7151
|
};
|
|
6849
7152
|
var usePlayingState = () => {
|
|
6850
7153
|
const { playing, imperativePlaying } = useTimelineContext();
|
|
6851
|
-
const { setPlaying } =
|
|
6852
|
-
return
|
|
6853
|
-
};
|
|
6854
|
-
var CanUseRemotionHooks = createContext10(false);
|
|
6855
|
-
var CanUseRemotionHooksProvider = ({ children }) => {
|
|
6856
|
-
return /* @__PURE__ */ jsx52(CanUseRemotionHooks.Provider, {
|
|
6857
|
-
value: true,
|
|
6858
|
-
children
|
|
6859
|
-
});
|
|
7154
|
+
const { setPlaying } = useContext10(SetTimelineContext);
|
|
7155
|
+
return useMemo9(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
|
|
6860
7156
|
};
|
|
6861
7157
|
var useCurrentFrame = () => {
|
|
6862
|
-
const canUseRemotionHooks =
|
|
7158
|
+
const canUseRemotionHooks = useContext11(CanUseRemotionHooks);
|
|
6863
7159
|
const env = useRemotionEnvironment();
|
|
6864
7160
|
if (!canUseRemotionHooks) {
|
|
6865
7161
|
if (env.isPlayer) {
|
|
@@ -6868,17 +7164,17 @@ var useCurrentFrame = () => {
|
|
|
6868
7164
|
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`);
|
|
6869
7165
|
}
|
|
6870
7166
|
const frame = useTimelinePosition();
|
|
6871
|
-
const context =
|
|
7167
|
+
const context = useContext11(SequenceContext);
|
|
6872
7168
|
const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
|
|
6873
7169
|
return frame - contextOffset;
|
|
6874
7170
|
};
|
|
6875
7171
|
var useUnsafeVideoConfig = () => {
|
|
6876
|
-
const context =
|
|
7172
|
+
const context = useContext12(SequenceContext);
|
|
6877
7173
|
const ctxWidth = context?.width ?? null;
|
|
6878
7174
|
const ctxHeight = context?.height ?? null;
|
|
6879
7175
|
const ctxDuration = context?.durationInFrames ?? null;
|
|
6880
7176
|
const video = useVideo();
|
|
6881
|
-
return
|
|
7177
|
+
return useMemo10(() => {
|
|
6882
7178
|
if (!video) {
|
|
6883
7179
|
return null;
|
|
6884
7180
|
}
|
|
@@ -6914,7 +7210,7 @@ var useUnsafeVideoConfig = () => {
|
|
|
6914
7210
|
};
|
|
6915
7211
|
var useVideoConfig = () => {
|
|
6916
7212
|
const videoConfig = useUnsafeVideoConfig();
|
|
6917
|
-
const context =
|
|
7213
|
+
const context = useContext13(CanUseRemotionHooks);
|
|
6918
7214
|
const isPlayer = useIsPlayer();
|
|
6919
7215
|
if (!videoConfig) {
|
|
6920
7216
|
if (typeof window !== "undefined" && window.remotion_isPlayer || isPlayer) {
|
|
@@ -6950,7 +7246,7 @@ var Freeze = ({
|
|
|
6950
7246
|
if (!Number.isFinite(frameToFreeze)) {
|
|
6951
7247
|
throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frameToFreeze}.`);
|
|
6952
7248
|
}
|
|
6953
|
-
const isActive =
|
|
7249
|
+
const isActive = useMemo11(() => {
|
|
6954
7250
|
if (typeof active === "boolean") {
|
|
6955
7251
|
return active;
|
|
6956
7252
|
}
|
|
@@ -6959,9 +7255,9 @@ var Freeze = ({
|
|
|
6959
7255
|
}
|
|
6960
7256
|
}, [active, frame]);
|
|
6961
7257
|
const timelineContext = useTimelineContext();
|
|
6962
|
-
const sequenceContext =
|
|
7258
|
+
const sequenceContext = useContext14(SequenceContext);
|
|
6963
7259
|
const relativeFrom = sequenceContext?.relativeFrom ?? 0;
|
|
6964
|
-
const timelineValue =
|
|
7260
|
+
const timelineValue = useMemo11(() => {
|
|
6965
7261
|
if (!isActive) {
|
|
6966
7262
|
return timelineContext;
|
|
6967
7263
|
}
|
|
@@ -6976,7 +7272,7 @@ var Freeze = ({
|
|
|
6976
7272
|
}
|
|
6977
7273
|
};
|
|
6978
7274
|
}, [isActive, timelineContext, videoConfig.id, frameToFreeze, relativeFrom]);
|
|
6979
|
-
const newSequenceContext =
|
|
7275
|
+
const newSequenceContext = useMemo11(() => {
|
|
6980
7276
|
if (!sequenceContext) {
|
|
6981
7277
|
return null;
|
|
6982
7278
|
}
|
|
@@ -6988,53 +7284,19 @@ var Freeze = ({
|
|
|
6988
7284
|
cumulatedFrom: 0
|
|
6989
7285
|
};
|
|
6990
7286
|
}, [sequenceContext, isActive]);
|
|
6991
|
-
return /* @__PURE__ */
|
|
7287
|
+
return /* @__PURE__ */ jsx92(TimelineContext.Provider, {
|
|
6992
7288
|
value: timelineValue,
|
|
6993
|
-
children: /* @__PURE__ */
|
|
7289
|
+
children: /* @__PURE__ */ jsx92(SequenceContext.Provider, {
|
|
6994
7290
|
value: newSequenceContext,
|
|
6995
7291
|
children
|
|
6996
7292
|
})
|
|
6997
7293
|
});
|
|
6998
7294
|
};
|
|
6999
|
-
var
|
|
7000
|
-
getNonce: () => 0
|
|
7001
|
-
});
|
|
7002
|
-
var fastRefreshNonce = 0;
|
|
7003
|
-
try {
|
|
7004
|
-
if (typeof __webpack_module__ !== "undefined") {
|
|
7005
|
-
if (__webpack_module__.hot) {
|
|
7006
|
-
__webpack_module__.hot.addStatusHandler((status) => {
|
|
7007
|
-
if (status === "idle") {
|
|
7008
|
-
fastRefreshNonce++;
|
|
7009
|
-
}
|
|
7010
|
-
});
|
|
7011
|
-
}
|
|
7012
|
-
}
|
|
7013
|
-
} catch {}
|
|
7014
|
-
var useNonce = () => {
|
|
7015
|
-
const context = useContext12(NonceContext);
|
|
7016
|
-
const nonce = context.getNonce();
|
|
7017
|
-
const nonceRef = useRef2(nonce);
|
|
7018
|
-
nonceRef.current = nonce;
|
|
7019
|
-
const history = useRef2([[fastRefreshNonce, nonce]]);
|
|
7020
|
-
const get = useCallback3(() => {
|
|
7021
|
-
if (fastRefreshNonce !== history.current[history.current.length - 1][0]) {
|
|
7022
|
-
history.current = [
|
|
7023
|
-
...history.current,
|
|
7024
|
-
[fastRefreshNonce, nonceRef.current]
|
|
7025
|
-
];
|
|
7026
|
-
}
|
|
7027
|
-
return history.current;
|
|
7028
|
-
}, [history]);
|
|
7029
|
-
return useMemo9(() => {
|
|
7030
|
-
return { get };
|
|
7031
|
-
}, [get]);
|
|
7032
|
-
};
|
|
7033
|
-
var PremountContext = createContext12({
|
|
7295
|
+
var PremountContext = createContext13({
|
|
7034
7296
|
premountFramesRemaining: 0,
|
|
7035
7297
|
playing: false
|
|
7036
7298
|
});
|
|
7037
|
-
var SequenceManager =
|
|
7299
|
+
var SequenceManager = React10.createContext({
|
|
7038
7300
|
registerSequence: () => {
|
|
7039
7301
|
throw new Error("SequenceManagerContext not initialized");
|
|
7040
7302
|
},
|
|
@@ -7043,13 +7305,13 @@ var SequenceManager = React8.createContext({
|
|
|
7043
7305
|
},
|
|
7044
7306
|
sequences: []
|
|
7045
7307
|
});
|
|
7046
|
-
var SequenceVisibilityToggleContext =
|
|
7308
|
+
var SequenceVisibilityToggleContext = React10.createContext({
|
|
7047
7309
|
hidden: {},
|
|
7048
7310
|
setHidden: () => {
|
|
7049
7311
|
throw new Error("SequenceVisibilityToggle not initialized");
|
|
7050
7312
|
}
|
|
7051
7313
|
});
|
|
7052
|
-
var VisualModeOverridesContext =
|
|
7314
|
+
var VisualModeOverridesContext = React10.createContext({
|
|
7053
7315
|
dragOverrides: {},
|
|
7054
7316
|
setDragOverrides: () => {
|
|
7055
7317
|
throw new Error("VisualModeOverridesContext not initialized");
|
|
@@ -7067,7 +7329,7 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
7067
7329
|
const [sequences, setSequences] = useState3([]);
|
|
7068
7330
|
const [hidden, setHidden] = useState3({});
|
|
7069
7331
|
const [dragOverrides, setControlOverrides] = useState3({});
|
|
7070
|
-
const controlOverridesRef =
|
|
7332
|
+
const controlOverridesRef = useRef4(dragOverrides);
|
|
7071
7333
|
controlOverridesRef.current = dragOverrides;
|
|
7072
7334
|
const [codeValues, setCodeValuesMapState] = useState3({});
|
|
7073
7335
|
const setDragOverrides = useCallback4((sequenceId, key, value) => {
|
|
@@ -7113,20 +7375,20 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
7113
7375
|
const unregisterSequence = useCallback4((seq) => {
|
|
7114
7376
|
setSequences((seqs) => seqs.filter((s) => s.id !== seq));
|
|
7115
7377
|
}, []);
|
|
7116
|
-
const sequenceContext =
|
|
7378
|
+
const sequenceContext = useMemo12(() => {
|
|
7117
7379
|
return {
|
|
7118
7380
|
registerSequence,
|
|
7119
7381
|
sequences,
|
|
7120
7382
|
unregisterSequence
|
|
7121
7383
|
};
|
|
7122
7384
|
}, [registerSequence, sequences, unregisterSequence]);
|
|
7123
|
-
const hiddenContext =
|
|
7385
|
+
const hiddenContext = useMemo12(() => {
|
|
7124
7386
|
return {
|
|
7125
7387
|
hidden,
|
|
7126
7388
|
setHidden
|
|
7127
7389
|
};
|
|
7128
7390
|
}, [hidden]);
|
|
7129
|
-
const overrideContext =
|
|
7391
|
+
const overrideContext = useMemo12(() => {
|
|
7130
7392
|
return {
|
|
7131
7393
|
visualModeEnabled,
|
|
7132
7394
|
dragOverrides,
|
|
@@ -7143,11 +7405,11 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
7143
7405
|
codeValues,
|
|
7144
7406
|
setCodeValues
|
|
7145
7407
|
]);
|
|
7146
|
-
return /* @__PURE__ */
|
|
7408
|
+
return /* @__PURE__ */ jsx102(SequenceManager.Provider, {
|
|
7147
7409
|
value: sequenceContext,
|
|
7148
|
-
children: /* @__PURE__ */
|
|
7410
|
+
children: /* @__PURE__ */ jsx102(SequenceVisibilityToggleContext.Provider, {
|
|
7149
7411
|
value: hiddenContext,
|
|
7150
|
-
children: /* @__PURE__ */
|
|
7412
|
+
children: /* @__PURE__ */ jsx102(VisualModeOverridesContext.Provider, {
|
|
7151
7413
|
value: overrideContext,
|
|
7152
7414
|
children
|
|
7153
7415
|
})
|
|
@@ -7172,7 +7434,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7172
7434
|
}, ref) => {
|
|
7173
7435
|
const { layout = "absolute-fill" } = other;
|
|
7174
7436
|
const [id] = useState4(() => String(Math.random()));
|
|
7175
|
-
const parentSequence =
|
|
7437
|
+
const parentSequence = useContext15(SequenceContext);
|
|
7176
7438
|
const { rootId } = useTimelineContext();
|
|
7177
7439
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
7178
7440
|
const nonce = useNonce();
|
|
@@ -7198,15 +7460,15 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7198
7460
|
const videoConfig = useVideoConfig();
|
|
7199
7461
|
const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - from, durationInFrames) : durationInFrames;
|
|
7200
7462
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
7201
|
-
const { registerSequence, unregisterSequence } =
|
|
7202
|
-
const { hidden } =
|
|
7203
|
-
const premounting =
|
|
7463
|
+
const { registerSequence, unregisterSequence } = useContext15(SequenceManager);
|
|
7464
|
+
const { hidden } = useContext15(SequenceVisibilityToggleContext);
|
|
7465
|
+
const premounting = useMemo13(() => {
|
|
7204
7466
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
7205
7467
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
7206
|
-
const postmounting =
|
|
7468
|
+
const postmounting = useMemo13(() => {
|
|
7207
7469
|
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
7208
7470
|
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
7209
|
-
const contextValue =
|
|
7471
|
+
const contextValue = useMemo13(() => {
|
|
7210
7472
|
return {
|
|
7211
7473
|
cumulatedFrom,
|
|
7212
7474
|
relativeFrom: from,
|
|
@@ -7233,12 +7495,12 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7233
7495
|
premountDisplay,
|
|
7234
7496
|
postmountDisplay
|
|
7235
7497
|
]);
|
|
7236
|
-
const timelineClipName =
|
|
7498
|
+
const timelineClipName = useMemo13(() => {
|
|
7237
7499
|
return name ?? "";
|
|
7238
7500
|
}, [name]);
|
|
7239
7501
|
const env = useRemotionEnvironment();
|
|
7240
7502
|
const inheritedStack = other?.stack ?? null;
|
|
7241
|
-
|
|
7503
|
+
useEffect3(() => {
|
|
7242
7504
|
if (!env.isStudio) {
|
|
7243
7505
|
return;
|
|
7244
7506
|
}
|
|
@@ -7285,7 +7547,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7285
7547
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
7286
7548
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
7287
7549
|
const styleIfThere = other.layout === "none" ? undefined : other.style;
|
|
7288
|
-
const defaultStyle =
|
|
7550
|
+
const defaultStyle = useMemo13(() => {
|
|
7289
7551
|
return {
|
|
7290
7552
|
flexDirection: undefined,
|
|
7291
7553
|
...width ? { width } : {},
|
|
@@ -7300,9 +7562,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7300
7562
|
if (isSequenceHidden) {
|
|
7301
7563
|
return null;
|
|
7302
7564
|
}
|
|
7303
|
-
return /* @__PURE__ */
|
|
7565
|
+
return /* @__PURE__ */ jsx112(SequenceContext.Provider, {
|
|
7304
7566
|
value: contextValue,
|
|
7305
|
-
children: content === null ? null : other.layout === "none" ? content : /* @__PURE__ */
|
|
7567
|
+
children: content === null ? null : other.layout === "none" ? content : /* @__PURE__ */ jsx112(AbsoluteFill, {
|
|
7306
7568
|
ref,
|
|
7307
7569
|
style: defaultStyle,
|
|
7308
7570
|
className: other.className,
|
|
@@ -7312,7 +7574,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7312
7574
|
};
|
|
7313
7575
|
var RegularSequence = forwardRef2(RegularSequenceRefForwardingFunction);
|
|
7314
7576
|
var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
7315
|
-
const parentPremountContext =
|
|
7577
|
+
const parentPremountContext = useContext15(PremountContext);
|
|
7316
7578
|
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
7317
7579
|
if (props.layout === "none") {
|
|
7318
7580
|
throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
|
|
@@ -7332,7 +7594,7 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
7332
7594
|
const postmountingActive = frame > endThreshold && frame <= endThreshold + postmountFor;
|
|
7333
7595
|
const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
|
|
7334
7596
|
const isFreezingActive = premountingActive || postmountingActive;
|
|
7335
|
-
const style =
|
|
7597
|
+
const style = useMemo13(() => {
|
|
7336
7598
|
return {
|
|
7337
7599
|
...passedStyle,
|
|
7338
7600
|
opacity: premountingActive || postmountingActive ? 0 : 1,
|
|
@@ -7349,18 +7611,18 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
7349
7611
|
]);
|
|
7350
7612
|
const { playing } = useTimelineContext();
|
|
7351
7613
|
const premountFramesRemaining = premountingActive ? from - frame : 0;
|
|
7352
|
-
const premountContextValue =
|
|
7614
|
+
const premountContextValue = useMemo13(() => {
|
|
7353
7615
|
return {
|
|
7354
7616
|
premountFramesRemaining,
|
|
7355
7617
|
playing: parentPremountContext.playing || playing
|
|
7356
7618
|
};
|
|
7357
7619
|
}, [premountFramesRemaining, parentPremountContext.playing, playing]);
|
|
7358
|
-
return /* @__PURE__ */
|
|
7620
|
+
return /* @__PURE__ */ jsx112(PremountContext.Provider, {
|
|
7359
7621
|
value: premountContextValue,
|
|
7360
|
-
children: /* @__PURE__ */
|
|
7622
|
+
children: /* @__PURE__ */ jsx112(Freeze, {
|
|
7361
7623
|
frame: freezeFrame,
|
|
7362
7624
|
active: isFreezingActive,
|
|
7363
|
-
children: /* @__PURE__ */
|
|
7625
|
+
children: /* @__PURE__ */ jsx112(Sequence, {
|
|
7364
7626
|
ref,
|
|
7365
7627
|
from,
|
|
7366
7628
|
durationInFrames,
|
|
@@ -7381,14 +7643,14 @@ var SequenceRefForwardingFunction = (props, ref) => {
|
|
|
7381
7643
|
if (props.layout !== "none" && !env.isRendering) {
|
|
7382
7644
|
const effectivePremountFor = ENABLE_V5_BREAKING_CHANGES ? props.premountFor ?? fps : props.premountFor;
|
|
7383
7645
|
if (effectivePremountFor || props.postmountFor) {
|
|
7384
|
-
return /* @__PURE__ */
|
|
7646
|
+
return /* @__PURE__ */ jsx112(PremountedPostmountedSequence, {
|
|
7385
7647
|
ref,
|
|
7386
7648
|
...props,
|
|
7387
7649
|
premountFor: effectivePremountFor
|
|
7388
7650
|
});
|
|
7389
7651
|
}
|
|
7390
7652
|
}
|
|
7391
|
-
return /* @__PURE__ */
|
|
7653
|
+
return /* @__PURE__ */ jsx112(RegularSequence, {
|
|
7392
7654
|
...props,
|
|
7393
7655
|
ref
|
|
7394
7656
|
});
|
|
@@ -7443,7 +7705,7 @@ var calcArgs = (fit, frameSize, canvasSize) => {
|
|
|
7443
7705
|
}
|
|
7444
7706
|
};
|
|
7445
7707
|
var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
|
|
7446
|
-
const canvasRef =
|
|
7708
|
+
const canvasRef = useRef5(null);
|
|
7447
7709
|
const draw = useCallback5((imageData) => {
|
|
7448
7710
|
const canvas = canvasRef.current;
|
|
7449
7711
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
@@ -7483,13 +7745,13 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref
|
|
|
7483
7745
|
}
|
|
7484
7746
|
};
|
|
7485
7747
|
}, [draw]);
|
|
7486
|
-
return /* @__PURE__ */
|
|
7748
|
+
return /* @__PURE__ */ jsx12("canvas", {
|
|
7487
7749
|
ref: canvasRef,
|
|
7488
7750
|
className,
|
|
7489
7751
|
style
|
|
7490
7752
|
});
|
|
7491
7753
|
};
|
|
7492
|
-
var Canvas =
|
|
7754
|
+
var Canvas = React12.forwardRef(CanvasRefForwardingFunction);
|
|
7493
7755
|
var CACHE_SIZE = 5;
|
|
7494
7756
|
var getActualTime = ({
|
|
7495
7757
|
loopBehavior,
|
|
@@ -7646,8 +7908,8 @@ var AnimatedImage = forwardRef3(({
|
|
|
7646
7908
|
fit = "fill",
|
|
7647
7909
|
...props
|
|
7648
7910
|
}, canvasRef) => {
|
|
7649
|
-
const mountState =
|
|
7650
|
-
|
|
7911
|
+
const mountState = useRef6({ isMounted: true });
|
|
7912
|
+
useEffect4(() => {
|
|
7651
7913
|
const { current } = mountState;
|
|
7652
7914
|
current.isMounted = true;
|
|
7653
7915
|
return () => {
|
|
@@ -7661,9 +7923,9 @@ var AnimatedImage = forwardRef3(({
|
|
|
7661
7923
|
const frame = useCurrentFrame();
|
|
7662
7924
|
const { fps } = useVideoConfig();
|
|
7663
7925
|
const currentTime = frame / playbackRate / fps;
|
|
7664
|
-
const currentTimeRef =
|
|
7926
|
+
const currentTimeRef = useRef6(currentTime);
|
|
7665
7927
|
currentTimeRef.current = currentTime;
|
|
7666
|
-
const ref =
|
|
7928
|
+
const ref = useRef6(null);
|
|
7667
7929
|
useImperativeHandle2(canvasRef, () => {
|
|
7668
7930
|
const c = ref.current?.getCanvas();
|
|
7669
7931
|
if (!c) {
|
|
@@ -7672,7 +7934,7 @@ var AnimatedImage = forwardRef3(({
|
|
|
7672
7934
|
return c;
|
|
7673
7935
|
}, []);
|
|
7674
7936
|
const [initialLoopBehavior] = useState5(() => loopBehavior);
|
|
7675
|
-
|
|
7937
|
+
useEffect4(() => {
|
|
7676
7938
|
const controller = new AbortController;
|
|
7677
7939
|
decodeImage({
|
|
7678
7940
|
resolvedSrc,
|
|
@@ -7735,7 +7997,7 @@ var AnimatedImage = forwardRef3(({
|
|
|
7735
7997
|
continueRender2,
|
|
7736
7998
|
delayRender2
|
|
7737
7999
|
]);
|
|
7738
|
-
return /* @__PURE__ */
|
|
8000
|
+
return /* @__PURE__ */ jsx13(Canvas, {
|
|
7739
8001
|
ref,
|
|
7740
8002
|
width,
|
|
7741
8003
|
height,
|
|
@@ -7772,7 +8034,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
7772
8034
|
}
|
|
7773
8035
|
validateContent(artifact.content);
|
|
7774
8036
|
};
|
|
7775
|
-
var RenderAssetManager =
|
|
8037
|
+
var RenderAssetManager = createContext14({
|
|
7776
8038
|
registerRenderAsset: () => {
|
|
7777
8039
|
return;
|
|
7778
8040
|
},
|
|
@@ -7783,7 +8045,7 @@ var RenderAssetManager = createContext13({
|
|
|
7783
8045
|
});
|
|
7784
8046
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
7785
8047
|
const [renderAssets, setRenderAssets] = useState6([]);
|
|
7786
|
-
const renderAssetsRef =
|
|
8048
|
+
const renderAssetsRef = useRef7([]);
|
|
7787
8049
|
const registerRenderAsset = useCallback6((renderAsset) => {
|
|
7788
8050
|
validateRenderAsset(renderAsset);
|
|
7789
8051
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
@@ -7815,21 +8077,21 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
7815
8077
|
};
|
|
7816
8078
|
}
|
|
7817
8079
|
}, []);
|
|
7818
|
-
const contextValue =
|
|
8080
|
+
const contextValue = useMemo14(() => {
|
|
7819
8081
|
return {
|
|
7820
8082
|
registerRenderAsset,
|
|
7821
8083
|
unregisterRenderAsset,
|
|
7822
8084
|
renderAssets
|
|
7823
8085
|
};
|
|
7824
8086
|
}, [renderAssets, registerRenderAsset, unregisterRenderAsset]);
|
|
7825
|
-
return /* @__PURE__ */
|
|
8087
|
+
return /* @__PURE__ */ jsx14(RenderAssetManager.Provider, {
|
|
7826
8088
|
value: contextValue,
|
|
7827
8089
|
children
|
|
7828
8090
|
});
|
|
7829
8091
|
};
|
|
7830
8092
|
var ArtifactThumbnail = Symbol("Thumbnail");
|
|
7831
8093
|
var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
7832
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
8094
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext16(RenderAssetManager);
|
|
7833
8095
|
const env = useRemotionEnvironment();
|
|
7834
8096
|
const frame = useCurrentFrame();
|
|
7835
8097
|
const [id] = useState7(() => {
|
|
@@ -7910,9 +8172,9 @@ var calculateMediaDuration = ({
|
|
|
7910
8172
|
const actualDuration = duration / playbackRate;
|
|
7911
8173
|
return Math.floor(actualDuration);
|
|
7912
8174
|
};
|
|
7913
|
-
var LoopContext =
|
|
8175
|
+
var LoopContext = createContext15(null);
|
|
7914
8176
|
var useLoop = () => {
|
|
7915
|
-
return
|
|
8177
|
+
return React13.useContext(LoopContext);
|
|
7916
8178
|
};
|
|
7917
8179
|
var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
|
|
7918
8180
|
const currentFrame = useCurrentFrame();
|
|
@@ -7937,22 +8199,22 @@ var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) =>
|
|
|
7937
8199
|
const iteration = Math.floor(currentFrame / durationInFrames);
|
|
7938
8200
|
const start = iteration * durationInFrames;
|
|
7939
8201
|
const from = Math.min(start, maxFrame);
|
|
7940
|
-
const loopDisplay =
|
|
8202
|
+
const loopDisplay = useMemo15(() => {
|
|
7941
8203
|
return {
|
|
7942
8204
|
numberOfTimes: Math.min(compDuration / durationInFrames, times),
|
|
7943
8205
|
startOffset: -from,
|
|
7944
8206
|
durationInFrames
|
|
7945
8207
|
};
|
|
7946
8208
|
}, [compDuration, durationInFrames, from, times]);
|
|
7947
|
-
const loopContext =
|
|
8209
|
+
const loopContext = useMemo15(() => {
|
|
7948
8210
|
return {
|
|
7949
8211
|
iteration: Math.floor(currentFrame / durationInFrames),
|
|
7950
8212
|
durationInFrames
|
|
7951
8213
|
};
|
|
7952
8214
|
}, [currentFrame, durationInFrames]);
|
|
7953
|
-
return /* @__PURE__ */
|
|
8215
|
+
return /* @__PURE__ */ jsx15(LoopContext.Provider, {
|
|
7954
8216
|
value: loopContext,
|
|
7955
|
-
children: /* @__PURE__ */
|
|
8217
|
+
children: /* @__PURE__ */ jsx15(Sequence, {
|
|
7956
8218
|
durationInFrames,
|
|
7957
8219
|
from,
|
|
7958
8220
|
name: name ?? "<Loop>",
|
|
@@ -7973,7 +8235,7 @@ var playbackLogging = ({
|
|
|
7973
8235
|
const tags = [mountTime ? Date.now() - mountTime + "ms " : null, tag].filter(Boolean).join(" ");
|
|
7974
8236
|
Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
|
|
7975
8237
|
};
|
|
7976
|
-
var PreloadContext =
|
|
8238
|
+
var PreloadContext = createContext16({});
|
|
7977
8239
|
var preloads = {};
|
|
7978
8240
|
var updaters = [];
|
|
7979
8241
|
var setPreloads = (updater) => {
|
|
@@ -7982,7 +8244,7 @@ var setPreloads = (updater) => {
|
|
|
7982
8244
|
};
|
|
7983
8245
|
var PrefetchProvider = ({ children }) => {
|
|
7984
8246
|
const [_preloads, _setPreloads] = useState8(() => preloads);
|
|
7985
|
-
|
|
8247
|
+
useEffect5(() => {
|
|
7986
8248
|
const updaterFunction = () => {
|
|
7987
8249
|
_setPreloads(preloads);
|
|
7988
8250
|
};
|
|
@@ -7991,7 +8253,7 @@ var PrefetchProvider = ({ children }) => {
|
|
|
7991
8253
|
updaters = updaters.filter((u) => u !== updaterFunction);
|
|
7992
8254
|
};
|
|
7993
8255
|
}, []);
|
|
7994
|
-
return /* @__PURE__ */
|
|
8256
|
+
return /* @__PURE__ */ jsx16(PreloadContext.Provider, {
|
|
7995
8257
|
value: _preloads,
|
|
7996
8258
|
children
|
|
7997
8259
|
});
|
|
@@ -8011,7 +8273,7 @@ var getSrcWithoutHash = (src) => {
|
|
|
8011
8273
|
return src.slice(0, hashIndex);
|
|
8012
8274
|
};
|
|
8013
8275
|
var usePreload = (src) => {
|
|
8014
|
-
const preloads2 =
|
|
8276
|
+
const preloads2 = useContext17(PreloadContext);
|
|
8015
8277
|
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
8016
8278
|
const withoutHashFragment = getSrcWithoutHash(src);
|
|
8017
8279
|
if (!preloads2[withoutHashFragment]) {
|
|
@@ -8294,7 +8556,7 @@ var durationReducer = (state, action) => {
|
|
|
8294
8556
|
return state;
|
|
8295
8557
|
}
|
|
8296
8558
|
};
|
|
8297
|
-
var DurationsContext =
|
|
8559
|
+
var DurationsContext = createContext17({
|
|
8298
8560
|
durations: {},
|
|
8299
8561
|
setDurations: () => {
|
|
8300
8562
|
throw new Error("context missing");
|
|
@@ -8302,13 +8564,13 @@ var DurationsContext = createContext16({
|
|
|
8302
8564
|
});
|
|
8303
8565
|
var DurationsContextProvider = ({ children }) => {
|
|
8304
8566
|
const [durations, setDurations] = useReducer(durationReducer, {});
|
|
8305
|
-
const value =
|
|
8567
|
+
const value = useMemo16(() => {
|
|
8306
8568
|
return {
|
|
8307
8569
|
durations,
|
|
8308
8570
|
setDurations
|
|
8309
8571
|
};
|
|
8310
8572
|
}, [durations]);
|
|
8311
|
-
return /* @__PURE__ */
|
|
8573
|
+
return /* @__PURE__ */ jsx17(DurationsContext.Provider, {
|
|
8312
8574
|
value,
|
|
8313
8575
|
children
|
|
8314
8576
|
});
|
|
@@ -8436,7 +8698,7 @@ var useSingletonAudioContext = ({
|
|
|
8436
8698
|
audioEnabled
|
|
8437
8699
|
}) => {
|
|
8438
8700
|
const env = useRemotionEnvironment();
|
|
8439
|
-
const audioContext =
|
|
8701
|
+
const audioContext = useMemo17(() => {
|
|
8440
8702
|
if (env.isRendering) {
|
|
8441
8703
|
return null;
|
|
8442
8704
|
}
|
|
@@ -8480,9 +8742,9 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
8480
8742
|
}
|
|
8481
8743
|
return true;
|
|
8482
8744
|
};
|
|
8483
|
-
var SharedAudioContext =
|
|
8745
|
+
var SharedAudioContext = createContext18(null);
|
|
8484
8746
|
var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHint, audioEnabled }) => {
|
|
8485
|
-
const audios =
|
|
8747
|
+
const audios = useRef8([]);
|
|
8486
8748
|
const [initialNumberOfAudioTags] = useState9(numberOfAudioTags);
|
|
8487
8749
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
8488
8750
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
@@ -8493,9 +8755,9 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8493
8755
|
latencyHint: audioLatencyHint,
|
|
8494
8756
|
audioEnabled
|
|
8495
8757
|
});
|
|
8496
|
-
const audioSyncAnchor =
|
|
8497
|
-
const prevEndTimes =
|
|
8498
|
-
const scheduleAudioNode =
|
|
8758
|
+
const audioSyncAnchor = useMemo18(() => ({ value: 0 }), []);
|
|
8759
|
+
const prevEndTimes = useRef8({ scheduledEndTime: null, mediaEndTime: null });
|
|
8760
|
+
const scheduleAudioNode = useMemo18(() => {
|
|
8499
8761
|
return ({
|
|
8500
8762
|
node,
|
|
8501
8763
|
mediaTimestamp,
|
|
@@ -8550,7 +8812,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8550
8812
|
};
|
|
8551
8813
|
};
|
|
8552
8814
|
}, [audioContext, logLevel]);
|
|
8553
|
-
const refs =
|
|
8815
|
+
const refs = useMemo18(() => {
|
|
8554
8816
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
8555
8817
|
const ref = createRef2();
|
|
8556
8818
|
return {
|
|
@@ -8563,7 +8825,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8563
8825
|
};
|
|
8564
8826
|
});
|
|
8565
8827
|
}, [audioContext, numberOfAudioTags]);
|
|
8566
|
-
const effectToUse =
|
|
8828
|
+
const effectToUse = React16.useInsertionEffect ?? React16.useLayoutEffect;
|
|
8567
8829
|
effectToUse(() => {
|
|
8568
8830
|
return () => {
|
|
8569
8831
|
requestAnimationFrame(() => {
|
|
@@ -8573,7 +8835,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8573
8835
|
});
|
|
8574
8836
|
};
|
|
8575
8837
|
}, [refs]);
|
|
8576
|
-
const takenAudios =
|
|
8838
|
+
const takenAudios = useRef8(new Array(numberOfAudioTags).fill(false));
|
|
8577
8839
|
const rerenderAudios = useCallback7(() => {
|
|
8578
8840
|
refs.forEach(({ ref, id }) => {
|
|
8579
8841
|
const data = audios.current?.find((a) => a.id === id);
|
|
@@ -8689,7 +8951,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8689
8951
|
});
|
|
8690
8952
|
audioContext?.resume();
|
|
8691
8953
|
}, [audioContext, logLevel, mountTime, refs, env.isPlayer]);
|
|
8692
|
-
const value =
|
|
8954
|
+
const value = useMemo18(() => {
|
|
8693
8955
|
return {
|
|
8694
8956
|
registerAudio,
|
|
8695
8957
|
unregisterAudio,
|
|
@@ -8710,11 +8972,11 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8710
8972
|
audioSyncAnchor,
|
|
8711
8973
|
scheduleAudioNode
|
|
8712
8974
|
]);
|
|
8713
|
-
return /* @__PURE__ */
|
|
8975
|
+
return /* @__PURE__ */ jsxs22(SharedAudioContext.Provider, {
|
|
8714
8976
|
value,
|
|
8715
8977
|
children: [
|
|
8716
8978
|
refs.map(({ id, ref }) => {
|
|
8717
|
-
return /* @__PURE__ */
|
|
8979
|
+
return /* @__PURE__ */ jsx18("audio", {
|
|
8718
8980
|
ref,
|
|
8719
8981
|
preload: "metadata",
|
|
8720
8982
|
src: EMPTY_AUDIO
|
|
@@ -8730,12 +8992,12 @@ var useSharedAudio = ({
|
|
|
8730
8992
|
premounting,
|
|
8731
8993
|
postmounting
|
|
8732
8994
|
}) => {
|
|
8733
|
-
const ctx =
|
|
8995
|
+
const ctx = useContext18(SharedAudioContext);
|
|
8734
8996
|
const [elem] = useState9(() => {
|
|
8735
8997
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
8736
8998
|
return ctx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
8737
8999
|
}
|
|
8738
|
-
const el =
|
|
9000
|
+
const el = React16.createRef();
|
|
8739
9001
|
const mediaElementSourceNode = ctx?.audioContext ? makeSharedElementSourceNode({
|
|
8740
9002
|
audioContext: ctx.audioContext,
|
|
8741
9003
|
ref: el
|
|
@@ -8754,7 +9016,7 @@ var useSharedAudio = ({
|
|
|
8754
9016
|
}
|
|
8755
9017
|
};
|
|
8756
9018
|
});
|
|
8757
|
-
const effectToUse =
|
|
9019
|
+
const effectToUse = React16.useInsertionEffect ?? React16.useLayoutEffect;
|
|
8758
9020
|
if (typeof document !== "undefined") {
|
|
8759
9021
|
effectToUse(() => {
|
|
8760
9022
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
@@ -8861,9 +9123,9 @@ var useAppendVideoFragment = ({
|
|
|
8861
9123
|
duration: initialDuration,
|
|
8862
9124
|
fps
|
|
8863
9125
|
}) => {
|
|
8864
|
-
const actualFromRef =
|
|
8865
|
-
const actualDuration =
|
|
8866
|
-
const actualSrc =
|
|
9126
|
+
const actualFromRef = useRef9(initialActualFrom);
|
|
9127
|
+
const actualDuration = useRef9(initialDuration);
|
|
9128
|
+
const actualSrc = useRef9(initialActualSrc);
|
|
8867
9129
|
if (!isSubsetOfDuration({
|
|
8868
9130
|
prevStartFrom: actualFromRef.current,
|
|
8869
9131
|
newStartFrom: initialActualFrom,
|
|
@@ -8900,10 +9162,10 @@ var useVolume = ({
|
|
|
8900
9162
|
source,
|
|
8901
9163
|
shouldUseWebAudioApi
|
|
8902
9164
|
}) => {
|
|
8903
|
-
const audioStuffRef =
|
|
8904
|
-
const currentVolumeRef =
|
|
9165
|
+
const audioStuffRef = useRef10(null);
|
|
9166
|
+
const currentVolumeRef = useRef10(volume);
|
|
8905
9167
|
currentVolumeRef.current = volume;
|
|
8906
|
-
const sharedAudioContext =
|
|
9168
|
+
const sharedAudioContext = useContext19(SharedAudioContext);
|
|
8907
9169
|
if (!sharedAudioContext) {
|
|
8908
9170
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
8909
9171
|
}
|
|
@@ -8958,7 +9220,7 @@ var useVolume = ({
|
|
|
8958
9220
|
return audioStuffRef;
|
|
8959
9221
|
};
|
|
8960
9222
|
var useMediaStartsAt = () => {
|
|
8961
|
-
const parentSequence =
|
|
9223
|
+
const parentSequence = useContext20(SequenceContext);
|
|
8962
9224
|
const startsAt = Math.min(0, parentSequence?.relativeFrom ?? 0);
|
|
8963
9225
|
return startsAt;
|
|
8964
9226
|
};
|
|
@@ -9023,7 +9285,7 @@ var useBasicMediaInTimeline = ({
|
|
|
9023
9285
|
throw new Error("No src passed");
|
|
9024
9286
|
}
|
|
9025
9287
|
const startsAt = useMediaStartsAt();
|
|
9026
|
-
const parentSequence =
|
|
9288
|
+
const parentSequence = useContext21(SequenceContext);
|
|
9027
9289
|
const videoConfig = useVideoConfig();
|
|
9028
9290
|
const [initialVolume] = useState10(() => volume);
|
|
9029
9291
|
const mediaDuration = calculateMediaDuration({
|
|
@@ -9033,7 +9295,7 @@ var useBasicMediaInTimeline = ({
|
|
|
9033
9295
|
trimAfter
|
|
9034
9296
|
});
|
|
9035
9297
|
const duration = parentSequence ? Math.min(parentSequence.durationInFrames, mediaDuration) : mediaDuration;
|
|
9036
|
-
const volumes =
|
|
9298
|
+
const volumes = useMemo19(() => {
|
|
9037
9299
|
if (typeof volume === "number") {
|
|
9038
9300
|
return volume;
|
|
9039
9301
|
}
|
|
@@ -9045,7 +9307,7 @@ var useBasicMediaInTimeline = ({
|
|
|
9045
9307
|
});
|
|
9046
9308
|
}).join(",");
|
|
9047
9309
|
}, [duration, startsAt, volume, mediaVolume]);
|
|
9048
|
-
|
|
9310
|
+
useEffect6(() => {
|
|
9049
9311
|
if (typeof volume === "number" && volume !== initialVolume) {
|
|
9050
9312
|
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`);
|
|
9051
9313
|
}
|
|
@@ -9072,10 +9334,11 @@ var useImageInTimeline = ({
|
|
|
9072
9334
|
showInTimeline,
|
|
9073
9335
|
premountDisplay,
|
|
9074
9336
|
postmountDisplay,
|
|
9075
|
-
loopDisplay
|
|
9337
|
+
loopDisplay,
|
|
9338
|
+
controls
|
|
9076
9339
|
}) => {
|
|
9077
|
-
const parentSequence =
|
|
9078
|
-
const { registerSequence, unregisterSequence } =
|
|
9340
|
+
const parentSequence = useContext21(SequenceContext);
|
|
9341
|
+
const { registerSequence, unregisterSequence } = useContext21(SequenceManager);
|
|
9079
9342
|
const { duration, nonce, rootId, isStudio, finalDisplayName } = useBasicMediaInTimeline({
|
|
9080
9343
|
volume: undefined,
|
|
9081
9344
|
mediaVolume: 0,
|
|
@@ -9086,7 +9349,7 @@ var useImageInTimeline = ({
|
|
|
9086
9349
|
trimBefore: undefined,
|
|
9087
9350
|
playbackRate: 1
|
|
9088
9351
|
});
|
|
9089
|
-
|
|
9352
|
+
useEffect6(() => {
|
|
9090
9353
|
if (!src) {
|
|
9091
9354
|
throw new Error("No src passed");
|
|
9092
9355
|
}
|
|
@@ -9111,7 +9374,7 @@ var useImageInTimeline = ({
|
|
|
9111
9374
|
stack,
|
|
9112
9375
|
premountDisplay,
|
|
9113
9376
|
postmountDisplay,
|
|
9114
|
-
controls
|
|
9377
|
+
controls
|
|
9115
9378
|
});
|
|
9116
9379
|
return () => {
|
|
9117
9380
|
unregisterSequence(id);
|
|
@@ -9131,7 +9394,8 @@ var useImageInTimeline = ({
|
|
|
9131
9394
|
isStudio,
|
|
9132
9395
|
loopDisplay,
|
|
9133
9396
|
rootId,
|
|
9134
|
-
finalDisplayName
|
|
9397
|
+
finalDisplayName,
|
|
9398
|
+
controls
|
|
9135
9399
|
]);
|
|
9136
9400
|
};
|
|
9137
9401
|
var useMediaInTimeline = ({
|
|
@@ -9148,9 +9412,9 @@ var useMediaInTimeline = ({
|
|
|
9148
9412
|
postmountDisplay,
|
|
9149
9413
|
loopDisplay
|
|
9150
9414
|
}) => {
|
|
9151
|
-
const parentSequence =
|
|
9415
|
+
const parentSequence = useContext21(SequenceContext);
|
|
9152
9416
|
const startsAt = useMediaStartsAt();
|
|
9153
|
-
const { registerSequence, unregisterSequence } =
|
|
9417
|
+
const { registerSequence, unregisterSequence } = useContext21(SequenceManager);
|
|
9154
9418
|
const {
|
|
9155
9419
|
volumes,
|
|
9156
9420
|
duration,
|
|
@@ -9169,7 +9433,7 @@ var useMediaInTimeline = ({
|
|
|
9169
9433
|
trimBefore: undefined,
|
|
9170
9434
|
playbackRate
|
|
9171
9435
|
});
|
|
9172
|
-
|
|
9436
|
+
useEffect6(() => {
|
|
9173
9437
|
if (!src) {
|
|
9174
9438
|
throw new Error("No src passed");
|
|
9175
9439
|
}
|
|
@@ -9232,7 +9496,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
9232
9496
|
const [onResumeCallbacks, setOnResumeCallbacks] = useState11([]);
|
|
9233
9497
|
const env = useRemotionEnvironment();
|
|
9234
9498
|
const rendering = env.isRendering;
|
|
9235
|
-
const buffering =
|
|
9499
|
+
const buffering = useRef11(false);
|
|
9236
9500
|
const addBlock = useCallback8((block) => {
|
|
9237
9501
|
if (rendering) {
|
|
9238
9502
|
return {
|
|
@@ -9270,7 +9534,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
9270
9534
|
}
|
|
9271
9535
|
};
|
|
9272
9536
|
}, []);
|
|
9273
|
-
|
|
9537
|
+
useEffect7(() => {
|
|
9274
9538
|
if (rendering) {
|
|
9275
9539
|
return;
|
|
9276
9540
|
}
|
|
@@ -9300,22 +9564,22 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
9300
9564
|
}
|
|
9301
9565
|
}, [blocks]);
|
|
9302
9566
|
}
|
|
9303
|
-
return
|
|
9567
|
+
return useMemo20(() => {
|
|
9304
9568
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
9305
9569
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
9306
9570
|
};
|
|
9307
|
-
var BufferingContextReact =
|
|
9571
|
+
var BufferingContextReact = React17.createContext(null);
|
|
9308
9572
|
var BufferingProvider = ({ children }) => {
|
|
9309
|
-
const { logLevel, mountTime } =
|
|
9573
|
+
const { logLevel, mountTime } = useContext22(LogLevelContext);
|
|
9310
9574
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
|
|
9311
|
-
return /* @__PURE__ */
|
|
9575
|
+
return /* @__PURE__ */ jsx19(BufferingContextReact.Provider, {
|
|
9312
9576
|
value: bufferManager,
|
|
9313
9577
|
children
|
|
9314
9578
|
});
|
|
9315
9579
|
};
|
|
9316
9580
|
var useIsPlayerBuffering = (bufferManager) => {
|
|
9317
9581
|
const [isBuffering, setIsBuffering] = useState11(bufferManager.buffering.current);
|
|
9318
|
-
|
|
9582
|
+
useEffect7(() => {
|
|
9319
9583
|
const onBuffer = () => {
|
|
9320
9584
|
setIsBuffering(true);
|
|
9321
9585
|
};
|
|
@@ -9336,9 +9600,9 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
9336
9600
|
return isBuffering;
|
|
9337
9601
|
};
|
|
9338
9602
|
var useBufferState = () => {
|
|
9339
|
-
const buffer =
|
|
9603
|
+
const buffer = useContext23(BufferingContextReact);
|
|
9340
9604
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
9341
|
-
return
|
|
9605
|
+
return useMemo21(() => ({
|
|
9342
9606
|
delayPlayback: () => {
|
|
9343
9607
|
if (!addBlock) {
|
|
9344
9608
|
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");
|
|
@@ -9362,7 +9626,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
9362
9626
|
logLevel,
|
|
9363
9627
|
mountTime
|
|
9364
9628
|
}) => {
|
|
9365
|
-
const bufferingRef =
|
|
9629
|
+
const bufferingRef = useRef12(false);
|
|
9366
9630
|
const { delayPlayback } = useBufferState();
|
|
9367
9631
|
const bufferUntilFirstFrame = useCallback9((requestedTime) => {
|
|
9368
9632
|
if (mediaType !== "video") {
|
|
@@ -9435,7 +9699,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
9435
9699
|
onVariableFpsVideoDetected,
|
|
9436
9700
|
pauseWhenBuffering
|
|
9437
9701
|
]);
|
|
9438
|
-
return
|
|
9702
|
+
return useMemo22(() => {
|
|
9439
9703
|
return {
|
|
9440
9704
|
isBuffering: () => bufferingRef.current,
|
|
9441
9705
|
bufferUntilFirstFrame
|
|
@@ -9443,7 +9707,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
9443
9707
|
}, [bufferUntilFirstFrame]);
|
|
9444
9708
|
};
|
|
9445
9709
|
var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
|
|
9446
|
-
const lastUpdate =
|
|
9710
|
+
const lastUpdate = React18.useRef({
|
|
9447
9711
|
time: mediaRef.current?.currentTime ?? 0,
|
|
9448
9712
|
lastUpdate: performance.now()
|
|
9449
9713
|
});
|
|
@@ -9484,7 +9748,7 @@ var useMediaBuffering = ({
|
|
|
9484
9748
|
}) => {
|
|
9485
9749
|
const buffer = useBufferState();
|
|
9486
9750
|
const [isBuffering, setIsBuffering] = useState12(false);
|
|
9487
|
-
|
|
9751
|
+
useEffect8(() => {
|
|
9488
9752
|
let cleanupFns = [];
|
|
9489
9753
|
const { current } = element;
|
|
9490
9754
|
if (!current) {
|
|
@@ -9616,8 +9880,8 @@ var useRequestVideoCallbackTime = ({
|
|
|
9616
9880
|
lastSeek,
|
|
9617
9881
|
onVariableFpsVideoDetected
|
|
9618
9882
|
}) => {
|
|
9619
|
-
const currentTime =
|
|
9620
|
-
|
|
9883
|
+
const currentTime = useRef13(null);
|
|
9884
|
+
useEffect9(() => {
|
|
9621
9885
|
const { current } = mediaRef;
|
|
9622
9886
|
if (current) {
|
|
9623
9887
|
currentTime.current = {
|
|
@@ -9841,17 +10105,17 @@ var useMediaPlayback = ({
|
|
|
9841
10105
|
const frame = useCurrentFrame();
|
|
9842
10106
|
const absoluteFrame = useTimelinePosition();
|
|
9843
10107
|
const [playing] = usePlayingState();
|
|
9844
|
-
const buffering =
|
|
10108
|
+
const buffering = useContext24(BufferingContextReact);
|
|
9845
10109
|
const { fps } = useVideoConfig();
|
|
9846
10110
|
const mediaStartsAt = useMediaStartsAt();
|
|
9847
|
-
const lastSeekDueToShift =
|
|
9848
|
-
const lastSeek =
|
|
10111
|
+
const lastSeekDueToShift = useRef14(null);
|
|
10112
|
+
const lastSeek = useRef14(null);
|
|
9849
10113
|
const logLevel = useLogLevel();
|
|
9850
10114
|
const mountTime = useMountTime();
|
|
9851
10115
|
if (!buffering) {
|
|
9852
10116
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
9853
10117
|
}
|
|
9854
|
-
const isVariableFpsVideoMap =
|
|
10118
|
+
const isVariableFpsVideoMap = useRef14({});
|
|
9855
10119
|
const onVariableFpsVideoDetected = useCallback10(() => {
|
|
9856
10120
|
if (!src) {
|
|
9857
10121
|
return;
|
|
@@ -9903,7 +10167,7 @@ var useMediaPlayback = ({
|
|
|
9903
10167
|
return acceptableTimeshift ?? defaultAcceptableTimeshift;
|
|
9904
10168
|
})();
|
|
9905
10169
|
const isPlayerBuffering = useIsPlayerBuffering(buffering);
|
|
9906
|
-
|
|
10170
|
+
useEffect10(() => {
|
|
9907
10171
|
if (mediaRef.current?.paused) {
|
|
9908
10172
|
return;
|
|
9909
10173
|
}
|
|
@@ -9948,7 +10212,7 @@ var useMediaPlayback = ({
|
|
|
9948
10212
|
mediaRef.current.playbackRate = playbackRateToSet;
|
|
9949
10213
|
}
|
|
9950
10214
|
}, [mediaRef, playbackRate]);
|
|
9951
|
-
|
|
10215
|
+
useEffect10(() => {
|
|
9952
10216
|
const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
|
|
9953
10217
|
if (!mediaRef.current) {
|
|
9954
10218
|
throw new Error(`No ${mediaType} ref found`);
|
|
@@ -10077,7 +10341,7 @@ var useMediaTag = ({
|
|
|
10077
10341
|
const logLevel = useLogLevel();
|
|
10078
10342
|
const mountTime = useMountTime();
|
|
10079
10343
|
const env = useRemotionEnvironment();
|
|
10080
|
-
|
|
10344
|
+
useEffect11(() => {
|
|
10081
10345
|
const tag = {
|
|
10082
10346
|
id,
|
|
10083
10347
|
play: (reason) => {
|
|
@@ -10116,11 +10380,11 @@ var useMediaTag = ({
|
|
|
10116
10380
|
env.isPlayer
|
|
10117
10381
|
]);
|
|
10118
10382
|
};
|
|
10119
|
-
var MediaVolumeContext =
|
|
10383
|
+
var MediaVolumeContext = createContext19({
|
|
10120
10384
|
mediaMuted: false,
|
|
10121
10385
|
mediaVolume: 1
|
|
10122
10386
|
});
|
|
10123
|
-
var SetMediaVolumeContext =
|
|
10387
|
+
var SetMediaVolumeContext = createContext19({
|
|
10124
10388
|
setMediaMuted: () => {
|
|
10125
10389
|
throw new Error("default");
|
|
10126
10390
|
},
|
|
@@ -10129,16 +10393,16 @@ var SetMediaVolumeContext = createContext18({
|
|
|
10129
10393
|
}
|
|
10130
10394
|
});
|
|
10131
10395
|
var useMediaVolumeState = () => {
|
|
10132
|
-
const { mediaVolume } =
|
|
10133
|
-
const { setMediaVolume } =
|
|
10134
|
-
return
|
|
10396
|
+
const { mediaVolume } = useContext25(MediaVolumeContext);
|
|
10397
|
+
const { setMediaVolume } = useContext25(SetMediaVolumeContext);
|
|
10398
|
+
return useMemo23(() => {
|
|
10135
10399
|
return [mediaVolume, setMediaVolume];
|
|
10136
10400
|
}, [mediaVolume, setMediaVolume]);
|
|
10137
10401
|
};
|
|
10138
10402
|
var useMediaMutedState = () => {
|
|
10139
|
-
const { mediaMuted } =
|
|
10140
|
-
const { setMediaMuted } =
|
|
10141
|
-
return
|
|
10403
|
+
const { mediaMuted } = useContext25(MediaVolumeContext);
|
|
10404
|
+
const { setMediaMuted } = useContext25(SetMediaVolumeContext);
|
|
10405
|
+
return useMemo23(() => {
|
|
10142
10406
|
return [mediaMuted, setMediaMuted];
|
|
10143
10407
|
}, [mediaMuted, setMediaMuted]);
|
|
10144
10408
|
};
|
|
@@ -10187,12 +10451,12 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10187
10451
|
const [mediaVolume] = useMediaVolumeState();
|
|
10188
10452
|
const [mediaMuted] = useMediaMutedState();
|
|
10189
10453
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
10190
|
-
const { hidden } =
|
|
10454
|
+
const { hidden } = useContext26(SequenceVisibilityToggleContext);
|
|
10191
10455
|
if (!src) {
|
|
10192
10456
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
10193
10457
|
}
|
|
10194
10458
|
const preloadedSrc = usePreload(src);
|
|
10195
|
-
const sequenceContext =
|
|
10459
|
+
const sequenceContext = useContext26(SequenceContext);
|
|
10196
10460
|
const [timelineId] = useState13(() => String(Math.random()));
|
|
10197
10461
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
10198
10462
|
const userPreferredVolume = evaluateVolume({
|
|
@@ -10206,7 +10470,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10206
10470
|
requestsVideoFrame: false,
|
|
10207
10471
|
isClientSideRendering: false
|
|
10208
10472
|
});
|
|
10209
|
-
const propsToPass =
|
|
10473
|
+
const propsToPass = useMemo24(() => {
|
|
10210
10474
|
return {
|
|
10211
10475
|
muted: muted || mediaMuted || isSequenceHidden || userPreferredVolume <= 0,
|
|
10212
10476
|
src: preloadedSrc,
|
|
@@ -10224,7 +10488,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10224
10488
|
userPreferredVolume,
|
|
10225
10489
|
crossOriginValue
|
|
10226
10490
|
]);
|
|
10227
|
-
const id =
|
|
10491
|
+
const id = useMemo24(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
|
|
10228
10492
|
src,
|
|
10229
10493
|
sequenceContext?.relativeFrom,
|
|
10230
10494
|
sequenceContext?.cumulatedFrom,
|
|
@@ -10283,7 +10547,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10283
10547
|
volume: userPreferredVolume,
|
|
10284
10548
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
10285
10549
|
});
|
|
10286
|
-
const effectToUse =
|
|
10550
|
+
const effectToUse = React19.useInsertionEffect ?? React19.useLayoutEffect;
|
|
10287
10551
|
effectToUse(() => {
|
|
10288
10552
|
return () => {
|
|
10289
10553
|
requestAnimationFrame(() => {
|
|
@@ -10294,9 +10558,9 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10294
10558
|
useImperativeHandle4(ref, () => {
|
|
10295
10559
|
return audioRef.current;
|
|
10296
10560
|
}, [audioRef]);
|
|
10297
|
-
const currentOnDurationCallback =
|
|
10561
|
+
const currentOnDurationCallback = useRef15(onDuration);
|
|
10298
10562
|
currentOnDurationCallback.current = onDuration;
|
|
10299
|
-
|
|
10563
|
+
useEffect12(() => {
|
|
10300
10564
|
const { current } = audioRef;
|
|
10301
10565
|
if (!current) {
|
|
10302
10566
|
return;
|
|
@@ -10316,7 +10580,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10316
10580
|
if (initialShouldPreMountAudioElements) {
|
|
10317
10581
|
return null;
|
|
10318
10582
|
}
|
|
10319
|
-
return /* @__PURE__ */
|
|
10583
|
+
return /* @__PURE__ */ jsx20("audio", {
|
|
10320
10584
|
ref: audioRef,
|
|
10321
10585
|
preload: "metadata",
|
|
10322
10586
|
crossOrigin: crossOriginValue,
|
|
@@ -10325,7 +10589,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10325
10589
|
};
|
|
10326
10590
|
var AudioForPreview = forwardRef4(AudioForDevelopmentForwardRefFunction);
|
|
10327
10591
|
var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
10328
|
-
const audioRef =
|
|
10592
|
+
const audioRef = useRef16(null);
|
|
10329
10593
|
const {
|
|
10330
10594
|
volume: volumeProp,
|
|
10331
10595
|
playbackRate,
|
|
@@ -10347,10 +10611,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10347
10611
|
const absoluteFrame = useTimelinePosition();
|
|
10348
10612
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
10349
10613
|
const frame = useCurrentFrame();
|
|
10350
|
-
const sequenceContext =
|
|
10351
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
10614
|
+
const sequenceContext = useContext27(SequenceContext);
|
|
10615
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext27(RenderAssetManager);
|
|
10352
10616
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
10353
|
-
const id =
|
|
10617
|
+
const id = useMemo25(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
10354
10618
|
props.src,
|
|
10355
10619
|
sequenceContext?.relativeFrom,
|
|
10356
10620
|
sequenceContext?.cumulatedFrom,
|
|
@@ -10365,7 +10629,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10365
10629
|
useImperativeHandle5(ref, () => {
|
|
10366
10630
|
return audioRef.current;
|
|
10367
10631
|
}, []);
|
|
10368
|
-
|
|
10632
|
+
useEffect13(() => {
|
|
10369
10633
|
if (!props.src) {
|
|
10370
10634
|
throw new Error("No src passed");
|
|
10371
10635
|
}
|
|
@@ -10449,7 +10713,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10449
10713
|
if (!needsToRenderAudioTag) {
|
|
10450
10714
|
return null;
|
|
10451
10715
|
}
|
|
10452
|
-
return /* @__PURE__ */
|
|
10716
|
+
return /* @__PURE__ */ jsx21("audio", {
|
|
10453
10717
|
ref: audioRef,
|
|
10454
10718
|
...nativeProps,
|
|
10455
10719
|
onError: onNativeError
|
|
@@ -10457,7 +10721,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10457
10721
|
};
|
|
10458
10722
|
var AudioForRendering = forwardRef5(AudioForRenderingRefForwardingFunction);
|
|
10459
10723
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
10460
|
-
const audioContext =
|
|
10724
|
+
const audioContext = useContext28(SharedAudioContext);
|
|
10461
10725
|
const {
|
|
10462
10726
|
startFrom,
|
|
10463
10727
|
endAt,
|
|
@@ -10476,7 +10740,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10476
10740
|
if (environment.isClientSideRendering) {
|
|
10477
10741
|
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");
|
|
10478
10742
|
}
|
|
10479
|
-
const { durations, setDurations } =
|
|
10743
|
+
const { durations, setDurations } = useContext28(DurationsContext);
|
|
10480
10744
|
if (typeof props.src !== "string") {
|
|
10481
10745
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
10482
10746
|
}
|
|
@@ -10508,14 +10772,14 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10508
10772
|
});
|
|
10509
10773
|
if (loop && durationFetched !== undefined) {
|
|
10510
10774
|
if (!Number.isFinite(durationFetched)) {
|
|
10511
|
-
return /* @__PURE__ */
|
|
10775
|
+
return /* @__PURE__ */ jsx222(Html5Audio, {
|
|
10512
10776
|
...propsOtherThanLoop,
|
|
10513
10777
|
ref,
|
|
10514
10778
|
_remotionInternalNativeLoopPassed: true
|
|
10515
10779
|
});
|
|
10516
10780
|
}
|
|
10517
10781
|
const duration = durationFetched * fps;
|
|
10518
|
-
return /* @__PURE__ */
|
|
10782
|
+
return /* @__PURE__ */ jsx222(Loop, {
|
|
10519
10783
|
layout: "none",
|
|
10520
10784
|
durationInFrames: calculateMediaDuration({
|
|
10521
10785
|
trimAfter: trimAfterValue,
|
|
@@ -10523,7 +10787,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10523
10787
|
playbackRate: props.playbackRate ?? 1,
|
|
10524
10788
|
trimBefore: trimBeforeValue
|
|
10525
10789
|
}),
|
|
10526
|
-
children: /* @__PURE__ */
|
|
10790
|
+
children: /* @__PURE__ */ jsx222(Html5Audio, {
|
|
10527
10791
|
...propsOtherThanLoop,
|
|
10528
10792
|
ref,
|
|
10529
10793
|
_remotionInternalNativeLoopPassed: true
|
|
@@ -10531,13 +10795,13 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10531
10795
|
});
|
|
10532
10796
|
}
|
|
10533
10797
|
if (typeof trimBeforeValue !== "undefined" || typeof trimAfterValue !== "undefined") {
|
|
10534
|
-
return /* @__PURE__ */
|
|
10798
|
+
return /* @__PURE__ */ jsx222(Sequence, {
|
|
10535
10799
|
layout: "none",
|
|
10536
10800
|
from: 0 - (trimBeforeValue ?? 0),
|
|
10537
10801
|
showInTimeline: false,
|
|
10538
10802
|
durationInFrames: trimAfterValue,
|
|
10539
10803
|
name,
|
|
10540
|
-
children: /* @__PURE__ */
|
|
10804
|
+
children: /* @__PURE__ */ jsx222(Html5Audio, {
|
|
10541
10805
|
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
10542
10806
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
10543
10807
|
...otherProps,
|
|
@@ -10547,7 +10811,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10547
10811
|
}
|
|
10548
10812
|
validateMediaProps({ playbackRate: props.playbackRate, volume: props.volume }, "Html5Audio");
|
|
10549
10813
|
if (environment.isRendering) {
|
|
10550
|
-
return /* @__PURE__ */
|
|
10814
|
+
return /* @__PURE__ */ jsx222(AudioForRendering, {
|
|
10551
10815
|
onDuration,
|
|
10552
10816
|
...props,
|
|
10553
10817
|
ref,
|
|
@@ -10555,321 +10819,243 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10555
10819
|
_remotionInternalNeedsDurationCalculation: Boolean(loop)
|
|
10556
10820
|
});
|
|
10557
10821
|
}
|
|
10558
|
-
return /* @__PURE__ */
|
|
10822
|
+
return /* @__PURE__ */ jsx222(AudioForPreview, {
|
|
10559
10823
|
_remotionInternalNativeLoopPassed: props._remotionInternalNativeLoopPassed ?? false,
|
|
10560
10824
|
_remotionInternalStack: stack ?? null,
|
|
10561
10825
|
shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0,
|
|
10562
10826
|
...props,
|
|
10563
10827
|
ref,
|
|
10564
|
-
onNativeError: onError,
|
|
10565
|
-
onDuration,
|
|
10566
|
-
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
10567
|
-
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
10568
|
-
showInTimeline: showInTimeline ?? true
|
|
10569
|
-
});
|
|
10570
|
-
};
|
|
10571
|
-
var Html5Audio = forwardRef6(AudioRefForwardingFunction);
|
|
10572
|
-
addSequenceStackTraces(Html5Audio);
|
|
10573
|
-
var Audio = Html5Audio;
|
|
10574
|
-
var getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
10575
|
-
var invalidFolderNameErrorMessage = `Folder name must match ${String(getRegex())}`;
|
|
10576
|
-
var FolderContext = createContext19({
|
|
10577
|
-
folderName: null,
|
|
10578
|
-
parentName: null
|
|
10579
|
-
});
|
|
10580
|
-
var rotate = {
|
|
10581
|
-
transform: `rotate(90deg)`
|
|
10582
|
-
};
|
|
10583
|
-
var ICON_SIZE = 40;
|
|
10584
|
-
var label = {
|
|
10585
|
-
color: "white",
|
|
10586
|
-
fontSize: 14,
|
|
10587
|
-
fontFamily: "sans-serif"
|
|
10588
|
-
};
|
|
10589
|
-
var container = {
|
|
10590
|
-
justifyContent: "center",
|
|
10591
|
-
alignItems: "center"
|
|
10592
|
-
};
|
|
10593
|
-
var Loading = () => {
|
|
10594
|
-
return /* @__PURE__ */ jsxs22(AbsoluteFill, {
|
|
10595
|
-
style: container,
|
|
10596
|
-
id: "remotion-comp-loading",
|
|
10597
|
-
children: [
|
|
10598
|
-
/* @__PURE__ */ jsx21("style", {
|
|
10599
|
-
type: "text/css",
|
|
10600
|
-
children: `
|
|
10601
|
-
@keyframes anim {
|
|
10602
|
-
from {
|
|
10603
|
-
opacity: 0
|
|
10604
|
-
}
|
|
10605
|
-
to {
|
|
10606
|
-
opacity: 1
|
|
10607
|
-
}
|
|
10608
|
-
}
|
|
10609
|
-
#remotion-comp-loading {
|
|
10610
|
-
animation: anim 2s;
|
|
10611
|
-
animation-fill-mode: forwards;
|
|
10612
|
-
}
|
|
10613
|
-
`
|
|
10614
|
-
}),
|
|
10615
|
-
/* @__PURE__ */ jsx21("svg", {
|
|
10616
|
-
width: ICON_SIZE,
|
|
10617
|
-
height: ICON_SIZE,
|
|
10618
|
-
viewBox: "-100 -100 400 400",
|
|
10619
|
-
style: rotate,
|
|
10620
|
-
children: /* @__PURE__ */ jsx21("path", {
|
|
10621
|
-
fill: "#555",
|
|
10622
|
-
stroke: "#555",
|
|
10623
|
-
strokeWidth: "100",
|
|
10624
|
-
strokeLinejoin: "round",
|
|
10625
|
-
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"
|
|
10626
|
-
})
|
|
10627
|
-
}),
|
|
10628
|
-
/* @__PURE__ */ jsxs22("p", {
|
|
10629
|
-
style: label,
|
|
10630
|
-
children: [
|
|
10631
|
-
"Resolving ",
|
|
10632
|
-
"<Suspense>",
|
|
10633
|
-
"..."
|
|
10634
|
-
]
|
|
10635
|
-
})
|
|
10636
|
-
]
|
|
10828
|
+
onNativeError: onError,
|
|
10829
|
+
onDuration,
|
|
10830
|
+
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
10831
|
+
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
10832
|
+
showInTimeline: showInTimeline ?? true
|
|
10637
10833
|
});
|
|
10638
10834
|
};
|
|
10639
|
-
var
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10835
|
+
var Html5Audio = forwardRef6(AudioRefForwardingFunction);
|
|
10836
|
+
addSequenceStackTraces(Html5Audio);
|
|
10837
|
+
var Audio = Html5Audio;
|
|
10838
|
+
var kSplineTableSize = 11;
|
|
10839
|
+
var kSampleStepSize = 1 / (kSplineTableSize - 1);
|
|
10840
|
+
var IFrameRefForwarding = ({
|
|
10841
|
+
onLoad,
|
|
10842
|
+
onError,
|
|
10843
|
+
delayRenderRetries,
|
|
10844
|
+
delayRenderTimeoutInMilliseconds,
|
|
10845
|
+
...props2
|
|
10846
|
+
}, ref) => {
|
|
10847
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
10848
|
+
const [handle] = useState14(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
|
|
10849
|
+
retries: delayRenderRetries ?? undefined,
|
|
10850
|
+
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
10851
|
+
}));
|
|
10852
|
+
const didLoad = useCallback12((e) => {
|
|
10853
|
+
continueRender2(handle);
|
|
10854
|
+
onLoad?.(e);
|
|
10855
|
+
}, [handle, onLoad, continueRender2]);
|
|
10856
|
+
const didGetError = useCallback12((e) => {
|
|
10857
|
+
continueRender2(handle);
|
|
10858
|
+
if (onError) {
|
|
10859
|
+
onError(e);
|
|
10860
|
+
} else {
|
|
10861
|
+
console.error("Error loading iframe:", e, "Handle the event using the onError() prop to make this message disappear.");
|
|
10644
10862
|
}
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
_portalNode.style.display = "flex";
|
|
10654
|
-
_portalNode.style.flexDirection = "column";
|
|
10655
|
-
const containerNode = document.createElement("div");
|
|
10656
|
-
containerNode.style.position = "fixed";
|
|
10657
|
-
containerNode.style.top = -999999 + "px";
|
|
10658
|
-
containerNode.appendChild(_portalNode);
|
|
10659
|
-
document.body.appendChild(containerNode);
|
|
10660
|
-
}
|
|
10661
|
-
return _portalNode;
|
|
10863
|
+
}, [handle, onError, continueRender2]);
|
|
10864
|
+
return /* @__PURE__ */ jsx23("iframe", {
|
|
10865
|
+
referrerPolicy: "strict-origin-when-cross-origin",
|
|
10866
|
+
...props2,
|
|
10867
|
+
ref,
|
|
10868
|
+
onError: didGetError,
|
|
10869
|
+
onLoad: didLoad
|
|
10870
|
+
});
|
|
10662
10871
|
};
|
|
10663
|
-
var
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10872
|
+
var IFrame = forwardRef7(IFrameRefForwarding);
|
|
10873
|
+
var getEffectiveVisualModeValue = ({
|
|
10874
|
+
codeValue,
|
|
10875
|
+
runtimeValue,
|
|
10876
|
+
dragOverrideValue,
|
|
10877
|
+
defaultValue,
|
|
10878
|
+
shouldResortToDefaultValueIfUndefined = false
|
|
10667
10879
|
}) => {
|
|
10668
|
-
|
|
10669
|
-
|
|
10670
|
-
componentRef.current = compProps.component;
|
|
10671
|
-
}
|
|
10672
|
-
const lazy = useMemo25(() => {
|
|
10673
|
-
if ("component" in compProps) {
|
|
10674
|
-
if (typeof document === "undefined" || noSuspense) {
|
|
10675
|
-
return compProps.component;
|
|
10676
|
-
}
|
|
10677
|
-
if (typeof compProps.component === "undefined") {
|
|
10678
|
-
throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
10679
|
-
}
|
|
10680
|
-
const Wrapper = (props2) => {
|
|
10681
|
-
const Comp = componentRef.current;
|
|
10682
|
-
return React20.createElement(Comp, props2);
|
|
10683
|
-
};
|
|
10684
|
-
return Wrapper;
|
|
10685
|
-
}
|
|
10686
|
-
if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
|
|
10687
|
-
if (typeof compProps.lazyComponent === "undefined") {
|
|
10688
|
-
throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
10689
|
-
}
|
|
10690
|
-
return React20.lazy(compProps.lazyComponent);
|
|
10691
|
-
}
|
|
10692
|
-
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
10693
|
-
}, [compProps.lazyComponent]);
|
|
10694
|
-
return lazy;
|
|
10695
|
-
};
|
|
10696
|
-
var getRegex2 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
10697
|
-
var isCompositionIdValid = (id) => id.match(getRegex2());
|
|
10698
|
-
var validateCompositionId = (id) => {
|
|
10699
|
-
if (!isCompositionIdValid(id)) {
|
|
10700
|
-
throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`);
|
|
10880
|
+
if (dragOverrideValue !== undefined) {
|
|
10881
|
+
return dragOverrideValue;
|
|
10701
10882
|
}
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
10705
|
-
if (!defaultProps) {
|
|
10706
|
-
return;
|
|
10883
|
+
if (!codeValue) {
|
|
10884
|
+
return runtimeValue;
|
|
10707
10885
|
}
|
|
10708
|
-
if (
|
|
10709
|
-
|
|
10886
|
+
if (!codeValue.canUpdate) {
|
|
10887
|
+
return runtimeValue;
|
|
10710
10888
|
}
|
|
10711
|
-
if (
|
|
10712
|
-
|
|
10889
|
+
if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
|
|
10890
|
+
return defaultValue;
|
|
10713
10891
|
}
|
|
10892
|
+
return codeValue.codeValue;
|
|
10714
10893
|
};
|
|
10715
|
-
var
|
|
10716
|
-
const
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
};
|
|
10723
|
-
var InnerComposition = ({
|
|
10724
|
-
width,
|
|
10725
|
-
height,
|
|
10726
|
-
fps,
|
|
10727
|
-
durationInFrames,
|
|
10728
|
-
id,
|
|
10729
|
-
defaultProps,
|
|
10730
|
-
schema,
|
|
10731
|
-
...compProps
|
|
10732
|
-
}) => {
|
|
10733
|
-
const compManager = useContext28(CompositionSetters);
|
|
10734
|
-
const { registerComposition, unregisterComposition } = compManager;
|
|
10735
|
-
const video = useVideo();
|
|
10736
|
-
const lazy = useLazyComponent({
|
|
10737
|
-
compProps,
|
|
10738
|
-
componentName: "Composition",
|
|
10739
|
-
noSuspense: false
|
|
10740
|
-
});
|
|
10741
|
-
const nonce = useNonce();
|
|
10742
|
-
const isPlayer = useIsPlayer();
|
|
10743
|
-
const environment = useRemotionEnvironment();
|
|
10744
|
-
const canUseComposition = useContext28(CanUseRemotionHooks);
|
|
10745
|
-
if (typeof window !== "undefined") {
|
|
10746
|
-
window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
|
|
10747
|
-
}
|
|
10748
|
-
if (canUseComposition) {
|
|
10749
|
-
if (isPlayer) {
|
|
10750
|
-
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.");
|
|
10894
|
+
var useSchema = (schema, currentValue) => {
|
|
10895
|
+
const env = useRemotionEnvironment();
|
|
10896
|
+
const earlyReturn = useMemo26(() => {
|
|
10897
|
+
if (!env.isStudio || env.isReadOnlyStudio) {
|
|
10898
|
+
return {
|
|
10899
|
+
controls: undefined,
|
|
10900
|
+
values: currentValue ?? {}
|
|
10901
|
+
};
|
|
10751
10902
|
}
|
|
10752
|
-
|
|
10903
|
+
return;
|
|
10904
|
+
}, [env.isStudio, env.isReadOnlyStudio, currentValue]);
|
|
10905
|
+
if (earlyReturn) {
|
|
10906
|
+
return earlyReturn;
|
|
10753
10907
|
}
|
|
10754
|
-
const
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10908
|
+
const [overrideId] = useState15(() => String(Math.random()));
|
|
10909
|
+
const {
|
|
10910
|
+
visualModeEnabled,
|
|
10911
|
+
dragOverrides: overrides,
|
|
10912
|
+
codeValues
|
|
10913
|
+
} = useContext29(VisualModeOverridesContext);
|
|
10914
|
+
const controls = useMemo26(() => {
|
|
10915
|
+
if (!visualModeEnabled) {
|
|
10916
|
+
return;
|
|
10758
10917
|
}
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
id,
|
|
10767
|
-
folderName,
|
|
10768
|
-
component: lazy,
|
|
10769
|
-
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
10770
|
-
nonce: nonce.get(),
|
|
10771
|
-
parentFolderName: parentName,
|
|
10772
|
-
schema: schema ?? null,
|
|
10773
|
-
calculateMetadata: compProps.calculateMetadata ?? null
|
|
10774
|
-
});
|
|
10775
|
-
return () => {
|
|
10776
|
-
unregisterComposition(id);
|
|
10918
|
+
if (schema === null || currentValue === null) {
|
|
10919
|
+
return;
|
|
10920
|
+
}
|
|
10921
|
+
return {
|
|
10922
|
+
schema,
|
|
10923
|
+
currentValue,
|
|
10924
|
+
overrideId
|
|
10777
10925
|
};
|
|
10778
|
-
}, [
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
defaultProps,
|
|
10786
|
-
width,
|
|
10787
|
-
nonce,
|
|
10788
|
-
parentName,
|
|
10789
|
-
schema,
|
|
10790
|
-
compProps.calculateMetadata,
|
|
10791
|
-
registerComposition,
|
|
10792
|
-
unregisterComposition
|
|
10793
|
-
]);
|
|
10794
|
-
const resolved = useResolvedVideoConfig(id);
|
|
10795
|
-
if (environment.isStudio && video && video.component === lazy && video.id === id) {
|
|
10796
|
-
const Comp = lazy;
|
|
10797
|
-
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
10798
|
-
return null;
|
|
10926
|
+
}, [schema, currentValue, overrideId, visualModeEnabled]);
|
|
10927
|
+
return useMemo26(() => {
|
|
10928
|
+
if (controls === undefined || currentValue === null || schema === null || !visualModeEnabled) {
|
|
10929
|
+
return {
|
|
10930
|
+
controls: undefined,
|
|
10931
|
+
values: currentValue ?? {}
|
|
10932
|
+
};
|
|
10799
10933
|
}
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10934
|
+
const overrideValues = overrides[overrideId] ?? {};
|
|
10935
|
+
const propStatus = codeValues[overrideId];
|
|
10936
|
+
const currentValueKeys = Object.keys(currentValue);
|
|
10937
|
+
const keysToUpdate = [...new Set(currentValueKeys)];
|
|
10938
|
+
const merged = {};
|
|
10939
|
+
for (const key of keysToUpdate) {
|
|
10940
|
+
const codeValueStatus = propStatus?.[key] ?? null;
|
|
10941
|
+
merged[key] = getEffectiveVisualModeValue({
|
|
10942
|
+
codeValue: codeValueStatus,
|
|
10943
|
+
runtimeValue: currentValue[key],
|
|
10944
|
+
dragOverrideValue: overrideValues[key],
|
|
10945
|
+
defaultValue: schema[key]?.default,
|
|
10946
|
+
shouldResortToDefaultValueIfUndefined: false
|
|
10947
|
+
});
|
|
10813
10948
|
}
|
|
10814
|
-
return
|
|
10815
|
-
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10949
|
+
return {
|
|
10950
|
+
controls,
|
|
10951
|
+
values: merged
|
|
10952
|
+
};
|
|
10953
|
+
}, [
|
|
10954
|
+
controls,
|
|
10955
|
+
currentValue,
|
|
10956
|
+
overrideId,
|
|
10957
|
+
overrides,
|
|
10958
|
+
codeValues,
|
|
10959
|
+
schema,
|
|
10960
|
+
visualModeEnabled
|
|
10961
|
+
]);
|
|
10962
|
+
};
|
|
10963
|
+
var getNestedValue = (obj, key) => {
|
|
10964
|
+
const parts = key.split(".");
|
|
10965
|
+
let current = obj;
|
|
10966
|
+
for (const part of parts) {
|
|
10967
|
+
if (current === null || current === undefined || typeof current !== "object")
|
|
10968
|
+
return;
|
|
10969
|
+
current = current[part];
|
|
10822
10970
|
}
|
|
10823
|
-
return
|
|
10971
|
+
return current;
|
|
10824
10972
|
};
|
|
10825
|
-
var
|
|
10826
|
-
const {
|
|
10827
|
-
|
|
10828
|
-
|
|
10973
|
+
var mergeValues = (props2, values, schemaKeys) => {
|
|
10974
|
+
const merged = { ...props2 };
|
|
10975
|
+
for (const key of schemaKeys) {
|
|
10976
|
+
const value = values[key];
|
|
10977
|
+
const parts = key.split(".");
|
|
10978
|
+
if (parts.length === 1) {
|
|
10979
|
+
merged[key] = value;
|
|
10980
|
+
continue;
|
|
10981
|
+
}
|
|
10982
|
+
let current = merged;
|
|
10983
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
10984
|
+
const part = parts[i];
|
|
10985
|
+
if (typeof current[part] === "object" && current[part] !== null) {
|
|
10986
|
+
current[part] = { ...current[part] };
|
|
10987
|
+
} else {
|
|
10988
|
+
current[part] = {};
|
|
10989
|
+
}
|
|
10990
|
+
current = current[part];
|
|
10991
|
+
}
|
|
10992
|
+
current[parts[parts.length - 1]] = value;
|
|
10829
10993
|
}
|
|
10830
|
-
return
|
|
10831
|
-
...props2
|
|
10832
|
-
});
|
|
10994
|
+
return merged;
|
|
10833
10995
|
};
|
|
10834
|
-
var
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
const [handle] = useState14(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
|
|
10845
|
-
retries: delayRenderRetries ?? undefined,
|
|
10846
|
-
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
10847
|
-
}));
|
|
10848
|
-
const didLoad = useCallback12((e) => {
|
|
10849
|
-
continueRender2(handle);
|
|
10850
|
-
onLoad?.(e);
|
|
10851
|
-
}, [handle, onLoad, continueRender2]);
|
|
10852
|
-
const didGetError = useCallback12((e) => {
|
|
10853
|
-
continueRender2(handle);
|
|
10854
|
-
if (onError) {
|
|
10855
|
-
onError(e);
|
|
10856
|
-
} else {
|
|
10857
|
-
console.error("Error loading iframe:", e, "Handle the event using the onError() prop to make this message disappear.");
|
|
10996
|
+
var wrapInSchema = (Component, schema) => {
|
|
10997
|
+
const schemaKeys = Object.keys(schema);
|
|
10998
|
+
const Wrapped = forwardRef8((props2, ref) => {
|
|
10999
|
+
const env = useRemotionEnvironment();
|
|
11000
|
+
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
11001
|
+
return React23.createElement(Component, {
|
|
11002
|
+
...props2,
|
|
11003
|
+
controls: null,
|
|
11004
|
+
ref
|
|
11005
|
+
});
|
|
10858
11006
|
}
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
11007
|
+
const schemaInput = useMemo27(() => {
|
|
11008
|
+
const input = {};
|
|
11009
|
+
for (const key of schemaKeys) {
|
|
11010
|
+
input[key] = getNestedValue(props2, key);
|
|
11011
|
+
}
|
|
11012
|
+
return input;
|
|
11013
|
+
}, schemaKeys.map((key) => getNestedValue(props2, key)));
|
|
11014
|
+
const { controls, values } = useSchema(schema, schemaInput);
|
|
11015
|
+
const mergedProps = mergeValues(props2, values, schemaKeys);
|
|
11016
|
+
return React23.createElement(Component, {
|
|
11017
|
+
...mergedProps,
|
|
11018
|
+
controls,
|
|
11019
|
+
ref
|
|
11020
|
+
});
|
|
10866
11021
|
});
|
|
11022
|
+
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
11023
|
+
return Wrapped;
|
|
10867
11024
|
};
|
|
10868
|
-
var IFrame = forwardRef7(IFrameRefForwarding);
|
|
10869
11025
|
function exponentialBackoff(errorCount) {
|
|
10870
11026
|
return 1000 * 2 ** (errorCount - 1);
|
|
10871
11027
|
}
|
|
10872
|
-
var
|
|
11028
|
+
var imgSchema = {
|
|
11029
|
+
"style.translate": {
|
|
11030
|
+
type: "translate",
|
|
11031
|
+
step: 1,
|
|
11032
|
+
default: "0px 0px",
|
|
11033
|
+
description: "Position"
|
|
11034
|
+
},
|
|
11035
|
+
"style.scale": {
|
|
11036
|
+
type: "number",
|
|
11037
|
+
min: 0.05,
|
|
11038
|
+
max: 100,
|
|
11039
|
+
step: 0.01,
|
|
11040
|
+
default: 1,
|
|
11041
|
+
description: "Scale"
|
|
11042
|
+
},
|
|
11043
|
+
"style.rotate": {
|
|
11044
|
+
type: "rotation",
|
|
11045
|
+
step: 1,
|
|
11046
|
+
default: "0deg",
|
|
11047
|
+
description: "Rotation"
|
|
11048
|
+
},
|
|
11049
|
+
"style.opacity": {
|
|
11050
|
+
type: "number",
|
|
11051
|
+
min: 0,
|
|
11052
|
+
max: 1,
|
|
11053
|
+
step: 0.01,
|
|
11054
|
+
default: 1,
|
|
11055
|
+
description: "Opacity"
|
|
11056
|
+
}
|
|
11057
|
+
};
|
|
11058
|
+
var ImgInner = ({
|
|
10873
11059
|
onError,
|
|
10874
11060
|
maxRetries = 2,
|
|
10875
11061
|
src,
|
|
@@ -10881,13 +11067,15 @@ var ImgRefForwarding = ({
|
|
|
10881
11067
|
showInTimeline,
|
|
10882
11068
|
name,
|
|
10883
11069
|
stack,
|
|
11070
|
+
ref,
|
|
11071
|
+
controls,
|
|
10884
11072
|
...props2
|
|
10885
|
-
}
|
|
11073
|
+
}) => {
|
|
10886
11074
|
const imageRef = useRef17(null);
|
|
10887
11075
|
const errors = useRef17({});
|
|
10888
11076
|
const { delayPlayback } = useBufferState();
|
|
10889
|
-
const sequenceContext =
|
|
10890
|
-
const [timelineId] =
|
|
11077
|
+
const sequenceContext = useContext30(SequenceContext);
|
|
11078
|
+
const [timelineId] = useState16(() => String(Math.random()));
|
|
10891
11079
|
if (!src) {
|
|
10892
11080
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
10893
11081
|
}
|
|
@@ -10906,7 +11094,8 @@ var ImgRefForwarding = ({
|
|
|
10906
11094
|
showInTimeline: showInTimeline ?? true,
|
|
10907
11095
|
premountDisplay: sequenceContext?.premountDisplay ?? null,
|
|
10908
11096
|
postmountDisplay: sequenceContext?.postmountDisplay ?? null,
|
|
10909
|
-
loopDisplay: undefined
|
|
11097
|
+
loopDisplay: undefined,
|
|
11098
|
+
controls: controls ?? null
|
|
10910
11099
|
});
|
|
10911
11100
|
const actualSrc = usePreload(src);
|
|
10912
11101
|
const retryIn = useCallback13((timeout) => {
|
|
@@ -11029,9 +11218,9 @@ var ImgRefForwarding = ({
|
|
|
11029
11218
|
decoding: "sync"
|
|
11030
11219
|
});
|
|
11031
11220
|
};
|
|
11032
|
-
var Img =
|
|
11221
|
+
var Img = wrapInSchema(ImgInner, imgSchema);
|
|
11033
11222
|
addSequenceStackTraces(Img);
|
|
11034
|
-
var compositionsRef =
|
|
11223
|
+
var compositionsRef = React25.createRef();
|
|
11035
11224
|
var CompositionManagerProvider = ({
|
|
11036
11225
|
children,
|
|
11037
11226
|
onlyRenderComposition,
|
|
@@ -11039,9 +11228,9 @@ var CompositionManagerProvider = ({
|
|
|
11039
11228
|
initialCompositions,
|
|
11040
11229
|
initialCanvasContent
|
|
11041
11230
|
}) => {
|
|
11042
|
-
const [folders, setFolders] =
|
|
11043
|
-
const [canvasContent, setCanvasContent] =
|
|
11044
|
-
const [compositions, setCompositions] =
|
|
11231
|
+
const [folders, setFolders] = useState17([]);
|
|
11232
|
+
const [canvasContent, setCanvasContent] = useState17(initialCanvasContent);
|
|
11233
|
+
const [compositions, setCompositions] = useState17(initialCompositions);
|
|
11045
11234
|
const currentcompositionsRef = useRef18(compositions);
|
|
11046
11235
|
const updateCompositions = useCallback14((updateComps) => {
|
|
11047
11236
|
setCompositions((comps) => {
|
|
@@ -11085,7 +11274,7 @@ var CompositionManagerProvider = ({
|
|
|
11085
11274
|
getCompositions: () => currentcompositionsRef.current
|
|
11086
11275
|
};
|
|
11087
11276
|
}, []);
|
|
11088
|
-
const compositionManagerSetters =
|
|
11277
|
+
const compositionManagerSetters = useMemo28(() => {
|
|
11089
11278
|
return {
|
|
11090
11279
|
registerComposition,
|
|
11091
11280
|
unregisterComposition,
|
|
@@ -11101,7 +11290,7 @@ var CompositionManagerProvider = ({
|
|
|
11101
11290
|
unregisterFolder,
|
|
11102
11291
|
onlyRenderComposition
|
|
11103
11292
|
]);
|
|
11104
|
-
const compositionManagerContextValue =
|
|
11293
|
+
const compositionManagerContextValue = useMemo28(() => {
|
|
11105
11294
|
return {
|
|
11106
11295
|
compositions,
|
|
11107
11296
|
folders,
|
|
@@ -11175,32 +11364,11 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
11175
11364
|
}
|
|
11176
11365
|
`;
|
|
11177
11366
|
};
|
|
11178
|
-
var getEffectiveVisualModeValue = ({
|
|
11179
|
-
codeValue,
|
|
11180
|
-
runtimeValue,
|
|
11181
|
-
dragOverrideValue,
|
|
11182
|
-
defaultValue,
|
|
11183
|
-
shouldResortToDefaultValueIfUndefined = false
|
|
11184
|
-
}) => {
|
|
11185
|
-
if (dragOverrideValue !== undefined) {
|
|
11186
|
-
return dragOverrideValue;
|
|
11187
|
-
}
|
|
11188
|
-
if (!codeValue) {
|
|
11189
|
-
return runtimeValue;
|
|
11190
|
-
}
|
|
11191
|
-
if (!codeValue.canUpdate) {
|
|
11192
|
-
return runtimeValue;
|
|
11193
|
-
}
|
|
11194
|
-
if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
|
|
11195
|
-
return defaultValue;
|
|
11196
|
-
}
|
|
11197
|
-
return codeValue.codeValue;
|
|
11198
|
-
};
|
|
11199
11367
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
11200
11368
|
var getPreviewDomElement = () => {
|
|
11201
11369
|
return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
|
|
11202
11370
|
};
|
|
11203
|
-
var MaxMediaCacheSizeContext =
|
|
11371
|
+
var MaxMediaCacheSizeContext = React26.createContext(null);
|
|
11204
11372
|
var Root = null;
|
|
11205
11373
|
var listeners = [];
|
|
11206
11374
|
var getRoot = () => {
|
|
@@ -11220,7 +11388,7 @@ var waitForRoot = (fn) => {
|
|
|
11220
11388
|
};
|
|
11221
11389
|
var MediaEnabledContext = createContext20(null);
|
|
11222
11390
|
var useVideoEnabled = () => {
|
|
11223
|
-
const context =
|
|
11391
|
+
const context = useContext31(MediaEnabledContext);
|
|
11224
11392
|
if (!context) {
|
|
11225
11393
|
return window.remotion_videoEnabled;
|
|
11226
11394
|
}
|
|
@@ -11230,7 +11398,7 @@ var useVideoEnabled = () => {
|
|
|
11230
11398
|
return context.videoEnabled;
|
|
11231
11399
|
};
|
|
11232
11400
|
var useAudioEnabled = () => {
|
|
11233
|
-
const context =
|
|
11401
|
+
const context = useContext31(MediaEnabledContext);
|
|
11234
11402
|
if (!context) {
|
|
11235
11403
|
return window.remotion_audioEnabled;
|
|
11236
11404
|
}
|
|
@@ -11244,7 +11412,7 @@ var MediaEnabledProvider = ({
|
|
|
11244
11412
|
videoEnabled,
|
|
11245
11413
|
audioEnabled
|
|
11246
11414
|
}) => {
|
|
11247
|
-
const value =
|
|
11415
|
+
const value = useMemo29(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
11248
11416
|
return /* @__PURE__ */ jsx26(MediaEnabledContext.Provider, {
|
|
11249
11417
|
value,
|
|
11250
11418
|
children
|
|
@@ -11260,13 +11428,13 @@ var RemotionRootContexts = ({
|
|
|
11260
11428
|
frameState,
|
|
11261
11429
|
visualModeEnabled
|
|
11262
11430
|
}) => {
|
|
11263
|
-
const nonceContext =
|
|
11431
|
+
const nonceContext = useMemo30(() => {
|
|
11264
11432
|
let counter = 0;
|
|
11265
11433
|
return {
|
|
11266
11434
|
getNonce: () => counter++
|
|
11267
11435
|
};
|
|
11268
11436
|
}, []);
|
|
11269
|
-
const logging =
|
|
11437
|
+
const logging = useMemo30(() => {
|
|
11270
11438
|
return { logLevel, mountTime: Date.now() };
|
|
11271
11439
|
}, [logLevel]);
|
|
11272
11440
|
return /* @__PURE__ */ jsx27(LogLevelContext.Provider, {
|
|
@@ -11465,7 +11633,7 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
11465
11633
|
};
|
|
11466
11634
|
}
|
|
11467
11635
|
};
|
|
11468
|
-
var SequenceStackTracesUpdateContext =
|
|
11636
|
+
var SequenceStackTracesUpdateContext = React28.createContext(() => {});
|
|
11469
11637
|
var getEnvVariables = () => {
|
|
11470
11638
|
if (getRemotionEnvironment().isRendering) {
|
|
11471
11639
|
const param = window.remotion_envVariables;
|
|
@@ -11491,7 +11659,7 @@ var setupEnvVariables = () => {
|
|
|
11491
11659
|
window.process.env[key] = env[key];
|
|
11492
11660
|
});
|
|
11493
11661
|
};
|
|
11494
|
-
var CurrentScaleContext =
|
|
11662
|
+
var CurrentScaleContext = React29.createContext(null);
|
|
11495
11663
|
var PreviewSizeContext = createContext21({
|
|
11496
11664
|
setSize: () => {
|
|
11497
11665
|
return;
|
|
@@ -11515,75 +11683,6 @@ var calculateScale = ({
|
|
|
11515
11683
|
}
|
|
11516
11684
|
return Number(previewSize);
|
|
11517
11685
|
};
|
|
11518
|
-
var useSchema = (schema, currentValue) => {
|
|
11519
|
-
const env = useRemotionEnvironment();
|
|
11520
|
-
const earlyReturn = useMemo29(() => {
|
|
11521
|
-
if (!env.isStudio || env.isReadOnlyStudio) {
|
|
11522
|
-
return {
|
|
11523
|
-
controls: undefined,
|
|
11524
|
-
values: currentValue ?? {}
|
|
11525
|
-
};
|
|
11526
|
-
}
|
|
11527
|
-
return;
|
|
11528
|
-
}, [env.isStudio, env.isReadOnlyStudio, currentValue]);
|
|
11529
|
-
if (earlyReturn) {
|
|
11530
|
-
return earlyReturn;
|
|
11531
|
-
}
|
|
11532
|
-
const [overrideId] = useState17(() => String(Math.random()));
|
|
11533
|
-
const {
|
|
11534
|
-
visualModeEnabled,
|
|
11535
|
-
dragOverrides: overrides,
|
|
11536
|
-
codeValues
|
|
11537
|
-
} = useContext31(VisualModeOverridesContext);
|
|
11538
|
-
const controls = useMemo29(() => {
|
|
11539
|
-
if (!visualModeEnabled) {
|
|
11540
|
-
return;
|
|
11541
|
-
}
|
|
11542
|
-
if (schema === null || currentValue === null) {
|
|
11543
|
-
return;
|
|
11544
|
-
}
|
|
11545
|
-
return {
|
|
11546
|
-
schema,
|
|
11547
|
-
currentValue,
|
|
11548
|
-
overrideId
|
|
11549
|
-
};
|
|
11550
|
-
}, [schema, currentValue, overrideId, visualModeEnabled]);
|
|
11551
|
-
return useMemo29(() => {
|
|
11552
|
-
if (controls === undefined || currentValue === null || schema === null || !visualModeEnabled) {
|
|
11553
|
-
return {
|
|
11554
|
-
controls: undefined,
|
|
11555
|
-
values: currentValue ?? {}
|
|
11556
|
-
};
|
|
11557
|
-
}
|
|
11558
|
-
const overrideValues = overrides[overrideId] ?? {};
|
|
11559
|
-
const propStatus = codeValues[overrideId];
|
|
11560
|
-
const currentValueKeys = Object.keys(currentValue);
|
|
11561
|
-
const keysToUpdate = [...new Set(currentValueKeys)];
|
|
11562
|
-
const merged = {};
|
|
11563
|
-
for (const key of keysToUpdate) {
|
|
11564
|
-
const codeValueStatus = propStatus?.[key] ?? null;
|
|
11565
|
-
merged[key] = getEffectiveVisualModeValue({
|
|
11566
|
-
codeValue: codeValueStatus,
|
|
11567
|
-
runtimeValue: currentValue[key],
|
|
11568
|
-
dragOverrideValue: overrideValues[key],
|
|
11569
|
-
defaultValue: schema[key]?.default,
|
|
11570
|
-
shouldResortToDefaultValueIfUndefined: false
|
|
11571
|
-
});
|
|
11572
|
-
}
|
|
11573
|
-
return {
|
|
11574
|
-
controls,
|
|
11575
|
-
values: merged
|
|
11576
|
-
};
|
|
11577
|
-
}, [
|
|
11578
|
-
controls,
|
|
11579
|
-
currentValue,
|
|
11580
|
-
overrideId,
|
|
11581
|
-
overrides,
|
|
11582
|
-
codeValues,
|
|
11583
|
-
schema,
|
|
11584
|
-
visualModeEnabled
|
|
11585
|
-
]);
|
|
11586
|
-
};
|
|
11587
11686
|
var useSequenceControlOverride = (key) => {
|
|
11588
11687
|
const seqContext = useContext32(SequenceContext);
|
|
11589
11688
|
const { dragOverrides: overrides } = useContext32(VisualModeOverridesContext);
|
|
@@ -11629,7 +11728,7 @@ var OffthreadVideoForRendering = ({
|
|
|
11629
11728
|
if (!src) {
|
|
11630
11729
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
11631
11730
|
}
|
|
11632
|
-
const id =
|
|
11731
|
+
const id = useMemo31(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
11633
11732
|
src,
|
|
11634
11733
|
sequenceContext?.cumulatedFrom,
|
|
11635
11734
|
sequenceContext?.relativeFrom,
|
|
@@ -11684,14 +11783,14 @@ var OffthreadVideoForRendering = ({
|
|
|
11684
11783
|
sequenceContext?.relativeFrom,
|
|
11685
11784
|
audioStreamIndex
|
|
11686
11785
|
]);
|
|
11687
|
-
const currentTime =
|
|
11786
|
+
const currentTime = useMemo31(() => {
|
|
11688
11787
|
return getExpectedMediaFrameUncorrected({
|
|
11689
11788
|
frame,
|
|
11690
11789
|
playbackRate: playbackRate || 1,
|
|
11691
11790
|
startFrom: -mediaStartsAt
|
|
11692
11791
|
}) / videoConfig.fps;
|
|
11693
11792
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
11694
|
-
const actualSrc =
|
|
11793
|
+
const actualSrc = useMemo31(() => {
|
|
11695
11794
|
return getOffthreadVideoSource({
|
|
11696
11795
|
src,
|
|
11697
11796
|
currentTime,
|
|
@@ -11779,7 +11878,7 @@ var OffthreadVideoForRendering = ({
|
|
|
11779
11878
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
11780
11879
|
}
|
|
11781
11880
|
}, [imageSrc, onError]);
|
|
11782
|
-
const className =
|
|
11881
|
+
const className = useMemo31(() => {
|
|
11783
11882
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy2).join(" ");
|
|
11784
11883
|
}, [props2.className]);
|
|
11785
11884
|
const onImageFrame = useCallback15((img) => {
|
|
@@ -11833,7 +11932,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11833
11932
|
throw new Error("SharedAudioContext not found");
|
|
11834
11933
|
}
|
|
11835
11934
|
const videoRef = useRef19(null);
|
|
11836
|
-
const sharedSource =
|
|
11935
|
+
const sharedSource = useMemo322(() => {
|
|
11837
11936
|
if (!context.audioContext) {
|
|
11838
11937
|
return null;
|
|
11839
11938
|
}
|
|
@@ -11842,7 +11941,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11842
11941
|
ref: videoRef
|
|
11843
11942
|
});
|
|
11844
11943
|
}, [context.audioContext]);
|
|
11845
|
-
const effectToUse =
|
|
11944
|
+
const effectToUse = React31.useInsertionEffect ?? React31.useLayoutEffect;
|
|
11846
11945
|
effectToUse(() => {
|
|
11847
11946
|
return () => {
|
|
11848
11947
|
requestAnimationFrame(() => {
|
|
@@ -12019,7 +12118,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
12019
12118
|
current.preload = "auto";
|
|
12020
12119
|
}
|
|
12021
12120
|
}, []);
|
|
12022
|
-
const actualStyle =
|
|
12121
|
+
const actualStyle = useMemo322(() => {
|
|
12023
12122
|
return {
|
|
12024
12123
|
...style,
|
|
12025
12124
|
opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
|
|
@@ -12200,68 +12299,6 @@ var OffthreadVideo = ({
|
|
|
12200
12299
|
};
|
|
12201
12300
|
addSequenceStackTraces(OffthreadVideo);
|
|
12202
12301
|
var WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged";
|
|
12203
|
-
var getNestedValue = (obj, key) => {
|
|
12204
|
-
const parts = key.split(".");
|
|
12205
|
-
let current = obj;
|
|
12206
|
-
for (const part of parts) {
|
|
12207
|
-
if (current === null || current === undefined || typeof current !== "object")
|
|
12208
|
-
return;
|
|
12209
|
-
current = current[part];
|
|
12210
|
-
}
|
|
12211
|
-
return current;
|
|
12212
|
-
};
|
|
12213
|
-
var mergeValues = (props2, values, schemaKeys) => {
|
|
12214
|
-
const merged = { ...props2 };
|
|
12215
|
-
for (const key of schemaKeys) {
|
|
12216
|
-
const value = values[key];
|
|
12217
|
-
const parts = key.split(".");
|
|
12218
|
-
if (parts.length === 1) {
|
|
12219
|
-
merged[key] = value;
|
|
12220
|
-
continue;
|
|
12221
|
-
}
|
|
12222
|
-
let current = merged;
|
|
12223
|
-
for (let i = 0;i < parts.length - 1; i++) {
|
|
12224
|
-
const part = parts[i];
|
|
12225
|
-
if (typeof current[part] === "object" && current[part] !== null) {
|
|
12226
|
-
current[part] = { ...current[part] };
|
|
12227
|
-
} else {
|
|
12228
|
-
current[part] = {};
|
|
12229
|
-
}
|
|
12230
|
-
current = current[part];
|
|
12231
|
-
}
|
|
12232
|
-
current[parts[parts.length - 1]] = value;
|
|
12233
|
-
}
|
|
12234
|
-
return merged;
|
|
12235
|
-
};
|
|
12236
|
-
var wrapInSchema = (Component, schema) => {
|
|
12237
|
-
const schemaKeys = Object.keys(schema);
|
|
12238
|
-
const Wrapped = forwardRef10((props2, ref) => {
|
|
12239
|
-
const env = useRemotionEnvironment();
|
|
12240
|
-
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
12241
|
-
return React32.createElement(Component, {
|
|
12242
|
-
...props2,
|
|
12243
|
-
controls: null,
|
|
12244
|
-
ref
|
|
12245
|
-
});
|
|
12246
|
-
}
|
|
12247
|
-
const schemaInput = useMemo32(() => {
|
|
12248
|
-
const input = {};
|
|
12249
|
-
for (const key of schemaKeys) {
|
|
12250
|
-
input[key] = getNestedValue(props2, key);
|
|
12251
|
-
}
|
|
12252
|
-
return input;
|
|
12253
|
-
}, schemaKeys.map((key) => getNestedValue(props2, key)));
|
|
12254
|
-
const { controls, values } = useSchema(schema, schemaInput);
|
|
12255
|
-
const mergedProps = mergeValues(props2, values, schemaKeys);
|
|
12256
|
-
return React32.createElement(Component, {
|
|
12257
|
-
...mergedProps,
|
|
12258
|
-
controls,
|
|
12259
|
-
ref
|
|
12260
|
-
});
|
|
12261
|
-
});
|
|
12262
|
-
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
12263
|
-
return Wrapped;
|
|
12264
|
-
};
|
|
12265
12302
|
function useRemotionContexts() {
|
|
12266
12303
|
const compositionManagerCtx = React33.useContext(CompositionManager);
|
|
12267
12304
|
const timelineContext = React33.useContext(TimelineContext);
|
|
@@ -12510,7 +12547,7 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
|
12510
12547
|
children
|
|
12511
12548
|
});
|
|
12512
12549
|
};
|
|
12513
|
-
var SeriesSequence =
|
|
12550
|
+
var SeriesSequence = forwardRef10(SeriesSequenceRefForwardingFunction);
|
|
12514
12551
|
var Series = (props2) => {
|
|
12515
12552
|
const childrenValue = useMemo34(() => {
|
|
12516
12553
|
let startFrame = 0;
|
|
@@ -12566,19 +12603,17 @@ var Series = (props2) => {
|
|
|
12566
12603
|
});
|
|
12567
12604
|
});
|
|
12568
12605
|
}, [props2.children]);
|
|
12569
|
-
if (ENABLE_V5_BREAKING_CHANGES) {
|
|
12570
|
-
return /* @__PURE__ */ jsx33(IsInsideSeriesContainer, {
|
|
12571
|
-
children: /* @__PURE__ */ jsx33(Sequence, {
|
|
12572
|
-
...props2,
|
|
12573
|
-
children: childrenValue
|
|
12574
|
-
})
|
|
12575
|
-
});
|
|
12576
|
-
}
|
|
12577
12606
|
return /* @__PURE__ */ jsx33(IsInsideSeriesContainer, {
|
|
12578
|
-
children:
|
|
12607
|
+
children: /* @__PURE__ */ jsx33(Sequence, {
|
|
12608
|
+
layout: "none",
|
|
12609
|
+
name: "<Series>",
|
|
12610
|
+
...props2,
|
|
12611
|
+
children: childrenValue
|
|
12612
|
+
})
|
|
12579
12613
|
});
|
|
12580
12614
|
};
|
|
12581
12615
|
Series.Sequence = SeriesSequence;
|
|
12616
|
+
addSequenceStackTraces(Series);
|
|
12582
12617
|
addSequenceStackTraces(SeriesSequence);
|
|
12583
12618
|
var validateSpringDuration = (dur) => {
|
|
12584
12619
|
if (typeof dur === "undefined") {
|
|
@@ -13234,7 +13269,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
13234
13269
|
...props2
|
|
13235
13270
|
});
|
|
13236
13271
|
};
|
|
13237
|
-
var VideoForRendering =
|
|
13272
|
+
var VideoForRendering = forwardRef11(VideoForRenderingForwardFunction);
|
|
13238
13273
|
var VideoForwardingFunction = (props2, ref) => {
|
|
13239
13274
|
const {
|
|
13240
13275
|
startFrom,
|
|
@@ -13339,7 +13374,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
13339
13374
|
onAutoPlayError: onAutoPlayError ?? undefined
|
|
13340
13375
|
});
|
|
13341
13376
|
};
|
|
13342
|
-
var Html5Video =
|
|
13377
|
+
var Html5Video = forwardRef12(VideoForwardingFunction);
|
|
13343
13378
|
addSequenceStackTraces(Html5Video);
|
|
13344
13379
|
checkMultipleRemotionVersions();
|
|
13345
13380
|
var proxyObj = {};
|
|
@@ -13364,6 +13399,7 @@ var Config = new Proxy(proxyObj, {
|
|
|
13364
13399
|
});
|
|
13365
13400
|
Sequence.displayName = "Sequence";
|
|
13366
13401
|
addSequenceStackTraces(Sequence);
|
|
13402
|
+
addSequenceStackTraces(Composition);
|
|
13367
13403
|
|
|
13368
13404
|
// ../design/dist/esm/index.mjs
|
|
13369
13405
|
import { jsx as jsx36, Fragment } from "react/jsx-runtime";
|
|
@@ -13383,49 +13419,49 @@ import { jsx as jsx113 } from "react/jsx-runtime";
|
|
|
13383
13419
|
import * as React342 from "react";
|
|
13384
13420
|
import * as ReactDOM4 from "react-dom";
|
|
13385
13421
|
import React9 from "react";
|
|
13386
|
-
import * as
|
|
13422
|
+
import * as React62 from "react";
|
|
13387
13423
|
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
13388
13424
|
import * as React7 from "react";
|
|
13389
|
-
import * as
|
|
13425
|
+
import * as React8 from "react";
|
|
13390
13426
|
import { Fragment as Fragment3, jsx as jsx132 } from "react/jsx-runtime";
|
|
13391
13427
|
import { jsx as jsx142 } from "react/jsx-runtime";
|
|
13392
13428
|
import * as React102 from "react";
|
|
13393
13429
|
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
13394
|
-
import * as
|
|
13395
|
-
import * as
|
|
13430
|
+
import * as React14 from "react";
|
|
13431
|
+
import * as React11 from "react";
|
|
13396
13432
|
import * as ReactDOM from "react-dom";
|
|
13397
13433
|
import { jsx as jsx162 } from "react/jsx-runtime";
|
|
13398
|
-
import * as
|
|
13399
|
-
import * as
|
|
13434
|
+
import * as React122 from "react";
|
|
13435
|
+
import * as React132 from "react";
|
|
13400
13436
|
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
13401
|
-
import * as
|
|
13437
|
+
import * as React15 from "react";
|
|
13402
13438
|
import * as React162 from "react";
|
|
13403
13439
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
13404
|
-
import * as
|
|
13440
|
+
import * as React182 from "react";
|
|
13405
13441
|
import * as React172 from "react";
|
|
13406
13442
|
import * as React22 from "react";
|
|
13407
|
-
import * as
|
|
13443
|
+
import * as React192 from "react";
|
|
13408
13444
|
import { useLayoutEffect as useLayoutEffect32, useEffect as useEffect82 } from "react";
|
|
13409
13445
|
import * as ReactDOM2 from "react-dom";
|
|
13410
|
-
import * as
|
|
13446
|
+
import * as React20 from "react";
|
|
13411
13447
|
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
13412
13448
|
import * as React21 from "react";
|
|
13413
13449
|
import { jsx as jsx202 } from "react/jsx-runtime";
|
|
13414
|
-
import * as
|
|
13450
|
+
import * as React232 from "react";
|
|
13415
13451
|
import ReactDOM3 from "react-dom";
|
|
13416
13452
|
import { jsx as jsx212 } from "react/jsx-runtime";
|
|
13417
|
-
import * as
|
|
13453
|
+
import * as React24 from "react";
|
|
13418
13454
|
import * as React252 from "react";
|
|
13419
|
-
import * as
|
|
13455
|
+
import * as React262 from "react";
|
|
13420
13456
|
import { jsx as jsx223 } from "react/jsx-runtime";
|
|
13421
13457
|
import * as React332 from "react";
|
|
13422
|
-
import * as
|
|
13458
|
+
import * as React292 from "react";
|
|
13423
13459
|
import { useState as useState112 } from "react";
|
|
13424
|
-
import * as
|
|
13460
|
+
import * as React27 from "react";
|
|
13425
13461
|
import * as React282 from "react";
|
|
13426
|
-
import * as
|
|
13427
|
-
import * as
|
|
13428
|
-
import * as
|
|
13462
|
+
import * as React32 from "react";
|
|
13463
|
+
import * as React312 from "react";
|
|
13464
|
+
import * as React30 from "react";
|
|
13429
13465
|
import { Fragment as Fragment62, jsx as jsx232, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
13430
13466
|
import { forwardRef as forwardRef132, createElement as createElement7 } from "react";
|
|
13431
13467
|
import { forwardRef as forwardRef122, createElement as createElement6 } from "react";
|
|
@@ -13480,7 +13516,7 @@ var getChildNodeFrom = (htmlElement) => {
|
|
|
13480
13516
|
return childNode;
|
|
13481
13517
|
};
|
|
13482
13518
|
var useHoverTransforms = (ref, disabled) => {
|
|
13483
|
-
const [state, setState] =
|
|
13519
|
+
const [state, setState] = React2.useState({
|
|
13484
13520
|
progress: 0,
|
|
13485
13521
|
isActive: false
|
|
13486
13522
|
});
|
|
@@ -13492,7 +13528,7 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
13492
13528
|
eventTarget.dispatchEvent(new Event("enabled"));
|
|
13493
13529
|
}
|
|
13494
13530
|
}, [disabled, eventTarget]);
|
|
13495
|
-
|
|
13531
|
+
React2.useEffect(() => {
|
|
13496
13532
|
const element = ref.current;
|
|
13497
13533
|
if (!element)
|
|
13498
13534
|
return;
|
|
@@ -13567,8 +13603,8 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
13567
13603
|
return state;
|
|
13568
13604
|
};
|
|
13569
13605
|
var useClickTransforms = (ref) => {
|
|
13570
|
-
const [hoverProgress, setHoverProgress] =
|
|
13571
|
-
|
|
13606
|
+
const [hoverProgress, setHoverProgress] = React2.useState(0);
|
|
13607
|
+
React2.useEffect(() => {
|
|
13572
13608
|
const element = getChildNodeFrom(ref.current);
|
|
13573
13609
|
if (!element) {
|
|
13574
13610
|
return;
|
|
@@ -14055,18 +14091,18 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
14055
14091
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
14056
14092
|
let defaultContexts = [];
|
|
14057
14093
|
function createContext32(rootComponentName, defaultContext) {
|
|
14058
|
-
const BaseContext =
|
|
14094
|
+
const BaseContext = React62.createContext(defaultContext);
|
|
14059
14095
|
const index = defaultContexts.length;
|
|
14060
14096
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
14061
14097
|
function Provider(props) {
|
|
14062
14098
|
const { scope, children, ...context } = props;
|
|
14063
14099
|
const Context = scope?.[scopeName][index] || BaseContext;
|
|
14064
|
-
const value =
|
|
14100
|
+
const value = React62.useMemo(() => context, Object.values(context));
|
|
14065
14101
|
return /* @__PURE__ */ jsx122(Context.Provider, { value, children });
|
|
14066
14102
|
}
|
|
14067
14103
|
function useContext210(consumerName, scope) {
|
|
14068
14104
|
const Context = scope?.[scopeName][index] || BaseContext;
|
|
14069
|
-
const context =
|
|
14105
|
+
const context = React62.useContext(Context);
|
|
14070
14106
|
if (context)
|
|
14071
14107
|
return context;
|
|
14072
14108
|
if (defaultContext !== undefined)
|
|
@@ -14078,11 +14114,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
14078
14114
|
}
|
|
14079
14115
|
const createScope = () => {
|
|
14080
14116
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
14081
|
-
return
|
|
14117
|
+
return React62.createContext(defaultContext);
|
|
14082
14118
|
});
|
|
14083
14119
|
return function useScope(scope) {
|
|
14084
14120
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
14085
|
-
return
|
|
14121
|
+
return React62.useMemo(() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), [scope, contexts]);
|
|
14086
14122
|
};
|
|
14087
14123
|
};
|
|
14088
14124
|
createScope.scopeName = scopeName;
|
|
@@ -14103,7 +14139,7 @@ function composeContextScopes(...scopes) {
|
|
|
14103
14139
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
14104
14140
|
return { ...nextScopes2, ...currentScope };
|
|
14105
14141
|
}, {});
|
|
14106
|
-
return
|
|
14142
|
+
return React62.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
14107
14143
|
};
|
|
14108
14144
|
};
|
|
14109
14145
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -14122,43 +14158,43 @@ function composeRefs(...refs) {
|
|
|
14122
14158
|
function useComposedRefs(...refs) {
|
|
14123
14159
|
return React7.useCallback(composeRefs(...refs), refs);
|
|
14124
14160
|
}
|
|
14125
|
-
var Slot =
|
|
14161
|
+
var Slot = React8.forwardRef((props, forwardedRef) => {
|
|
14126
14162
|
const { children, ...slotProps } = props;
|
|
14127
|
-
const childrenArray =
|
|
14163
|
+
const childrenArray = React8.Children.toArray(children);
|
|
14128
14164
|
const slottable = childrenArray.find(isSlottable);
|
|
14129
14165
|
if (slottable) {
|
|
14130
14166
|
const newElement = slottable.props.children;
|
|
14131
14167
|
const newChildren = childrenArray.map((child) => {
|
|
14132
14168
|
if (child === slottable) {
|
|
14133
|
-
if (
|
|
14134
|
-
return
|
|
14135
|
-
return
|
|
14169
|
+
if (React8.Children.count(newElement) > 1)
|
|
14170
|
+
return React8.Children.only(null);
|
|
14171
|
+
return React8.isValidElement(newElement) ? newElement.props.children : null;
|
|
14136
14172
|
} else {
|
|
14137
14173
|
return child;
|
|
14138
14174
|
}
|
|
14139
14175
|
});
|
|
14140
|
-
return /* @__PURE__ */ jsx132(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
14176
|
+
return /* @__PURE__ */ jsx132(SlotClone, { ...slotProps, ref: forwardedRef, children: React8.isValidElement(newElement) ? React8.cloneElement(newElement, undefined, newChildren) : null });
|
|
14141
14177
|
}
|
|
14142
14178
|
return /* @__PURE__ */ jsx132(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
14143
14179
|
});
|
|
14144
14180
|
Slot.displayName = "Slot";
|
|
14145
|
-
var SlotClone =
|
|
14181
|
+
var SlotClone = React8.forwardRef((props, forwardedRef) => {
|
|
14146
14182
|
const { children, ...slotProps } = props;
|
|
14147
|
-
if (
|
|
14183
|
+
if (React8.isValidElement(children)) {
|
|
14148
14184
|
const childrenRef = getElementRef(children);
|
|
14149
|
-
return
|
|
14185
|
+
return React8.cloneElement(children, {
|
|
14150
14186
|
...mergeProps(slotProps, children.props),
|
|
14151
14187
|
ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef
|
|
14152
14188
|
});
|
|
14153
14189
|
}
|
|
14154
|
-
return
|
|
14190
|
+
return React8.Children.count(children) > 1 ? React8.Children.only(null) : null;
|
|
14155
14191
|
});
|
|
14156
14192
|
SlotClone.displayName = "SlotClone";
|
|
14157
14193
|
var Slottable = ({ children }) => {
|
|
14158
14194
|
return /* @__PURE__ */ jsx132(Fragment3, { children });
|
|
14159
14195
|
};
|
|
14160
14196
|
function isSlottable(child) {
|
|
14161
|
-
return
|
|
14197
|
+
return React8.isValidElement(child) && child.type === Slottable;
|
|
14162
14198
|
}
|
|
14163
14199
|
function mergeProps(slotProps, childProps) {
|
|
14164
14200
|
const overrideProps = { ...childProps };
|
|
@@ -14272,7 +14308,7 @@ var NODES = [
|
|
|
14272
14308
|
"ul"
|
|
14273
14309
|
];
|
|
14274
14310
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
14275
|
-
const Node2 =
|
|
14311
|
+
const Node2 = React11.forwardRef((props, forwardedRef) => {
|
|
14276
14312
|
const { asChild, ...primitiveProps } = props;
|
|
14277
14313
|
const Comp = asChild ? Slot : node;
|
|
14278
14314
|
if (typeof window !== "undefined") {
|
|
@@ -14288,15 +14324,15 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
14288
14324
|
ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
14289
14325
|
}
|
|
14290
14326
|
function useCallbackRef(callback) {
|
|
14291
|
-
const callbackRef =
|
|
14292
|
-
|
|
14327
|
+
const callbackRef = React122.useRef(callback);
|
|
14328
|
+
React122.useEffect(() => {
|
|
14293
14329
|
callbackRef.current = callback;
|
|
14294
14330
|
});
|
|
14295
|
-
return
|
|
14331
|
+
return React122.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
14296
14332
|
}
|
|
14297
14333
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
14298
14334
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
14299
|
-
|
|
14335
|
+
React132.useEffect(() => {
|
|
14300
14336
|
const handleKeyDown = (event) => {
|
|
14301
14337
|
if (event.key === "Escape") {
|
|
14302
14338
|
onEscapeKeyDown(event);
|
|
@@ -14311,12 +14347,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
14311
14347
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
14312
14348
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
14313
14349
|
var originalBodyPointerEvents;
|
|
14314
|
-
var DismissableLayerContext =
|
|
14350
|
+
var DismissableLayerContext = React14.createContext({
|
|
14315
14351
|
layers: /* @__PURE__ */ new Set,
|
|
14316
14352
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set,
|
|
14317
14353
|
branches: /* @__PURE__ */ new Set
|
|
14318
14354
|
});
|
|
14319
|
-
var DismissableLayer =
|
|
14355
|
+
var DismissableLayer = React14.forwardRef((props, forwardedRef) => {
|
|
14320
14356
|
const {
|
|
14321
14357
|
disableOutsidePointerEvents = false,
|
|
14322
14358
|
onEscapeKeyDown,
|
|
@@ -14326,10 +14362,10 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
14326
14362
|
onDismiss,
|
|
14327
14363
|
...layerProps
|
|
14328
14364
|
} = props;
|
|
14329
|
-
const context =
|
|
14330
|
-
const [node, setNode] =
|
|
14365
|
+
const context = React14.useContext(DismissableLayerContext);
|
|
14366
|
+
const [node, setNode] = React14.useState(null);
|
|
14331
14367
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
14332
|
-
const [, force] =
|
|
14368
|
+
const [, force] = React14.useState({});
|
|
14333
14369
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
14334
14370
|
const layers = Array.from(context.layers);
|
|
14335
14371
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -14367,7 +14403,7 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
14367
14403
|
onDismiss();
|
|
14368
14404
|
}
|
|
14369
14405
|
}, ownerDocument);
|
|
14370
|
-
|
|
14406
|
+
React14.useEffect(() => {
|
|
14371
14407
|
if (!node)
|
|
14372
14408
|
return;
|
|
14373
14409
|
if (disableOutsidePointerEvents) {
|
|
@@ -14385,7 +14421,7 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
14385
14421
|
}
|
|
14386
14422
|
};
|
|
14387
14423
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
14388
|
-
|
|
14424
|
+
React14.useEffect(() => {
|
|
14389
14425
|
return () => {
|
|
14390
14426
|
if (!node)
|
|
14391
14427
|
return;
|
|
@@ -14394,7 +14430,7 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
14394
14430
|
dispatchUpdate();
|
|
14395
14431
|
};
|
|
14396
14432
|
}, [node, context]);
|
|
14397
|
-
|
|
14433
|
+
React14.useEffect(() => {
|
|
14398
14434
|
const handleUpdate = () => force({});
|
|
14399
14435
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
14400
14436
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -14413,11 +14449,11 @@ var DismissableLayer = React142.forwardRef((props, forwardedRef) => {
|
|
|
14413
14449
|
});
|
|
14414
14450
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
14415
14451
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
14416
|
-
var DismissableLayerBranch =
|
|
14417
|
-
const context =
|
|
14418
|
-
const ref =
|
|
14452
|
+
var DismissableLayerBranch = React14.forwardRef((props, forwardedRef) => {
|
|
14453
|
+
const context = React14.useContext(DismissableLayerContext);
|
|
14454
|
+
const ref = React14.useRef(null);
|
|
14419
14455
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14420
|
-
|
|
14456
|
+
React14.useEffect(() => {
|
|
14421
14457
|
const node = ref.current;
|
|
14422
14458
|
if (node) {
|
|
14423
14459
|
context.branches.add(node);
|
|
@@ -14431,9 +14467,9 @@ var DismissableLayerBranch = React142.forwardRef((props, forwardedRef) => {
|
|
|
14431
14467
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
14432
14468
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
14433
14469
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
14434
|
-
const isPointerInsideReactTreeRef =
|
|
14435
|
-
const handleClickRef =
|
|
14436
|
-
|
|
14470
|
+
const isPointerInsideReactTreeRef = React14.useRef(false);
|
|
14471
|
+
const handleClickRef = React14.useRef(() => {});
|
|
14472
|
+
React14.useEffect(() => {
|
|
14437
14473
|
const handlePointerDown = (event) => {
|
|
14438
14474
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
14439
14475
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -14468,8 +14504,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
14468
14504
|
}
|
|
14469
14505
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
14470
14506
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
14471
|
-
const isFocusInsideReactTreeRef =
|
|
14472
|
-
|
|
14507
|
+
const isFocusInsideReactTreeRef = React14.useRef(false);
|
|
14508
|
+
React14.useEffect(() => {
|
|
14473
14509
|
const handleFocus = (event) => {
|
|
14474
14510
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
14475
14511
|
const eventDetail = { originalEvent: event };
|
|
@@ -14503,7 +14539,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
14503
14539
|
}
|
|
14504
14540
|
var count = 0;
|
|
14505
14541
|
function useFocusGuards() {
|
|
14506
|
-
|
|
14542
|
+
React15.useEffect(() => {
|
|
14507
14543
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
14508
14544
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
14509
14545
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -14739,12 +14775,12 @@ function removeLinks(items) {
|
|
|
14739
14775
|
return items.filter((item) => item.tagName !== "A");
|
|
14740
14776
|
}
|
|
14741
14777
|
var useLayoutEffect22 = Boolean(globalThis?.document) ? React172.useLayoutEffect : () => {};
|
|
14742
|
-
var useReactId =
|
|
14778
|
+
var useReactId = React182["useId".toString()] || (() => {
|
|
14743
14779
|
return;
|
|
14744
14780
|
});
|
|
14745
14781
|
var count2 = 0;
|
|
14746
14782
|
function useId(deterministicId) {
|
|
14747
|
-
const [id, setId] =
|
|
14783
|
+
const [id, setId] = React182.useState(useReactId());
|
|
14748
14784
|
useLayoutEffect22(() => {
|
|
14749
14785
|
if (!deterministicId)
|
|
14750
14786
|
setId((reactId) => reactId ?? String(count2++));
|
|
@@ -16323,7 +16359,7 @@ function roundByDPR(element, value) {
|
|
|
16323
16359
|
return Math.round(value * dpr) / dpr;
|
|
16324
16360
|
}
|
|
16325
16361
|
function useLatestRef(value) {
|
|
16326
|
-
const ref =
|
|
16362
|
+
const ref = React192.useRef(value);
|
|
16327
16363
|
index(() => {
|
|
16328
16364
|
ref.current = value;
|
|
16329
16365
|
});
|
|
@@ -16346,7 +16382,7 @@ function useFloating(options) {
|
|
|
16346
16382
|
whileElementsMounted,
|
|
16347
16383
|
open
|
|
16348
16384
|
} = options;
|
|
16349
|
-
const [data, setData] =
|
|
16385
|
+
const [data, setData] = React192.useState({
|
|
16350
16386
|
x: 0,
|
|
16351
16387
|
y: 0,
|
|
16352
16388
|
strategy,
|
|
@@ -16354,19 +16390,19 @@ function useFloating(options) {
|
|
|
16354
16390
|
middlewareData: {},
|
|
16355
16391
|
isPositioned: false
|
|
16356
16392
|
});
|
|
16357
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
16393
|
+
const [latestMiddleware, setLatestMiddleware] = React192.useState(middleware);
|
|
16358
16394
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
16359
16395
|
setLatestMiddleware(middleware);
|
|
16360
16396
|
}
|
|
16361
|
-
const [_reference, _setReference] =
|
|
16362
|
-
const [_floating, _setFloating] =
|
|
16363
|
-
const setReference =
|
|
16397
|
+
const [_reference, _setReference] = React192.useState(null);
|
|
16398
|
+
const [_floating, _setFloating] = React192.useState(null);
|
|
16399
|
+
const setReference = React192.useCallback((node) => {
|
|
16364
16400
|
if (node !== referenceRef.current) {
|
|
16365
16401
|
referenceRef.current = node;
|
|
16366
16402
|
_setReference(node);
|
|
16367
16403
|
}
|
|
16368
16404
|
}, []);
|
|
16369
|
-
const setFloating =
|
|
16405
|
+
const setFloating = React192.useCallback((node) => {
|
|
16370
16406
|
if (node !== floatingRef.current) {
|
|
16371
16407
|
floatingRef.current = node;
|
|
16372
16408
|
_setFloating(node);
|
|
@@ -16374,13 +16410,13 @@ function useFloating(options) {
|
|
|
16374
16410
|
}, []);
|
|
16375
16411
|
const referenceEl = externalReference || _reference;
|
|
16376
16412
|
const floatingEl = externalFloating || _floating;
|
|
16377
|
-
const referenceRef =
|
|
16378
|
-
const floatingRef =
|
|
16379
|
-
const dataRef =
|
|
16413
|
+
const referenceRef = React192.useRef(null);
|
|
16414
|
+
const floatingRef = React192.useRef(null);
|
|
16415
|
+
const dataRef = React192.useRef(data);
|
|
16380
16416
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
16381
16417
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
16382
16418
|
const platformRef = useLatestRef(platform2);
|
|
16383
|
-
const update =
|
|
16419
|
+
const update = React192.useCallback(() => {
|
|
16384
16420
|
if (!referenceRef.current || !floatingRef.current) {
|
|
16385
16421
|
return;
|
|
16386
16422
|
}
|
|
@@ -16414,7 +16450,7 @@ function useFloating(options) {
|
|
|
16414
16450
|
}));
|
|
16415
16451
|
}
|
|
16416
16452
|
}, [open]);
|
|
16417
|
-
const isMountedRef =
|
|
16453
|
+
const isMountedRef = React192.useRef(false);
|
|
16418
16454
|
index(() => {
|
|
16419
16455
|
isMountedRef.current = true;
|
|
16420
16456
|
return () => {
|
|
@@ -16433,17 +16469,17 @@ function useFloating(options) {
|
|
|
16433
16469
|
update();
|
|
16434
16470
|
}
|
|
16435
16471
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
16436
|
-
const refs =
|
|
16472
|
+
const refs = React192.useMemo(() => ({
|
|
16437
16473
|
reference: referenceRef,
|
|
16438
16474
|
floating: floatingRef,
|
|
16439
16475
|
setReference,
|
|
16440
16476
|
setFloating
|
|
16441
16477
|
}), [setReference, setFloating]);
|
|
16442
|
-
const elements =
|
|
16478
|
+
const elements = React192.useMemo(() => ({
|
|
16443
16479
|
reference: referenceEl,
|
|
16444
16480
|
floating: floatingEl
|
|
16445
16481
|
}), [referenceEl, floatingEl]);
|
|
16446
|
-
const floatingStyles =
|
|
16482
|
+
const floatingStyles = React192.useMemo(() => {
|
|
16447
16483
|
const initialStyles = {
|
|
16448
16484
|
position: strategy,
|
|
16449
16485
|
left: 0,
|
|
@@ -16469,7 +16505,7 @@ function useFloating(options) {
|
|
|
16469
16505
|
top: y
|
|
16470
16506
|
};
|
|
16471
16507
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
16472
|
-
return
|
|
16508
|
+
return React192.useMemo(() => ({
|
|
16473
16509
|
...data,
|
|
16474
16510
|
update,
|
|
16475
16511
|
refs,
|
|
@@ -16537,7 +16573,7 @@ var arrow3 = (options, deps) => ({
|
|
|
16537
16573
|
options: [options, deps]
|
|
16538
16574
|
});
|
|
16539
16575
|
var NAME = "Arrow";
|
|
16540
|
-
var Arrow =
|
|
16576
|
+
var Arrow = React20.forwardRef((props, forwardedRef) => {
|
|
16541
16577
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
16542
16578
|
return /* @__PURE__ */ jsx192(Primitive.svg, {
|
|
16543
16579
|
...arrowProps,
|
|
@@ -16818,9 +16854,9 @@ var Anchor = PopperAnchor;
|
|
|
16818
16854
|
var Content = PopperContent;
|
|
16819
16855
|
var Arrow2 = PopperArrow;
|
|
16820
16856
|
var PORTAL_NAME = "Portal";
|
|
16821
|
-
var Portal =
|
|
16857
|
+
var Portal = React232.forwardRef((props, forwardedRef) => {
|
|
16822
16858
|
const { container: containerProp, ...portalProps } = props;
|
|
16823
|
-
const [mounted, setMounted] =
|
|
16859
|
+
const [mounted, setMounted] = React232.useState(false);
|
|
16824
16860
|
useLayoutEffect22(() => setMounted(true), []);
|
|
16825
16861
|
const container22 = containerProp || mounted && globalThis?.document?.body;
|
|
16826
16862
|
return container22 ? ReactDOM3.createPortal(/* @__PURE__ */ jsx212(Primitive.div, { ...portalProps, ref: forwardedRef }), container22) : null;
|
|
@@ -16835,7 +16871,7 @@ function useControllableState({
|
|
|
16835
16871
|
const isControlled = prop !== undefined;
|
|
16836
16872
|
const value = isControlled ? prop : uncontrolledProp;
|
|
16837
16873
|
const handleChange = useCallbackRef(onChange);
|
|
16838
|
-
const setValue =
|
|
16874
|
+
const setValue = React24.useCallback((nextValue) => {
|
|
16839
16875
|
if (isControlled) {
|
|
16840
16876
|
const setter = nextValue;
|
|
16841
16877
|
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
@@ -16851,11 +16887,11 @@ function useUncontrolledState({
|
|
|
16851
16887
|
defaultProp,
|
|
16852
16888
|
onChange
|
|
16853
16889
|
}) {
|
|
16854
|
-
const uncontrolledState =
|
|
16890
|
+
const uncontrolledState = React24.useState(defaultProp);
|
|
16855
16891
|
const [value] = uncontrolledState;
|
|
16856
|
-
const prevValueRef =
|
|
16892
|
+
const prevValueRef = React24.useRef(value);
|
|
16857
16893
|
const handleChange = useCallbackRef(onChange);
|
|
16858
|
-
|
|
16894
|
+
React24.useEffect(() => {
|
|
16859
16895
|
if (prevValueRef.current !== value) {
|
|
16860
16896
|
handleChange(value);
|
|
16861
16897
|
prevValueRef.current = value;
|
|
@@ -16874,7 +16910,7 @@ function usePrevious(value) {
|
|
|
16874
16910
|
}, [value]);
|
|
16875
16911
|
}
|
|
16876
16912
|
var NAME2 = "VisuallyHidden";
|
|
16877
|
-
var VisuallyHidden =
|
|
16913
|
+
var VisuallyHidden = React262.forwardRef((props, forwardedRef) => {
|
|
16878
16914
|
return /* @__PURE__ */ jsx223(Primitive.span, {
|
|
16879
16915
|
...props,
|
|
16880
16916
|
ref: forwardedRef,
|
|
@@ -17082,7 +17118,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
17082
17118
|
ref.callback = callback;
|
|
17083
17119
|
return ref.facade;
|
|
17084
17120
|
}
|
|
17085
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
17121
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React27.useLayoutEffect : React27.useEffect;
|
|
17086
17122
|
var currentValues = new WeakMap;
|
|
17087
17123
|
function useMergeRefs(refs, defaultValue) {
|
|
17088
17124
|
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
@@ -17215,9 +17251,9 @@ var effectCar = createSidecarMedium();
|
|
|
17215
17251
|
var nothing = function() {
|
|
17216
17252
|
return;
|
|
17217
17253
|
};
|
|
17218
|
-
var RemoveScroll =
|
|
17219
|
-
var ref =
|
|
17220
|
-
var _a =
|
|
17254
|
+
var RemoveScroll = React292.forwardRef(function(props, parentRef) {
|
|
17255
|
+
var ref = React292.useRef(null);
|
|
17256
|
+
var _a = React292.useState({
|
|
17221
17257
|
onScrollCapture: nothing,
|
|
17222
17258
|
onWheelCapture: nothing,
|
|
17223
17259
|
onTouchMoveCapture: nothing
|
|
@@ -17226,7 +17262,7 @@ var RemoveScroll = React29.forwardRef(function(props, parentRef) {
|
|
|
17226
17262
|
var SideCar2 = sideCar;
|
|
17227
17263
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
17228
17264
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
17229
|
-
return
|
|
17265
|
+
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));
|
|
17230
17266
|
});
|
|
17231
17267
|
RemoveScroll.defaultProps = {
|
|
17232
17268
|
enabled: true,
|
|
@@ -17294,7 +17330,7 @@ var stylesheetSingleton = function() {
|
|
|
17294
17330
|
var styleHookSingleton = function() {
|
|
17295
17331
|
var sheet = stylesheetSingleton();
|
|
17296
17332
|
return function(styles, isDynamic) {
|
|
17297
|
-
|
|
17333
|
+
React30.useEffect(function() {
|
|
17298
17334
|
sheet.add(styles);
|
|
17299
17335
|
return function() {
|
|
17300
17336
|
sheet.remove();
|
|
@@ -17399,7 +17435,7 @@ var getCurrentUseCounter = function() {
|
|
|
17399
17435
|
return isFinite(counter) ? counter : 0;
|
|
17400
17436
|
};
|
|
17401
17437
|
var useLockAttribute = function() {
|
|
17402
|
-
|
|
17438
|
+
React312.useEffect(function() {
|
|
17403
17439
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
17404
17440
|
return function() {
|
|
17405
17441
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -17414,10 +17450,10 @@ var useLockAttribute = function() {
|
|
|
17414
17450
|
var RemoveScrollBar = function(_a) {
|
|
17415
17451
|
var { noRelative, noImportant, gapMode: _b } = _a, gapMode = _b === undefined ? "margin" : _b;
|
|
17416
17452
|
useLockAttribute();
|
|
17417
|
-
var gap =
|
|
17453
|
+
var gap = React312.useMemo(function() {
|
|
17418
17454
|
return getGapWidth(gapMode);
|
|
17419
17455
|
}, [gapMode]);
|
|
17420
|
-
return
|
|
17456
|
+
return React312.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
17421
17457
|
};
|
|
17422
17458
|
var passiveSupported = false;
|
|
17423
17459
|
if (typeof window !== "undefined") {
|
|
@@ -17544,16 +17580,16 @@ var generateStyle = function(id) {
|
|
|
17544
17580
|
var idCounter = 0;
|
|
17545
17581
|
var lockStack = [];
|
|
17546
17582
|
function RemoveScrollSideCar(props) {
|
|
17547
|
-
var shouldPreventQueue =
|
|
17548
|
-
var touchStartRef =
|
|
17549
|
-
var activeAxis =
|
|
17550
|
-
var id =
|
|
17551
|
-
var Style2 =
|
|
17552
|
-
var lastProps =
|
|
17553
|
-
|
|
17583
|
+
var shouldPreventQueue = React32.useRef([]);
|
|
17584
|
+
var touchStartRef = React32.useRef([0, 0]);
|
|
17585
|
+
var activeAxis = React32.useRef();
|
|
17586
|
+
var id = React32.useState(idCounter++)[0];
|
|
17587
|
+
var Style2 = React32.useState(styleSingleton)[0];
|
|
17588
|
+
var lastProps = React32.useRef(props);
|
|
17589
|
+
React32.useEffect(function() {
|
|
17554
17590
|
lastProps.current = props;
|
|
17555
17591
|
}, [props]);
|
|
17556
|
-
|
|
17592
|
+
React32.useEffect(function() {
|
|
17557
17593
|
if (props.inert) {
|
|
17558
17594
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
17559
17595
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
@@ -17569,7 +17605,7 @@ function RemoveScrollSideCar(props) {
|
|
|
17569
17605
|
}
|
|
17570
17606
|
return;
|
|
17571
17607
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
17572
|
-
var shouldCancelEvent =
|
|
17608
|
+
var shouldCancelEvent = React32.useCallback(function(event, parent) {
|
|
17573
17609
|
if ("touches" in event && event.touches.length === 2) {
|
|
17574
17610
|
return !lastProps.current.allowPinchZoom;
|
|
17575
17611
|
}
|
|
@@ -17605,7 +17641,7 @@ function RemoveScrollSideCar(props) {
|
|
|
17605
17641
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
17606
17642
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
17607
17643
|
}, []);
|
|
17608
|
-
var shouldPrevent =
|
|
17644
|
+
var shouldPrevent = React32.useCallback(function(_event) {
|
|
17609
17645
|
var event = _event;
|
|
17610
17646
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
17611
17647
|
return;
|
|
@@ -17632,7 +17668,7 @@ function RemoveScrollSideCar(props) {
|
|
|
17632
17668
|
}
|
|
17633
17669
|
}
|
|
17634
17670
|
}, []);
|
|
17635
|
-
var shouldCancel =
|
|
17671
|
+
var shouldCancel = React32.useCallback(function(name, delta, target, should) {
|
|
17636
17672
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
17637
17673
|
shouldPreventQueue.current.push(event);
|
|
17638
17674
|
setTimeout(function() {
|
|
@@ -17641,17 +17677,17 @@ function RemoveScrollSideCar(props) {
|
|
|
17641
17677
|
});
|
|
17642
17678
|
}, 1);
|
|
17643
17679
|
}, []);
|
|
17644
|
-
var scrollTouchStart =
|
|
17680
|
+
var scrollTouchStart = React32.useCallback(function(event) {
|
|
17645
17681
|
touchStartRef.current = getTouchXY(event);
|
|
17646
17682
|
activeAxis.current = undefined;
|
|
17647
17683
|
}, []);
|
|
17648
|
-
var scrollWheel =
|
|
17684
|
+
var scrollWheel = React32.useCallback(function(event) {
|
|
17649
17685
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
17650
17686
|
}, []);
|
|
17651
|
-
var scrollTouchMove =
|
|
17687
|
+
var scrollTouchMove = React32.useCallback(function(event) {
|
|
17652
17688
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
17653
17689
|
}, []);
|
|
17654
|
-
|
|
17690
|
+
React32.useEffect(function() {
|
|
17655
17691
|
lockStack.push(Style2);
|
|
17656
17692
|
props.setCallbacks({
|
|
17657
17693
|
onScrollCapture: scrollWheel,
|
|
@@ -17671,7 +17707,7 @@ function RemoveScrollSideCar(props) {
|
|
|
17671
17707
|
};
|
|
17672
17708
|
}, []);
|
|
17673
17709
|
var { removeScrollBar, inert } = props;
|
|
17674
|
-
return
|
|
17710
|
+
return React32.createElement(React32.Fragment, null, inert ? React32.createElement(Style2, { styles: generateStyle(id) }) : null, removeScrollBar ? React32.createElement(RemoveScrollBar, { gapMode: props.gapMode }) : null);
|
|
17675
17711
|
}
|
|
17676
17712
|
function getOutermostShadowParent(node) {
|
|
17677
17713
|
var shadowParent = null;
|
|
@@ -18780,7 +18816,7 @@ var Switch = ({ active, onToggle }) => {
|
|
|
18780
18816
|
onClick: onToggle,
|
|
18781
18817
|
children: /* @__PURE__ */ jsx252("div", {
|
|
18782
18818
|
"data-active": active,
|
|
18783
|
-
className: "h-[20px] w-[20px]
|
|
18819
|
+
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)]"
|
|
18784
18820
|
})
|
|
18785
18821
|
});
|
|
18786
18822
|
};
|