@remotion/promo-pages 4.0.475 → 4.0.477
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 +1397 -949
- 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 +19 -0
- package/dist/components/experts/experts-data.js +391 -0
- package/dist/components/experts/experts-icons.d.ts +8 -0
- package/dist/components/experts/experts-icons.js +42 -0
- package/dist/components/experts.d.ts +3 -0
- package/dist/components/experts.js +2 -0
- package/dist/components/homepage/AutomationsSection.d.ts +3 -0
- package/dist/components/homepage/AutomationsSection.js +85 -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 +133 -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/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 +15 -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 +1180 -766
- package/dist/experts.js +655 -554
- 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 +1174 -760
- package/dist/main.d.ts +1 -0
- package/dist/main.js +6 -0
- package/dist/prompts/PromptsGallery.js +1176 -762
- package/dist/prompts/PromptsShow.js +1180 -766
- package/dist/prompts/PromptsSubmit.js +1182 -768
- 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/team.d.ts +1 -0
- package/dist/team.js +1172 -758
- package/dist/template-modal-content.js +1179 -765
- package/dist/templates.js +1172 -758
- package/package.json +13 -13
|
@@ -17370,7 +17370,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
|
|
|
17370
17370
|
import * as React23 from "react";
|
|
17371
17371
|
import * as React3 from "react";
|
|
17372
17372
|
import { Fragment as Fragment2, jsx as jsx43 } from "react/jsx-runtime";
|
|
17373
|
-
import React52, { useCallback as
|
|
17373
|
+
import React52, { useCallback as useCallback27, useRef as useRef210, useState as useState22 } from "react";
|
|
17374
17374
|
|
|
17375
17375
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
17376
17376
|
function r(e) {
|
|
@@ -21507,6 +21507,7 @@ import { useContext as useContext8, useMemo as useMemo7 } from "react";
|
|
|
21507
21507
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
21508
21508
|
import {
|
|
21509
21509
|
forwardRef as forwardRef3,
|
|
21510
|
+
useCallback as useCallback6,
|
|
21510
21511
|
useContext as useContext17,
|
|
21511
21512
|
useEffect as useEffect3,
|
|
21512
21513
|
useMemo as useMemo14,
|
|
@@ -21545,14 +21546,14 @@ import {
|
|
|
21545
21546
|
useRef as useRef9,
|
|
21546
21547
|
useState as useState6
|
|
21547
21548
|
} from "react";
|
|
21548
|
-
import React15, { useCallback as
|
|
21549
|
+
import React15, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo16, useRef as useRef8 } from "react";
|
|
21549
21550
|
import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef7 } from "react";
|
|
21550
21551
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
21551
21552
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
21552
21553
|
import { useContext as useContext18, useLayoutEffect as useLayoutEffect4, useState as useState8 } from "react";
|
|
21553
21554
|
import {
|
|
21554
21555
|
createContext as createContext17,
|
|
21555
|
-
useCallback as
|
|
21556
|
+
useCallback as useCallback8,
|
|
21556
21557
|
useImperativeHandle as useImperativeHandle3,
|
|
21557
21558
|
useLayoutEffect as useLayoutEffect3,
|
|
21558
21559
|
useMemo as useMemo17,
|
|
@@ -21560,7 +21561,7 @@ import {
|
|
|
21560
21561
|
useState as useState7
|
|
21561
21562
|
} from "react";
|
|
21562
21563
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
21563
|
-
import { forwardRef as forwardRef7, useCallback as
|
|
21564
|
+
import { forwardRef as forwardRef7, useCallback as useCallback14, useContext as useContext30 } from "react";
|
|
21564
21565
|
import React16, { createContext as createContext18, useMemo as useMemo18 } from "react";
|
|
21565
21566
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
21566
21567
|
import { useContext as useContext19 } from "react";
|
|
@@ -21568,7 +21569,7 @@ import { createContext as createContext19, useEffect as useEffect6, useState as
|
|
|
21568
21569
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
21569
21570
|
import { createContext as createContext20, useMemo as useMemo19, useReducer } from "react";
|
|
21570
21571
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
21571
|
-
import { useCallback as
|
|
21572
|
+
import { useCallback as useCallback13 } from "react";
|
|
21572
21573
|
import React22, {
|
|
21573
21574
|
forwardRef as forwardRef5,
|
|
21574
21575
|
useContext as useContext28,
|
|
@@ -21582,7 +21583,7 @@ import { useContext as useContext21, useLayoutEffect as useLayoutEffect5, useRef
|
|
|
21582
21583
|
import React19, {
|
|
21583
21584
|
createContext as createContext21,
|
|
21584
21585
|
createRef as createRef2,
|
|
21585
|
-
useCallback as
|
|
21586
|
+
useCallback as useCallback9,
|
|
21586
21587
|
useContext as useContext20,
|
|
21587
21588
|
useEffect as useEffect7,
|
|
21588
21589
|
useMemo as useMemo21,
|
|
@@ -21595,16 +21596,16 @@ import { useRef as useRef13 } from "react";
|
|
|
21595
21596
|
import { useContext as useContext23, useEffect as useEffect8, useMemo as useMemo22, useState as useState11 } from "react";
|
|
21596
21597
|
import { useContext as useContext22 } from "react";
|
|
21597
21598
|
import {
|
|
21598
|
-
useCallback as
|
|
21599
|
+
useCallback as useCallback12,
|
|
21599
21600
|
useContext as useContext26,
|
|
21600
21601
|
useEffect as useEffect12,
|
|
21601
21602
|
useLayoutEffect as useLayoutEffect7,
|
|
21602
21603
|
useRef as useRef18
|
|
21603
21604
|
} from "react";
|
|
21604
|
-
import { useCallback as
|
|
21605
|
+
import { useCallback as useCallback11, useMemo as useMemo25, useRef as useRef16 } from "react";
|
|
21605
21606
|
import { useContext as useContext25, useMemo as useMemo24 } from "react";
|
|
21606
21607
|
import React20, {
|
|
21607
|
-
useCallback as
|
|
21608
|
+
useCallback as useCallback10,
|
|
21608
21609
|
useContext as useContext24,
|
|
21609
21610
|
useEffect as useEffect9,
|
|
21610
21611
|
useLayoutEffect as useLayoutEffect6,
|
|
@@ -21632,7 +21633,7 @@ import { jsx as jsx22 } from "react/jsx-runtime";
|
|
|
21632
21633
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
21633
21634
|
import {
|
|
21634
21635
|
forwardRef as forwardRef8,
|
|
21635
|
-
useCallback as
|
|
21636
|
+
useCallback as useCallback15,
|
|
21636
21637
|
useEffect as useEffect16,
|
|
21637
21638
|
useImperativeHandle as useImperativeHandle6,
|
|
21638
21639
|
useMemo as useMemo29,
|
|
@@ -21643,7 +21644,7 @@ import { jsx as jsx24 } from "react/jsx-runtime";
|
|
|
21643
21644
|
import {
|
|
21644
21645
|
createContext as createContext23,
|
|
21645
21646
|
forwardRef as forwardRef9,
|
|
21646
|
-
useCallback as
|
|
21647
|
+
useCallback as useCallback16,
|
|
21647
21648
|
useContext as useContext31,
|
|
21648
21649
|
useLayoutEffect as useLayoutEffect9,
|
|
21649
21650
|
useMemo as useMemo30,
|
|
@@ -21652,7 +21653,7 @@ import {
|
|
|
21652
21653
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
21653
21654
|
import {
|
|
21654
21655
|
forwardRef as forwardRef10,
|
|
21655
|
-
useCallback as
|
|
21656
|
+
useCallback as useCallback17,
|
|
21656
21657
|
useContext as useContext32,
|
|
21657
21658
|
useEffect as useEffect17,
|
|
21658
21659
|
useImperativeHandle as useImperativeHandle7,
|
|
@@ -21661,16 +21662,16 @@ import {
|
|
|
21661
21662
|
useState as useState16
|
|
21662
21663
|
} from "react";
|
|
21663
21664
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
21664
|
-
import { forwardRef as forwardRef11, useCallback as
|
|
21665
|
+
import { forwardRef as forwardRef11, useCallback as useCallback18, useState as useState17 } from "react";
|
|
21665
21666
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
21666
|
-
import { useCallback as
|
|
21667
|
+
import { useCallback as useCallback19, useContext as useContext33, useLayoutEffect as useLayoutEffect10, useRef as useRef24 } from "react";
|
|
21667
21668
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
21668
|
-
import React29, { forwardRef as forwardRef12, useCallback as
|
|
21669
|
+
import React29, { forwardRef as forwardRef12, useCallback as useCallback20, useRef as useRef25 } from "react";
|
|
21669
21670
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
21670
21671
|
import { createRef as createRef3 } from "react";
|
|
21671
21672
|
import React30 from "react";
|
|
21672
21673
|
import {
|
|
21673
|
-
useCallback as
|
|
21674
|
+
useCallback as useCallback21,
|
|
21674
21675
|
useImperativeHandle as useImperativeHandle8,
|
|
21675
21676
|
useMemo as useMemo32,
|
|
21676
21677
|
useRef as useRef26,
|
|
@@ -21685,9 +21686,9 @@ import { jsx as jsx32 } from "react/jsx-runtime";
|
|
|
21685
21686
|
import React33 from "react";
|
|
21686
21687
|
import React34, { createContext as createContext25 } from "react";
|
|
21687
21688
|
import React35, { useContext as useContext35 } from "react";
|
|
21688
|
-
import { useCallback as
|
|
21689
|
+
import { useCallback as useCallback24 } from "react";
|
|
21689
21690
|
import {
|
|
21690
|
-
useCallback as
|
|
21691
|
+
useCallback as useCallback22,
|
|
21691
21692
|
useContext as useContext36,
|
|
21692
21693
|
useEffect as useEffect18,
|
|
21693
21694
|
useLayoutEffect as useLayoutEffect11,
|
|
@@ -21697,7 +21698,7 @@ import {
|
|
|
21697
21698
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
21698
21699
|
import React37, {
|
|
21699
21700
|
forwardRef as forwardRef13,
|
|
21700
|
-
useCallback as
|
|
21701
|
+
useCallback as useCallback23,
|
|
21701
21702
|
useContext as useContext37,
|
|
21702
21703
|
useEffect as useEffect20,
|
|
21703
21704
|
useImperativeHandle as useImperativeHandle9,
|
|
@@ -21718,7 +21719,7 @@ import {
|
|
|
21718
21719
|
import React40 from "react";
|
|
21719
21720
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
21720
21721
|
import React42 from "react";
|
|
21721
|
-
import { forwardRef as forwardRef16, useCallback as
|
|
21722
|
+
import { forwardRef as forwardRef16, useCallback as useCallback25, useContext as useContext39 } from "react";
|
|
21722
21723
|
import {
|
|
21723
21724
|
forwardRef as forwardRef15,
|
|
21724
21725
|
useContext as useContext38,
|
|
@@ -22898,7 +22899,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
|
22898
22899
|
var addSequenceStackTraces = (component) => {
|
|
22899
22900
|
componentsToAddStacksTo.push(component);
|
|
22900
22901
|
};
|
|
22901
|
-
var VERSION = "4.0.
|
|
22902
|
+
var VERSION = "4.0.477";
|
|
22902
22903
|
var checkMultipleRemotionVersions = () => {
|
|
22903
22904
|
if (typeof globalThis === "undefined") {
|
|
22904
22905
|
return;
|
|
@@ -23332,6 +23333,18 @@ var hiddenField = {
|
|
|
23332
23333
|
default: false,
|
|
23333
23334
|
description: "Hidden"
|
|
23334
23335
|
};
|
|
23336
|
+
var showInTimelineField = {
|
|
23337
|
+
type: "hidden"
|
|
23338
|
+
};
|
|
23339
|
+
var sequenceNameField = {
|
|
23340
|
+
type: "hidden"
|
|
23341
|
+
};
|
|
23342
|
+
var extendSchemaWithSequenceName = (schema) => {
|
|
23343
|
+
return {
|
|
23344
|
+
name: sequenceNameField,
|
|
23345
|
+
...schema
|
|
23346
|
+
};
|
|
23347
|
+
};
|
|
23335
23348
|
var durationInFramesField = {
|
|
23336
23349
|
type: "number",
|
|
23337
23350
|
default: undefined,
|
|
@@ -23345,9 +23358,17 @@ var fromField = {
|
|
|
23345
23358
|
step: 1,
|
|
23346
23359
|
hiddenFromList: true
|
|
23347
23360
|
};
|
|
23348
|
-
var
|
|
23361
|
+
var freezeField = {
|
|
23362
|
+
type: "number",
|
|
23363
|
+
default: null,
|
|
23364
|
+
step: 1,
|
|
23365
|
+
hiddenFromList: true
|
|
23366
|
+
};
|
|
23367
|
+
var sequenceSchema = extendSchemaWithSequenceName({
|
|
23349
23368
|
hidden: hiddenField,
|
|
23369
|
+
showInTimeline: showInTimelineField,
|
|
23350
23370
|
from: fromField,
|
|
23371
|
+
freeze: freezeField,
|
|
23351
23372
|
durationInFrames: durationInFramesField,
|
|
23352
23373
|
layout: {
|
|
23353
23374
|
type: "enum",
|
|
@@ -23358,12 +23379,14 @@ var sequenceSchema = {
|
|
|
23358
23379
|
none: {}
|
|
23359
23380
|
}
|
|
23360
23381
|
}
|
|
23361
|
-
};
|
|
23362
|
-
var sequenceSchemaWithoutFrom = {
|
|
23382
|
+
});
|
|
23383
|
+
var sequenceSchemaWithoutFrom = extendSchemaWithSequenceName({
|
|
23363
23384
|
hidden: hiddenField,
|
|
23385
|
+
showInTimeline: showInTimelineField,
|
|
23386
|
+
freeze: freezeField,
|
|
23364
23387
|
durationInFrames: durationInFramesField,
|
|
23365
23388
|
layout: sequenceSchema.layout
|
|
23366
|
-
};
|
|
23389
|
+
});
|
|
23367
23390
|
var sequenceSchemaDefaultLayoutNone = {
|
|
23368
23391
|
...sequenceSchema,
|
|
23369
23392
|
layout: {
|
|
@@ -23707,81 +23730,6 @@ function bezier(mX1, mY1, mX2, mY2) {
|
|
|
23707
23730
|
return calcBezier(getTForX(clampedX), mY1, mY2);
|
|
23708
23731
|
};
|
|
23709
23732
|
}
|
|
23710
|
-
var clampUnit = (t) => Math.min(1, Math.max(0, t));
|
|
23711
|
-
|
|
23712
|
-
class Easing {
|
|
23713
|
-
static step0(n) {
|
|
23714
|
-
return n > 0 ? 1 : 0;
|
|
23715
|
-
}
|
|
23716
|
-
static step1(n) {
|
|
23717
|
-
return n >= 1 ? 1 : 0;
|
|
23718
|
-
}
|
|
23719
|
-
static linear(t) {
|
|
23720
|
-
return t;
|
|
23721
|
-
}
|
|
23722
|
-
static ease(t) {
|
|
23723
|
-
return Easing.bezier(0.42, 0, 1, 1)(t);
|
|
23724
|
-
}
|
|
23725
|
-
static quad(t) {
|
|
23726
|
-
return t * t;
|
|
23727
|
-
}
|
|
23728
|
-
static cubic(t) {
|
|
23729
|
-
return t * t * t;
|
|
23730
|
-
}
|
|
23731
|
-
static poly(n) {
|
|
23732
|
-
return (t) => t ** n;
|
|
23733
|
-
}
|
|
23734
|
-
static sin(t) {
|
|
23735
|
-
return 1 - Math.cos(t * Math.PI / 2);
|
|
23736
|
-
}
|
|
23737
|
-
static circle(t) {
|
|
23738
|
-
const u = clampUnit(t);
|
|
23739
|
-
return 1 - Math.sqrt(1 - u * u);
|
|
23740
|
-
}
|
|
23741
|
-
static exp(t) {
|
|
23742
|
-
return 2 ** (10 * (t - 1));
|
|
23743
|
-
}
|
|
23744
|
-
static elastic(bounciness = 1) {
|
|
23745
|
-
const p = bounciness * Math.PI;
|
|
23746
|
-
return (t) => 1 - Math.cos(t * Math.PI / 2) ** 3 * Math.cos(t * p);
|
|
23747
|
-
}
|
|
23748
|
-
static back(s = 1.70158) {
|
|
23749
|
-
return (t) => t * t * ((s + 1) * t - s);
|
|
23750
|
-
}
|
|
23751
|
-
static bounce(t) {
|
|
23752
|
-
const u = clampUnit(t);
|
|
23753
|
-
if (u < 1 / 2.75) {
|
|
23754
|
-
return 7.5625 * u * u;
|
|
23755
|
-
}
|
|
23756
|
-
if (u < 2 / 2.75) {
|
|
23757
|
-
const t2_ = u - 1.5 / 2.75;
|
|
23758
|
-
return 7.5625 * t2_ * t2_ + 0.75;
|
|
23759
|
-
}
|
|
23760
|
-
if (u < 2.5 / 2.75) {
|
|
23761
|
-
const t2_ = u - 2.25 / 2.75;
|
|
23762
|
-
return 7.5625 * t2_ * t2_ + 0.9375;
|
|
23763
|
-
}
|
|
23764
|
-
const t2 = u - 2.625 / 2.75;
|
|
23765
|
-
return 7.5625 * t2 * t2 + 0.984375;
|
|
23766
|
-
}
|
|
23767
|
-
static bezier(x1, y1, x2, y2) {
|
|
23768
|
-
return bezier(x1, y1, x2, y2);
|
|
23769
|
-
}
|
|
23770
|
-
static in(easing) {
|
|
23771
|
-
return easing;
|
|
23772
|
-
}
|
|
23773
|
-
static out(easing) {
|
|
23774
|
-
return (t) => 1 - easing(1 - t);
|
|
23775
|
-
}
|
|
23776
|
-
static inOut(easing) {
|
|
23777
|
-
return (t) => {
|
|
23778
|
-
if (t < 0.5) {
|
|
23779
|
-
return easing(t * 2) / 2;
|
|
23780
|
-
}
|
|
23781
|
-
return 1 - easing((1 - t) * 2) / 2;
|
|
23782
|
-
};
|
|
23783
|
-
}
|
|
23784
|
-
}
|
|
23785
23733
|
var normalizeNumber = (value) => {
|
|
23786
23734
|
return Math.round(value * 1e6) / 1e6;
|
|
23787
23735
|
};
|
|
@@ -24284,128 +24232,478 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
24284
24232
|
checkInfiniteRange("outputRange", outputRange);
|
|
24285
24233
|
return interpolateNumber({ input, inputRange, outputRange, options });
|
|
24286
24234
|
}
|
|
24287
|
-
var
|
|
24288
|
-
|
|
24289
|
-
|
|
24290
|
-
|
|
24291
|
-
}
|
|
24292
|
-
|
|
24293
|
-
|
|
24294
|
-
return new RegExp(name + "\\(\\s*(" + MODERN_VALUE + ")\\s+(" + MODERN_VALUE + ")\\s+(" + MODERN_VALUE + ")(?:\\s*\\/\\s*(" + MODERN_VALUE + "))?\\s*\\)");
|
|
24295
|
-
}
|
|
24296
|
-
function getMatchers() {
|
|
24297
|
-
const cachedMatchers = {
|
|
24298
|
-
rgb: undefined,
|
|
24299
|
-
rgba: undefined,
|
|
24300
|
-
hsl: undefined,
|
|
24301
|
-
hsla: undefined,
|
|
24302
|
-
hex3: undefined,
|
|
24303
|
-
hex4: undefined,
|
|
24304
|
-
hex5: undefined,
|
|
24305
|
-
hex6: undefined,
|
|
24306
|
-
hex8: undefined,
|
|
24307
|
-
oklch: undefined,
|
|
24308
|
-
oklab: undefined,
|
|
24309
|
-
lab: undefined,
|
|
24310
|
-
lch: undefined,
|
|
24311
|
-
hwb: undefined
|
|
24312
|
-
};
|
|
24313
|
-
if (cachedMatchers.rgb === undefined) {
|
|
24314
|
-
cachedMatchers.rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
|
|
24315
|
-
cachedMatchers.rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER));
|
|
24316
|
-
cachedMatchers.hsl = new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE));
|
|
24317
|
-
cachedMatchers.hsla = new RegExp("hsla" + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
|
|
24318
|
-
cachedMatchers.hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
24319
|
-
cachedMatchers.hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
24320
|
-
cachedMatchers.hex6 = /^#([0-9a-fA-F]{6})$/;
|
|
24321
|
-
cachedMatchers.hex8 = /^#([0-9a-fA-F]{8})$/;
|
|
24322
|
-
cachedMatchers.oklch = modernColorCall("oklch");
|
|
24323
|
-
cachedMatchers.oklab = modernColorCall("oklab");
|
|
24324
|
-
cachedMatchers.lab = modernColorCall("lab");
|
|
24325
|
-
cachedMatchers.lch = modernColorCall("lch");
|
|
24326
|
-
cachedMatchers.hwb = modernColorCall("hwb");
|
|
24327
|
-
}
|
|
24328
|
-
return cachedMatchers;
|
|
24329
|
-
}
|
|
24330
|
-
function hue2rgb(p, q, t) {
|
|
24331
|
-
if (t < 0) {
|
|
24332
|
-
t += 1;
|
|
24333
|
-
}
|
|
24334
|
-
if (t > 1) {
|
|
24335
|
-
t -= 1;
|
|
24235
|
+
var validateFrame = ({
|
|
24236
|
+
allowFloats,
|
|
24237
|
+
durationInFrames,
|
|
24238
|
+
frame
|
|
24239
|
+
}) => {
|
|
24240
|
+
if (typeof frame === "undefined") {
|
|
24241
|
+
throw new TypeError(`Argument missing for parameter "frame"`);
|
|
24336
24242
|
}
|
|
24337
|
-
if (
|
|
24338
|
-
|
|
24243
|
+
if (typeof frame !== "number") {
|
|
24244
|
+
throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
|
|
24339
24245
|
}
|
|
24340
|
-
if (
|
|
24341
|
-
|
|
24246
|
+
if (!Number.isFinite(frame)) {
|
|
24247
|
+
throw new RangeError(`Frame ${frame} is not finite`);
|
|
24342
24248
|
}
|
|
24343
|
-
if (
|
|
24344
|
-
|
|
24249
|
+
if (frame % 1 !== 0 && !allowFloats) {
|
|
24250
|
+
throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
|
|
24345
24251
|
}
|
|
24346
|
-
|
|
24347
|
-
}
|
|
24348
|
-
function hslToRgb(h, s, l) {
|
|
24349
|
-
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
24350
|
-
const p = 2 * l - q;
|
|
24351
|
-
const r2 = hue2rgb(p, q, h + 1 / 3);
|
|
24352
|
-
const g = hue2rgb(p, q, h);
|
|
24353
|
-
const b2 = hue2rgb(p, q, h - 1 / 3);
|
|
24354
|
-
return Math.round(r2 * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b2 * 255) << 8;
|
|
24355
|
-
}
|
|
24356
|
-
function parse255(str) {
|
|
24357
|
-
const int = Number.parseInt(str, 10);
|
|
24358
|
-
if (int < 0) {
|
|
24359
|
-
return 0;
|
|
24252
|
+
if (frame < 0 && frame < -durationInFrames) {
|
|
24253
|
+
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the lowest frame that can be rendered is ${-durationInFrames}`);
|
|
24360
24254
|
}
|
|
24361
|
-
if (
|
|
24362
|
-
|
|
24255
|
+
if (frame > durationInFrames - 1) {
|
|
24256
|
+
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
24363
24257
|
}
|
|
24364
|
-
|
|
24365
|
-
|
|
24366
|
-
|
|
24367
|
-
|
|
24368
|
-
return (int % 360 + 360) % 360 / 360;
|
|
24369
|
-
}
|
|
24370
|
-
function parse1(str) {
|
|
24371
|
-
const num = Number.parseFloat(str);
|
|
24372
|
-
if (num < 0) {
|
|
24373
|
-
return 0;
|
|
24258
|
+
};
|
|
24259
|
+
var validateSpringDuration = (dur) => {
|
|
24260
|
+
if (typeof dur === "undefined") {
|
|
24261
|
+
return;
|
|
24374
24262
|
}
|
|
24375
|
-
if (
|
|
24376
|
-
|
|
24263
|
+
if (typeof dur !== "number") {
|
|
24264
|
+
throw new TypeError(`A "duration" of a spring must be a "number" but is "${typeof dur}"`);
|
|
24377
24265
|
}
|
|
24378
|
-
|
|
24379
|
-
|
|
24380
|
-
function parsePercentage(str) {
|
|
24381
|
-
const int = Number.parseFloat(str);
|
|
24382
|
-
if (int < 0) {
|
|
24383
|
-
return 0;
|
|
24266
|
+
if (Number.isNaN(dur)) {
|
|
24267
|
+
throw new TypeError('A "duration" of a spring is NaN, which it must not be');
|
|
24384
24268
|
}
|
|
24385
|
-
if (
|
|
24386
|
-
|
|
24269
|
+
if (!Number.isFinite(dur)) {
|
|
24270
|
+
throw new TypeError('A "duration" of a spring must be finite, but is ' + dur);
|
|
24387
24271
|
}
|
|
24388
|
-
|
|
24389
|
-
|
|
24390
|
-
function parseModernComponent(str, percentScale) {
|
|
24391
|
-
if (str === "none")
|
|
24392
|
-
return 0;
|
|
24393
|
-
if (str.endsWith("%")) {
|
|
24394
|
-
return Number.parseFloat(str) / 100 * percentScale;
|
|
24272
|
+
if (dur <= 0) {
|
|
24273
|
+
throw new TypeError('A "duration" of a spring must be positive, but is ' + dur);
|
|
24395
24274
|
}
|
|
24396
|
-
|
|
24397
|
-
|
|
24398
|
-
|
|
24399
|
-
|
|
24400
|
-
|
|
24401
|
-
|
|
24402
|
-
|
|
24275
|
+
};
|
|
24276
|
+
var defaultSpringConfig = {
|
|
24277
|
+
damping: 10,
|
|
24278
|
+
mass: 1,
|
|
24279
|
+
stiffness: 100,
|
|
24280
|
+
overshootClamping: false
|
|
24281
|
+
};
|
|
24282
|
+
var advanceCache = {};
|
|
24283
|
+
function advance({
|
|
24284
|
+
animation,
|
|
24285
|
+
now,
|
|
24286
|
+
config
|
|
24287
|
+
}) {
|
|
24288
|
+
const { toValue: toValue2, lastTimestamp, current, velocity } = animation;
|
|
24289
|
+
const deltaTime = Math.min(now - lastTimestamp, 64);
|
|
24290
|
+
if (config.damping <= 0) {
|
|
24291
|
+
throw new Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");
|
|
24403
24292
|
}
|
|
24404
|
-
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
|
|
24293
|
+
const c2 = config.damping;
|
|
24294
|
+
const m = config.mass;
|
|
24295
|
+
const k = config.stiffness;
|
|
24296
|
+
const cacheKey = [
|
|
24297
|
+
toValue2,
|
|
24298
|
+
lastTimestamp,
|
|
24299
|
+
current,
|
|
24300
|
+
velocity,
|
|
24301
|
+
c2,
|
|
24302
|
+
m,
|
|
24303
|
+
k,
|
|
24304
|
+
now
|
|
24305
|
+
].join("-");
|
|
24306
|
+
if (advanceCache[cacheKey]) {
|
|
24307
|
+
return advanceCache[cacheKey];
|
|
24308
|
+
}
|
|
24309
|
+
const v0 = -velocity;
|
|
24310
|
+
const x0 = toValue2 - current;
|
|
24311
|
+
const zeta = c2 / (2 * Math.sqrt(k * m));
|
|
24312
|
+
const omega0 = Math.sqrt(k / m);
|
|
24313
|
+
const omega1 = omega0 * Math.sqrt(1 - zeta ** 2);
|
|
24314
|
+
const t = deltaTime / 1000;
|
|
24315
|
+
const sin1 = Math.sin(omega1 * t);
|
|
24316
|
+
const cos1 = Math.cos(omega1 * t);
|
|
24317
|
+
const underDampedEnvelope = Math.exp(-zeta * omega0 * t);
|
|
24318
|
+
const underDampedFrag1 = underDampedEnvelope * (sin1 * ((v0 + zeta * omega0 * x0) / omega1) + x0 * cos1);
|
|
24319
|
+
const underDampedPosition = toValue2 - underDampedFrag1;
|
|
24320
|
+
const underDampedVelocity = zeta * omega0 * underDampedFrag1 - underDampedEnvelope * (cos1 * (v0 + zeta * omega0 * x0) - omega1 * x0 * sin1);
|
|
24321
|
+
const criticallyDampedEnvelope = Math.exp(-omega0 * t);
|
|
24322
|
+
const criticallyDampedPosition = toValue2 - criticallyDampedEnvelope * (x0 + (v0 + omega0 * x0) * t);
|
|
24323
|
+
const criticallyDampedVelocity = criticallyDampedEnvelope * (v0 * (t * omega0 - 1) + t * x0 * omega0 * omega0);
|
|
24324
|
+
const animationNode = {
|
|
24325
|
+
toValue: toValue2,
|
|
24326
|
+
prevPosition: current,
|
|
24327
|
+
lastTimestamp: now,
|
|
24328
|
+
current: zeta < 1 ? underDampedPosition : criticallyDampedPosition,
|
|
24329
|
+
velocity: zeta < 1 ? underDampedVelocity : criticallyDampedVelocity
|
|
24330
|
+
};
|
|
24331
|
+
advanceCache[cacheKey] = animationNode;
|
|
24332
|
+
return animationNode;
|
|
24333
|
+
}
|
|
24334
|
+
var calculationCache = {};
|
|
24335
|
+
function springCalculation({
|
|
24336
|
+
frame,
|
|
24337
|
+
fps,
|
|
24338
|
+
config = {}
|
|
24339
|
+
}) {
|
|
24340
|
+
const from = 0;
|
|
24341
|
+
const to = 1;
|
|
24342
|
+
const cacheKey = [
|
|
24343
|
+
frame,
|
|
24344
|
+
fps,
|
|
24345
|
+
config.damping,
|
|
24346
|
+
config.mass,
|
|
24347
|
+
config.overshootClamping,
|
|
24348
|
+
config.stiffness
|
|
24349
|
+
].join("-");
|
|
24350
|
+
if (calculationCache[cacheKey]) {
|
|
24351
|
+
return calculationCache[cacheKey];
|
|
24352
|
+
}
|
|
24353
|
+
let animation = {
|
|
24354
|
+
lastTimestamp: 0,
|
|
24355
|
+
current: from,
|
|
24356
|
+
toValue: to,
|
|
24357
|
+
velocity: 0,
|
|
24358
|
+
prevPosition: 0
|
|
24359
|
+
};
|
|
24360
|
+
const frameClamped = Math.max(0, frame);
|
|
24361
|
+
const unevenRest = frameClamped % 1;
|
|
24362
|
+
for (let f = 0;f <= Math.floor(frameClamped); f++) {
|
|
24363
|
+
if (f === Math.floor(frameClamped)) {
|
|
24364
|
+
f += unevenRest;
|
|
24365
|
+
}
|
|
24366
|
+
const time = f / fps * 1000;
|
|
24367
|
+
animation = advance({
|
|
24368
|
+
animation,
|
|
24369
|
+
now: time,
|
|
24370
|
+
config: {
|
|
24371
|
+
...defaultSpringConfig,
|
|
24372
|
+
...config
|
|
24373
|
+
}
|
|
24374
|
+
});
|
|
24375
|
+
}
|
|
24376
|
+
calculationCache[cacheKey] = animation;
|
|
24377
|
+
return animation;
|
|
24378
|
+
}
|
|
24379
|
+
var cache = new Map;
|
|
24380
|
+
function measureSpring({
|
|
24381
|
+
fps,
|
|
24382
|
+
config = {},
|
|
24383
|
+
threshold = 0.005
|
|
24384
|
+
}) {
|
|
24385
|
+
if (typeof threshold !== "number") {
|
|
24386
|
+
throw new TypeError(`threshold must be a number, got ${threshold} of type ${typeof threshold}`);
|
|
24387
|
+
}
|
|
24388
|
+
if (threshold === 0) {
|
|
24389
|
+
return Infinity;
|
|
24390
|
+
}
|
|
24391
|
+
if (threshold === 1) {
|
|
24392
|
+
return 0;
|
|
24393
|
+
}
|
|
24394
|
+
if (isNaN(threshold)) {
|
|
24395
|
+
throw new TypeError("Threshold is NaN");
|
|
24396
|
+
}
|
|
24397
|
+
if (!Number.isFinite(threshold)) {
|
|
24398
|
+
throw new TypeError("Threshold is not finite");
|
|
24399
|
+
}
|
|
24400
|
+
if (threshold < 0) {
|
|
24401
|
+
throw new TypeError("Threshold is below 0");
|
|
24402
|
+
}
|
|
24403
|
+
const cacheKey = [
|
|
24404
|
+
fps,
|
|
24405
|
+
config.damping,
|
|
24406
|
+
config.mass,
|
|
24407
|
+
config.overshootClamping,
|
|
24408
|
+
config.stiffness,
|
|
24409
|
+
threshold
|
|
24410
|
+
].join("-");
|
|
24411
|
+
if (cache.has(cacheKey)) {
|
|
24412
|
+
return cache.get(cacheKey);
|
|
24413
|
+
}
|
|
24414
|
+
validateFps(fps, "to the measureSpring() function", false);
|
|
24415
|
+
let frame = 0;
|
|
24416
|
+
let finishedFrame = 0;
|
|
24417
|
+
const calc = () => {
|
|
24418
|
+
return springCalculation({
|
|
24419
|
+
fps,
|
|
24420
|
+
frame,
|
|
24421
|
+
config
|
|
24422
|
+
});
|
|
24423
|
+
};
|
|
24424
|
+
let animation = calc();
|
|
24425
|
+
const calcDifference = () => {
|
|
24426
|
+
return Math.abs(animation.current - animation.toValue);
|
|
24427
|
+
};
|
|
24428
|
+
let difference = calcDifference();
|
|
24429
|
+
while (difference >= threshold) {
|
|
24430
|
+
frame++;
|
|
24431
|
+
animation = calc();
|
|
24432
|
+
difference = calcDifference();
|
|
24433
|
+
}
|
|
24434
|
+
finishedFrame = frame;
|
|
24435
|
+
for (let i = 0;i < 20; i++) {
|
|
24436
|
+
frame++;
|
|
24437
|
+
animation = calc();
|
|
24438
|
+
difference = calcDifference();
|
|
24439
|
+
if (difference >= threshold) {
|
|
24440
|
+
i = 0;
|
|
24441
|
+
finishedFrame = frame + 1;
|
|
24442
|
+
}
|
|
24443
|
+
}
|
|
24444
|
+
cache.set(cacheKey, finishedFrame);
|
|
24445
|
+
return finishedFrame;
|
|
24446
|
+
}
|
|
24447
|
+
function spring({
|
|
24448
|
+
frame: passedFrame,
|
|
24449
|
+
fps,
|
|
24450
|
+
config = {},
|
|
24451
|
+
from = 0,
|
|
24452
|
+
to = 1,
|
|
24453
|
+
durationInFrames: passedDurationInFrames,
|
|
24454
|
+
durationRestThreshold,
|
|
24455
|
+
delay = 0,
|
|
24456
|
+
reverse = false
|
|
24457
|
+
}) {
|
|
24458
|
+
validateSpringDuration(passedDurationInFrames);
|
|
24459
|
+
validateFrame({
|
|
24460
|
+
frame: passedFrame,
|
|
24461
|
+
durationInFrames: Infinity,
|
|
24462
|
+
allowFloats: true
|
|
24463
|
+
});
|
|
24464
|
+
validateFps(fps, "to spring()", false);
|
|
24465
|
+
const needsToCalculateNaturalDuration = reverse || typeof passedDurationInFrames !== "undefined";
|
|
24466
|
+
const naturalDuration = needsToCalculateNaturalDuration ? measureSpring({
|
|
24467
|
+
fps,
|
|
24468
|
+
config,
|
|
24469
|
+
threshold: durationRestThreshold
|
|
24470
|
+
}) : undefined;
|
|
24471
|
+
const naturalDurationGetter = needsToCalculateNaturalDuration ? {
|
|
24472
|
+
get: () => naturalDuration
|
|
24473
|
+
} : {
|
|
24474
|
+
get: () => {
|
|
24475
|
+
throw new Error("did not calculate natural duration, this is an error with Remotion. Please report");
|
|
24476
|
+
}
|
|
24477
|
+
};
|
|
24478
|
+
const reverseProcessed = reverse ? (passedDurationInFrames ?? naturalDurationGetter.get()) - passedFrame : passedFrame;
|
|
24479
|
+
const delayProcessed = reverseProcessed + (reverse ? delay : -delay);
|
|
24480
|
+
const durationProcessed = passedDurationInFrames === undefined ? delayProcessed : delayProcessed / (passedDurationInFrames / naturalDurationGetter.get());
|
|
24481
|
+
if (passedDurationInFrames && delayProcessed > passedDurationInFrames) {
|
|
24482
|
+
return to;
|
|
24483
|
+
}
|
|
24484
|
+
const spr = springCalculation({
|
|
24485
|
+
fps,
|
|
24486
|
+
frame: durationProcessed,
|
|
24487
|
+
config
|
|
24488
|
+
});
|
|
24489
|
+
const inner = config.overshootClamping ? to >= from ? Math.min(spr.current, to) : Math.max(spr.current, to) : spr.current;
|
|
24490
|
+
const interpolated = from === 0 && to === 1 ? inner : interpolate(inner, [0, 1], [from, to]);
|
|
24491
|
+
return interpolated;
|
|
24492
|
+
}
|
|
24493
|
+
var clampUnit = (t) => Math.min(1, Math.max(0, t));
|
|
24494
|
+
var springEasingDurationInFrames = 30;
|
|
24495
|
+
|
|
24496
|
+
class Easing {
|
|
24497
|
+
static step0(n) {
|
|
24498
|
+
return n > 0 ? 1 : 0;
|
|
24499
|
+
}
|
|
24500
|
+
static step1(n) {
|
|
24501
|
+
return n >= 1 ? 1 : 0;
|
|
24502
|
+
}
|
|
24503
|
+
static linear(t) {
|
|
24504
|
+
return t;
|
|
24505
|
+
}
|
|
24506
|
+
static ease(t) {
|
|
24507
|
+
return Easing.bezier(0.42, 0, 1, 1)(t);
|
|
24508
|
+
}
|
|
24509
|
+
static quad(t) {
|
|
24510
|
+
return t * t;
|
|
24511
|
+
}
|
|
24512
|
+
static cubic(t) {
|
|
24513
|
+
return t * t * t;
|
|
24514
|
+
}
|
|
24515
|
+
static poly(n) {
|
|
24516
|
+
return (t) => t ** n;
|
|
24517
|
+
}
|
|
24518
|
+
static sin(t) {
|
|
24519
|
+
return 1 - Math.cos(t * Math.PI / 2);
|
|
24520
|
+
}
|
|
24521
|
+
static circle(t) {
|
|
24522
|
+
const u = clampUnit(t);
|
|
24523
|
+
return 1 - Math.sqrt(1 - u * u);
|
|
24524
|
+
}
|
|
24525
|
+
static exp(t) {
|
|
24526
|
+
return 2 ** (10 * (t - 1));
|
|
24527
|
+
}
|
|
24528
|
+
static elastic(bounciness = 1) {
|
|
24529
|
+
const p = bounciness * Math.PI;
|
|
24530
|
+
return (t) => 1 - Math.cos(t * Math.PI / 2) ** 3 * Math.cos(t * p);
|
|
24531
|
+
}
|
|
24532
|
+
static back(s = 1.70158) {
|
|
24533
|
+
return (t) => t * t * ((s + 1) * t - s);
|
|
24534
|
+
}
|
|
24535
|
+
static spring(config = {}) {
|
|
24536
|
+
return (t) => {
|
|
24537
|
+
if (t <= 0) {
|
|
24538
|
+
return 0;
|
|
24539
|
+
}
|
|
24540
|
+
if (t >= 1) {
|
|
24541
|
+
return 1;
|
|
24542
|
+
}
|
|
24543
|
+
return spring({
|
|
24544
|
+
fps: springEasingDurationInFrames,
|
|
24545
|
+
frame: t * springEasingDurationInFrames,
|
|
24546
|
+
config,
|
|
24547
|
+
durationInFrames: springEasingDurationInFrames
|
|
24548
|
+
});
|
|
24549
|
+
};
|
|
24550
|
+
}
|
|
24551
|
+
static bounce(t) {
|
|
24552
|
+
const u = clampUnit(t);
|
|
24553
|
+
if (u < 1 / 2.75) {
|
|
24554
|
+
return 7.5625 * u * u;
|
|
24555
|
+
}
|
|
24556
|
+
if (u < 2 / 2.75) {
|
|
24557
|
+
const t2_ = u - 1.5 / 2.75;
|
|
24558
|
+
return 7.5625 * t2_ * t2_ + 0.75;
|
|
24559
|
+
}
|
|
24560
|
+
if (u < 2.5 / 2.75) {
|
|
24561
|
+
const t2_ = u - 2.25 / 2.75;
|
|
24562
|
+
return 7.5625 * t2_ * t2_ + 0.9375;
|
|
24563
|
+
}
|
|
24564
|
+
const t2 = u - 2.625 / 2.75;
|
|
24565
|
+
return 7.5625 * t2 * t2 + 0.984375;
|
|
24566
|
+
}
|
|
24567
|
+
static bezier(x1, y1, x2, y2) {
|
|
24568
|
+
return bezier(x1, y1, x2, y2);
|
|
24569
|
+
}
|
|
24570
|
+
static in(easing) {
|
|
24571
|
+
return easing;
|
|
24572
|
+
}
|
|
24573
|
+
static out(easing) {
|
|
24574
|
+
return (t) => 1 - easing(1 - t);
|
|
24575
|
+
}
|
|
24576
|
+
static inOut(easing) {
|
|
24577
|
+
return (t) => {
|
|
24578
|
+
if (t < 0.5) {
|
|
24579
|
+
return easing(t * 2) / 2;
|
|
24580
|
+
}
|
|
24581
|
+
return 1 - easing((1 - t) * 2) / 2;
|
|
24582
|
+
};
|
|
24583
|
+
}
|
|
24584
|
+
}
|
|
24585
|
+
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
24586
|
+
var PERCENTAGE = NUMBER + "%";
|
|
24587
|
+
function call(...args) {
|
|
24588
|
+
return "\\(\\s*(" + args.join(")\\s*,\\s*(") + ")\\s*\\)";
|
|
24589
|
+
}
|
|
24590
|
+
var MODERN_VALUE = "(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)";
|
|
24591
|
+
function modernColorCall(name) {
|
|
24592
|
+
return new RegExp(name + "\\(\\s*(" + MODERN_VALUE + ")\\s+(" + MODERN_VALUE + ")\\s+(" + MODERN_VALUE + ")(?:\\s*\\/\\s*(" + MODERN_VALUE + "))?\\s*\\)");
|
|
24593
|
+
}
|
|
24594
|
+
function getMatchers() {
|
|
24595
|
+
const cachedMatchers = {
|
|
24596
|
+
rgb: undefined,
|
|
24597
|
+
rgba: undefined,
|
|
24598
|
+
hsl: undefined,
|
|
24599
|
+
hsla: undefined,
|
|
24600
|
+
hex3: undefined,
|
|
24601
|
+
hex4: undefined,
|
|
24602
|
+
hex5: undefined,
|
|
24603
|
+
hex6: undefined,
|
|
24604
|
+
hex8: undefined,
|
|
24605
|
+
oklch: undefined,
|
|
24606
|
+
oklab: undefined,
|
|
24607
|
+
lab: undefined,
|
|
24608
|
+
lch: undefined,
|
|
24609
|
+
hwb: undefined
|
|
24610
|
+
};
|
|
24611
|
+
if (cachedMatchers.rgb === undefined) {
|
|
24612
|
+
cachedMatchers.rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
|
|
24613
|
+
cachedMatchers.rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER));
|
|
24614
|
+
cachedMatchers.hsl = new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE));
|
|
24615
|
+
cachedMatchers.hsla = new RegExp("hsla" + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
|
|
24616
|
+
cachedMatchers.hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
24617
|
+
cachedMatchers.hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
24618
|
+
cachedMatchers.hex6 = /^#([0-9a-fA-F]{6})$/;
|
|
24619
|
+
cachedMatchers.hex8 = /^#([0-9a-fA-F]{8})$/;
|
|
24620
|
+
cachedMatchers.oklch = modernColorCall("oklch");
|
|
24621
|
+
cachedMatchers.oklab = modernColorCall("oklab");
|
|
24622
|
+
cachedMatchers.lab = modernColorCall("lab");
|
|
24623
|
+
cachedMatchers.lch = modernColorCall("lch");
|
|
24624
|
+
cachedMatchers.hwb = modernColorCall("hwb");
|
|
24625
|
+
}
|
|
24626
|
+
return cachedMatchers;
|
|
24627
|
+
}
|
|
24628
|
+
function hue2rgb(p, q, t) {
|
|
24629
|
+
if (t < 0) {
|
|
24630
|
+
t += 1;
|
|
24631
|
+
}
|
|
24632
|
+
if (t > 1) {
|
|
24633
|
+
t -= 1;
|
|
24634
|
+
}
|
|
24635
|
+
if (t < 1 / 6) {
|
|
24636
|
+
return p + (q - p) * 6 * t;
|
|
24637
|
+
}
|
|
24638
|
+
if (t < 1 / 2) {
|
|
24639
|
+
return q;
|
|
24640
|
+
}
|
|
24641
|
+
if (t < 2 / 3) {
|
|
24642
|
+
return p + (q - p) * (2 / 3 - t) * 6;
|
|
24643
|
+
}
|
|
24644
|
+
return p;
|
|
24645
|
+
}
|
|
24646
|
+
function hslToRgb(h, s, l) {
|
|
24647
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
24648
|
+
const p = 2 * l - q;
|
|
24649
|
+
const r2 = hue2rgb(p, q, h + 1 / 3);
|
|
24650
|
+
const g = hue2rgb(p, q, h);
|
|
24651
|
+
const b2 = hue2rgb(p, q, h - 1 / 3);
|
|
24652
|
+
return Math.round(r2 * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b2 * 255) << 8;
|
|
24653
|
+
}
|
|
24654
|
+
function parse255(str) {
|
|
24655
|
+
const int = Number.parseInt(str, 10);
|
|
24656
|
+
if (int < 0) {
|
|
24657
|
+
return 0;
|
|
24658
|
+
}
|
|
24659
|
+
if (int > 255) {
|
|
24660
|
+
return 255;
|
|
24661
|
+
}
|
|
24662
|
+
return int;
|
|
24663
|
+
}
|
|
24664
|
+
function parse360(str) {
|
|
24665
|
+
const int = Number.parseFloat(str);
|
|
24666
|
+
return (int % 360 + 360) % 360 / 360;
|
|
24667
|
+
}
|
|
24668
|
+
function parse1(str) {
|
|
24669
|
+
const num = Number.parseFloat(str);
|
|
24670
|
+
if (num < 0) {
|
|
24671
|
+
return 0;
|
|
24672
|
+
}
|
|
24673
|
+
if (num > 1) {
|
|
24674
|
+
return 255;
|
|
24675
|
+
}
|
|
24676
|
+
return Math.round(num * 255);
|
|
24677
|
+
}
|
|
24678
|
+
function parsePercentage(str) {
|
|
24679
|
+
const int = Number.parseFloat(str);
|
|
24680
|
+
if (int < 0) {
|
|
24681
|
+
return 0;
|
|
24682
|
+
}
|
|
24683
|
+
if (int > 100) {
|
|
24684
|
+
return 1;
|
|
24685
|
+
}
|
|
24686
|
+
return int / 100;
|
|
24687
|
+
}
|
|
24688
|
+
function parseModernComponent(str, percentScale) {
|
|
24689
|
+
if (str === "none")
|
|
24690
|
+
return 0;
|
|
24691
|
+
if (str.endsWith("%")) {
|
|
24692
|
+
return Number.parseFloat(str) / 100 * percentScale;
|
|
24693
|
+
}
|
|
24694
|
+
return Number.parseFloat(str);
|
|
24695
|
+
}
|
|
24696
|
+
function parseHueAngle(str) {
|
|
24697
|
+
if (str === "none")
|
|
24698
|
+
return 0;
|
|
24699
|
+
if (str.endsWith("rad")) {
|
|
24700
|
+
return Number.parseFloat(str) * 180 / Math.PI;
|
|
24701
|
+
}
|
|
24702
|
+
if (str.endsWith("grad"))
|
|
24703
|
+
return Number.parseFloat(str) * 0.9;
|
|
24704
|
+
if (str.endsWith("turn"))
|
|
24705
|
+
return Number.parseFloat(str) * 360;
|
|
24706
|
+
return Number.parseFloat(str);
|
|
24409
24707
|
}
|
|
24410
24708
|
function parseModernAlpha(str) {
|
|
24411
24709
|
if (str === undefined || str === "none")
|
|
@@ -25277,10 +25575,12 @@ var mergeValues = ({
|
|
|
25277
25575
|
var stackToOverrideMap = {};
|
|
25278
25576
|
var wrapInSchema = ({
|
|
25279
25577
|
Component,
|
|
25578
|
+
componentIdentity,
|
|
25280
25579
|
schema,
|
|
25281
25580
|
supportsEffects
|
|
25282
25581
|
}) => {
|
|
25283
|
-
const
|
|
25582
|
+
const schemaWithSequenceName = extendSchemaWithSequenceName(schema);
|
|
25583
|
+
const flatSchema = getFlatSchemaWithAllKeys(schemaWithSequenceName);
|
|
25284
25584
|
const flatKeys = Object.keys(flatSchema);
|
|
25285
25585
|
const Wrapped = forwardRef2((props, ref) => {
|
|
25286
25586
|
const env = useRemotionEnvironment();
|
|
@@ -25319,15 +25619,16 @@ var wrapInSchema = ({
|
|
|
25319
25619
|
const currentRuntimeValueDotNotation = useMemo13(() => readValuesFromProps(props, flatKeys), runtimeValues);
|
|
25320
25620
|
const controls = useMemo13(() => {
|
|
25321
25621
|
return {
|
|
25322
|
-
schema,
|
|
25622
|
+
schema: schemaWithSequenceName,
|
|
25323
25623
|
currentRuntimeValueDotNotation,
|
|
25324
25624
|
overrideId,
|
|
25325
|
-
supportsEffects
|
|
25625
|
+
supportsEffects,
|
|
25626
|
+
componentIdentity
|
|
25326
25627
|
};
|
|
25327
25628
|
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
25328
25629
|
const { merged: valuesDotNotation, propsToDelete } = useMemo13(() => {
|
|
25329
25630
|
return computeEffectiveSchemaValuesDotNotation({
|
|
25330
|
-
schema,
|
|
25631
|
+
schema: schemaWithSequenceName,
|
|
25331
25632
|
currentValue: currentRuntimeValueDotNotation,
|
|
25332
25633
|
overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
|
|
25333
25634
|
propStatus: nodePath === null ? undefined : getPropStatusesCtx(propStatuses, nodePath),
|
|
@@ -25340,7 +25641,7 @@ var wrapInSchema = ({
|
|
|
25340
25641
|
propStatuses,
|
|
25341
25642
|
frame
|
|
25342
25643
|
]);
|
|
25343
|
-
const activeKeys = selectActiveKeys(
|
|
25644
|
+
const activeKeys = selectActiveKeys(schemaWithSequenceName, valuesDotNotation);
|
|
25344
25645
|
const mergedProps = mergeValues({
|
|
25345
25646
|
props,
|
|
25346
25647
|
valuesDotNotation,
|
|
@@ -25359,6 +25660,7 @@ var wrapInSchema = ({
|
|
|
25359
25660
|
var EMPTY_EFFECTS = [];
|
|
25360
25661
|
var RegularSequenceRefForwardingFunction = ({
|
|
25361
25662
|
from = 0,
|
|
25663
|
+
freeze,
|
|
25362
25664
|
durationInFrames = Infinity,
|
|
25363
25665
|
children,
|
|
25364
25666
|
name,
|
|
@@ -25374,7 +25676,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
25374
25676
|
_remotionInternalPremountDisplay: premountDisplay,
|
|
25375
25677
|
_remotionInternalPostmountDisplay: postmountDisplay,
|
|
25376
25678
|
_remotionInternalIsMedia: isMedia,
|
|
25377
|
-
_remotionInternalRefForOutline:
|
|
25679
|
+
_remotionInternalRefForOutline: passedRefForOutline,
|
|
25378
25680
|
...other
|
|
25379
25681
|
}, ref) => {
|
|
25380
25682
|
const { layout = "absolute-fill" } = other;
|
|
@@ -25382,6 +25684,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
25382
25684
|
const parentSequence = useContext17(SequenceContext);
|
|
25383
25685
|
const { rootId } = useTimelineContext();
|
|
25384
25686
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
25687
|
+
const absoluteFrom = (parentSequence?.absoluteFrom ?? 0) + from;
|
|
25385
25688
|
const nonce = useNonce();
|
|
25386
25689
|
if (layout !== "absolute-fill" && layout !== "none") {
|
|
25387
25690
|
throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${layout}`);
|
|
@@ -25401,11 +25704,24 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
25401
25704
|
if (!Number.isFinite(from)) {
|
|
25402
25705
|
throw new TypeError(`The "from" prop of a sequence must be finite, but got ${from}.`);
|
|
25403
25706
|
}
|
|
25707
|
+
if (typeof freeze !== "undefined" && freeze !== null) {
|
|
25708
|
+
if (typeof freeze !== "number") {
|
|
25709
|
+
throw new TypeError(`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof freeze}.`);
|
|
25710
|
+
}
|
|
25711
|
+
if (Number.isNaN(freeze)) {
|
|
25712
|
+
throw new TypeError(`The "freeze" prop of <Sequence /> must be a real number, but it is NaN.`);
|
|
25713
|
+
}
|
|
25714
|
+
if (!Number.isFinite(freeze)) {
|
|
25715
|
+
throw new TypeError(`The "freeze" prop of <Sequence /> must be finite, but it is ${freeze}.`);
|
|
25716
|
+
}
|
|
25717
|
+
}
|
|
25404
25718
|
const absoluteFrame = useTimelinePosition();
|
|
25405
25719
|
const videoConfig = useVideoConfig();
|
|
25406
25720
|
const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - from, durationInFrames) : durationInFrames;
|
|
25407
25721
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
25408
25722
|
const { registerSequence, unregisterSequence } = useContext17(SequenceManager);
|
|
25723
|
+
const wrapperRefForOutline = useRef6(null);
|
|
25724
|
+
const refForOutline = other.layout === "none" ? passedRefForOutline ?? null : passedRefForOutline ?? wrapperRefForOutline;
|
|
25409
25725
|
const premounting = useMemo14(() => {
|
|
25410
25726
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
25411
25727
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
@@ -25419,6 +25735,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
25419
25735
|
const cumulatedNegativeFrom = currentSequenceStart - firstFrame;
|
|
25420
25736
|
const contextValue = useMemo14(() => {
|
|
25421
25737
|
return {
|
|
25738
|
+
absoluteFrom,
|
|
25422
25739
|
cumulatedFrom,
|
|
25423
25740
|
relativeFrom: from,
|
|
25424
25741
|
cumulatedNegativeFrom,
|
|
@@ -25434,6 +25751,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
25434
25751
|
};
|
|
25435
25752
|
}, [
|
|
25436
25753
|
cumulatedFrom,
|
|
25754
|
+
absoluteFrom,
|
|
25437
25755
|
from,
|
|
25438
25756
|
actualDurationInFrames,
|
|
25439
25757
|
parentSequence,
|
|
@@ -25449,7 +25767,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
25449
25767
|
const timelineClipName = useMemo14(() => {
|
|
25450
25768
|
return name ?? "";
|
|
25451
25769
|
}, [name]);
|
|
25452
|
-
const resolvedDocumentationLink = documentationLink ??
|
|
25770
|
+
const resolvedDocumentationLink = documentationLink ?? "https://www.remotion.dev/docs/sequence";
|
|
25453
25771
|
const env = useRemotionEnvironment();
|
|
25454
25772
|
const isInsideSeries = useContext17(IsInsideSeriesContext);
|
|
25455
25773
|
const inheritedStack = other?.stack ?? null;
|
|
@@ -25562,7 +25880,19 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
25562
25880
|
]);
|
|
25563
25881
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
25564
25882
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
25883
|
+
const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */ jsx12(Freeze, {
|
|
25884
|
+
frame: freeze,
|
|
25885
|
+
children: content
|
|
25886
|
+
});
|
|
25565
25887
|
const styleIfThere = other.layout === "none" ? undefined : other.style;
|
|
25888
|
+
const sequenceRef = useCallback6((node) => {
|
|
25889
|
+
wrapperRefForOutline.current = node;
|
|
25890
|
+
if (typeof ref === "function") {
|
|
25891
|
+
ref(node);
|
|
25892
|
+
} else if (ref) {
|
|
25893
|
+
ref.current = node;
|
|
25894
|
+
}
|
|
25895
|
+
}, [ref]);
|
|
25566
25896
|
const defaultStyle = useMemo14(() => {
|
|
25567
25897
|
return {
|
|
25568
25898
|
flexDirection: undefined,
|
|
@@ -25579,11 +25909,11 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
25579
25909
|
}
|
|
25580
25910
|
return /* @__PURE__ */ jsx12(SequenceContext.Provider, {
|
|
25581
25911
|
value: contextValue,
|
|
25582
|
-
children:
|
|
25583
|
-
ref,
|
|
25912
|
+
children: frozenContent === null ? null : other.layout === "none" ? frozenContent : /* @__PURE__ */ jsx12(AbsoluteFill, {
|
|
25913
|
+
ref: sequenceRef,
|
|
25584
25914
|
style: defaultStyle,
|
|
25585
25915
|
className: other.className,
|
|
25586
|
-
children:
|
|
25916
|
+
children: frozenContent
|
|
25587
25917
|
})
|
|
25588
25918
|
});
|
|
25589
25919
|
};
|
|
@@ -25663,11 +25993,13 @@ var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
|
|
|
25663
25993
|
var SequenceWithoutSchema = SequenceInner;
|
|
25664
25994
|
var Sequence = wrapInSchema({
|
|
25665
25995
|
Component: SequenceInner,
|
|
25996
|
+
componentIdentity: "dev.remotion.remotion.Sequence",
|
|
25666
25997
|
schema: sequenceSchema,
|
|
25667
25998
|
supportsEffects: false
|
|
25668
25999
|
});
|
|
25669
26000
|
var SequenceWithoutFrom = wrapInSchema({
|
|
25670
26001
|
Component: SequenceInner,
|
|
26002
|
+
componentIdentity: null,
|
|
25671
26003
|
schema: sequenceSchemaWithoutFrom,
|
|
25672
26004
|
supportsEffects: false
|
|
25673
26005
|
});
|
|
@@ -25985,7 +26317,7 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
|
|
|
25985
26317
|
}
|
|
25986
26318
|
return document.createElement("canvas");
|
|
25987
26319
|
}, []);
|
|
25988
|
-
const draw =
|
|
26320
|
+
const draw = useCallback7((imageData) => {
|
|
25989
26321
|
const canvas = canvasRef.current;
|
|
25990
26322
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
25991
26323
|
const canvasHeight = height ?? imageData.displayHeight;
|
|
@@ -26076,10 +26408,10 @@ var decodeImage = async ({
|
|
|
26076
26408
|
if (!selectedTrack) {
|
|
26077
26409
|
throw new Error("No selected track");
|
|
26078
26410
|
}
|
|
26079
|
-
const
|
|
26411
|
+
const cache2 = [];
|
|
26080
26412
|
let durationFound = null;
|
|
26081
26413
|
const getFrameByIndex = async (frameIndex) => {
|
|
26082
|
-
const foundInCache =
|
|
26414
|
+
const foundInCache = cache2.find((c2) => c2.frameIndex === frameIndex);
|
|
26083
26415
|
if (foundInCache && foundInCache.frame) {
|
|
26084
26416
|
return foundInCache;
|
|
26085
26417
|
}
|
|
@@ -26090,7 +26422,7 @@ var decodeImage = async ({
|
|
|
26090
26422
|
if (foundInCache) {
|
|
26091
26423
|
foundInCache.frame = frame.image;
|
|
26092
26424
|
} else {
|
|
26093
|
-
|
|
26425
|
+
cache2.push({
|
|
26094
26426
|
frame: frame.image,
|
|
26095
26427
|
frameIndex,
|
|
26096
26428
|
timeInSeconds: frame.image.timestamp / 1e6
|
|
@@ -26103,7 +26435,7 @@ var decodeImage = async ({
|
|
|
26103
26435
|
};
|
|
26104
26436
|
};
|
|
26105
26437
|
const clearCache = (closeToTimeInSec) => {
|
|
26106
|
-
const itemsInCache =
|
|
26438
|
+
const itemsInCache = cache2.filter((c2) => c2.frame);
|
|
26107
26439
|
const sortByClosestToCurrentTime = itemsInCache.sort((a2, b2) => {
|
|
26108
26440
|
const aDiff = Math.abs(a2.timeInSeconds - closeToTimeInSec);
|
|
26109
26441
|
const bDiff = Math.abs(b2.timeInSeconds - closeToTimeInSec);
|
|
@@ -26126,7 +26458,7 @@ var decodeImage = async ({
|
|
|
26126
26458
|
loopBehavior,
|
|
26127
26459
|
timeInSec
|
|
26128
26460
|
});
|
|
26129
|
-
const framesBefore =
|
|
26461
|
+
const framesBefore = cache2.filter((c2) => c2.timeInSeconds <= actualTimeInSec);
|
|
26130
26462
|
const biggestIndex = framesBefore.map((c2) => c2.frameIndex).reduce((a2, b2) => Math.max(a2, b2), 0);
|
|
26131
26463
|
let i = biggestIndex;
|
|
26132
26464
|
while (true) {
|
|
@@ -26169,7 +26501,7 @@ var decodeImage = async ({
|
|
|
26169
26501
|
timeInSec
|
|
26170
26502
|
});
|
|
26171
26503
|
await ensureFrameBeforeAndAfter({ timeInSec: actualTimeInSec, loopBehavior });
|
|
26172
|
-
const itemsInCache =
|
|
26504
|
+
const itemsInCache = cache2.filter((c2) => c2.frame);
|
|
26173
26505
|
const closest = itemsInCache.reduce((a2, b2) => {
|
|
26174
26506
|
const aDiff = Math.abs(a2.timeInSeconds - actualTimeInSec);
|
|
26175
26507
|
const bDiff = Math.abs(b2.timeInSeconds - actualTimeInSec);
|
|
@@ -26206,6 +26538,7 @@ var resolveAnimatedImageSource = (src) => {
|
|
|
26206
26538
|
var animatedImageSchema = {
|
|
26207
26539
|
durationInFrames: durationInFramesField,
|
|
26208
26540
|
from: fromField,
|
|
26541
|
+
freeze: freezeField,
|
|
26209
26542
|
playbackRate: {
|
|
26210
26543
|
type: "number",
|
|
26211
26544
|
min: 0,
|
|
@@ -26405,6 +26738,7 @@ var AnimatedImageInner = ({
|
|
|
26405
26738
|
};
|
|
26406
26739
|
var AnimatedImage = wrapInSchema({
|
|
26407
26740
|
Component: AnimatedImageInner,
|
|
26741
|
+
componentIdentity: "dev.remotion.remotion.AnimatedImage",
|
|
26408
26742
|
schema: animatedImageSchema,
|
|
26409
26743
|
supportsEffects: true
|
|
26410
26744
|
});
|
|
@@ -26451,7 +26785,7 @@ var RenderAssetManager = createContext17({
|
|
|
26451
26785
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
26452
26786
|
const [renderAssets, setRenderAssets] = useState7([]);
|
|
26453
26787
|
const renderAssetsRef = useRef10([]);
|
|
26454
|
-
const registerRenderAsset =
|
|
26788
|
+
const registerRenderAsset = useCallback8((renderAsset) => {
|
|
26455
26789
|
validateRenderAsset(renderAsset);
|
|
26456
26790
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
26457
26791
|
setRenderAssets(renderAssetsRef.current);
|
|
@@ -26468,7 +26802,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
26468
26802
|
};
|
|
26469
26803
|
}, []);
|
|
26470
26804
|
}
|
|
26471
|
-
const unregisterRenderAsset =
|
|
26805
|
+
const unregisterRenderAsset = useCallback8((id) => {
|
|
26472
26806
|
renderAssetsRef.current = renderAssetsRef.current.filter((a2) => a2.id !== id);
|
|
26473
26807
|
setRenderAssets(renderAssetsRef.current);
|
|
26474
26808
|
}, []);
|
|
@@ -26630,7 +26964,7 @@ var Loop = ({
|
|
|
26630
26964
|
durationInFrames,
|
|
26631
26965
|
from,
|
|
26632
26966
|
name: name ?? "<Loop>",
|
|
26633
|
-
_remotionInternalDocumentationLink:
|
|
26967
|
+
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/loop",
|
|
26634
26968
|
_remotionInternalLoopDisplay: loopDisplay,
|
|
26635
26969
|
layout: props.layout,
|
|
26636
26970
|
style,
|
|
@@ -27273,7 +27607,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
27273
27607
|
}, []);
|
|
27274
27608
|
const prevEndTimes = useRef12({ scheduledEndTime: null, mediaEndTime: null });
|
|
27275
27609
|
const nodesToResume = useRef12(new Map);
|
|
27276
|
-
const unscheduleAudioNode =
|
|
27610
|
+
const unscheduleAudioNode = useCallback9((node) => {
|
|
27277
27611
|
nodesToResume.current.delete(node);
|
|
27278
27612
|
}, []);
|
|
27279
27613
|
const scheduleAudioNode = useMemo21(() => {
|
|
@@ -27327,7 +27661,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
27327
27661
|
};
|
|
27328
27662
|
};
|
|
27329
27663
|
}, [ctxAndGain, logLevel]);
|
|
27330
|
-
const resume =
|
|
27664
|
+
const resume = useCallback9(() => {
|
|
27331
27665
|
if (!ctxAndGain) {
|
|
27332
27666
|
return Promise.resolve();
|
|
27333
27667
|
}
|
|
@@ -27354,10 +27688,10 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
27354
27688
|
});
|
|
27355
27689
|
return resumePromise.catch(() => {});
|
|
27356
27690
|
}, [ctxAndGain, logLevel]);
|
|
27357
|
-
const getIsResumingAudioContext =
|
|
27691
|
+
const getIsResumingAudioContext = useCallback9(() => {
|
|
27358
27692
|
return isResuming.current;
|
|
27359
27693
|
}, []);
|
|
27360
|
-
const suspend =
|
|
27694
|
+
const suspend = useCallback9(() => {
|
|
27361
27695
|
if (!ctxAndGain) {
|
|
27362
27696
|
return Promise.resolve();
|
|
27363
27697
|
}
|
|
@@ -27431,7 +27765,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
27431
27765
|
};
|
|
27432
27766
|
}, [refs]);
|
|
27433
27767
|
const takenAudios = useRef12(new Array(numberOfAudioTags).fill(false));
|
|
27434
|
-
const rerenderAudios =
|
|
27768
|
+
const rerenderAudios = useCallback9(() => {
|
|
27435
27769
|
refs.forEach(({ ref, id }) => {
|
|
27436
27770
|
const data = audios.current?.find((a2) => a2.id === id);
|
|
27437
27771
|
const { current } = ref;
|
|
@@ -27452,7 +27786,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
27452
27786
|
});
|
|
27453
27787
|
});
|
|
27454
27788
|
}, [refs]);
|
|
27455
|
-
const registerAudio =
|
|
27789
|
+
const registerAudio = useCallback9((options) => {
|
|
27456
27790
|
const { aud, audioId, premounting, postmounting } = options;
|
|
27457
27791
|
const found = audios.current?.find((a2) => a2.audioId === audioId);
|
|
27458
27792
|
if (found) {
|
|
@@ -27481,7 +27815,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
27481
27815
|
rerenderAudios();
|
|
27482
27816
|
return newElem;
|
|
27483
27817
|
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
27484
|
-
const unregisterAudio =
|
|
27818
|
+
const unregisterAudio = useCallback9((id) => {
|
|
27485
27819
|
const cloned = [...takenAudios.current];
|
|
27486
27820
|
const index = refs.findIndex((r2) => r2.id === id);
|
|
27487
27821
|
if (index === -1) {
|
|
@@ -27492,7 +27826,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
27492
27826
|
audios.current = audios.current?.filter((a2) => a2.id !== id);
|
|
27493
27827
|
rerenderAudios();
|
|
27494
27828
|
}, [refs, rerenderAudios]);
|
|
27495
|
-
const updateAudio =
|
|
27829
|
+
const updateAudio = useCallback9(({
|
|
27496
27830
|
aud,
|
|
27497
27831
|
audioId,
|
|
27498
27832
|
id,
|
|
@@ -27526,7 +27860,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
27526
27860
|
rerenderAudios();
|
|
27527
27861
|
}
|
|
27528
27862
|
}, [rerenderAudios]);
|
|
27529
|
-
const playAllAudios =
|
|
27863
|
+
const playAllAudios = useCallback9(() => {
|
|
27530
27864
|
refs.forEach((ref) => {
|
|
27531
27865
|
const audio = audios.current.find((a2) => a2.el === ref.ref);
|
|
27532
27866
|
if (audio?.premounting) {
|
|
@@ -28074,7 +28408,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
28074
28408
|
const env = useRemotionEnvironment();
|
|
28075
28409
|
const rendering = env.isRendering;
|
|
28076
28410
|
const buffering = useRef15(false);
|
|
28077
|
-
const addBlock =
|
|
28411
|
+
const addBlock = useCallback10((block) => {
|
|
28078
28412
|
if (rendering) {
|
|
28079
28413
|
return {
|
|
28080
28414
|
unblock: () => {
|
|
@@ -28100,7 +28434,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
28100
28434
|
}
|
|
28101
28435
|
};
|
|
28102
28436
|
}, [rendering]);
|
|
28103
|
-
const listenForBuffering =
|
|
28437
|
+
const listenForBuffering = useCallback10((callback) => {
|
|
28104
28438
|
setOnBufferingCallbacks((c2) => [...c2, callback]);
|
|
28105
28439
|
return {
|
|
28106
28440
|
remove: () => {
|
|
@@ -28108,7 +28442,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
28108
28442
|
}
|
|
28109
28443
|
};
|
|
28110
28444
|
}, []);
|
|
28111
|
-
const listenForResume =
|
|
28445
|
+
const listenForResume = useCallback10((callback) => {
|
|
28112
28446
|
setOnResumeCallbacks((c2) => [...c2, callback]);
|
|
28113
28447
|
return {
|
|
28114
28448
|
remove: () => {
|
|
@@ -28222,7 +28556,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
28222
28556
|
}) => {
|
|
28223
28557
|
const bufferingRef = useRef16(false);
|
|
28224
28558
|
const { delayPlayback } = useBufferState();
|
|
28225
|
-
const bufferUntilFirstFrame =
|
|
28559
|
+
const bufferUntilFirstFrame = useCallback11((requestedTime) => {
|
|
28226
28560
|
if (mediaType !== "video") {
|
|
28227
28561
|
return;
|
|
28228
28562
|
}
|
|
@@ -28612,7 +28946,7 @@ var useMediaPlayback = ({
|
|
|
28612
28946
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
28613
28947
|
}
|
|
28614
28948
|
const isVariableFpsVideoMap = useRef18({});
|
|
28615
|
-
const onVariableFpsVideoDetected =
|
|
28949
|
+
const onVariableFpsVideoDetected = useCallback12(() => {
|
|
28616
28950
|
if (!src) {
|
|
28617
28951
|
return;
|
|
28618
28952
|
}
|
|
@@ -29003,7 +29337,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
29003
29337
|
premounting: Boolean(sequenceContext?.premounting),
|
|
29004
29338
|
postmounting: Boolean(sequenceContext?.postmounting)
|
|
29005
29339
|
});
|
|
29006
|
-
const getStack =
|
|
29340
|
+
const getStack = useCallback13(() => {
|
|
29007
29341
|
return _remotionInternalStack ?? null;
|
|
29008
29342
|
}, [_remotionInternalStack]);
|
|
29009
29343
|
useMediaInTimeline({
|
|
@@ -29019,7 +29353,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
29019
29353
|
premountDisplay: sequenceContext?.premountDisplay ?? null,
|
|
29020
29354
|
postmountDisplay: sequenceContext?.postmountDisplay ?? null,
|
|
29021
29355
|
loopDisplay: undefined,
|
|
29022
|
-
documentationLink:
|
|
29356
|
+
documentationLink: "https://www.remotion.dev/docs/html5-audio",
|
|
29023
29357
|
refForOutline: null
|
|
29024
29358
|
});
|
|
29025
29359
|
useMediaPlayback({
|
|
@@ -29249,7 +29583,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
29249
29583
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
29250
29584
|
}
|
|
29251
29585
|
const preloadedSrc = usePreload(props.src);
|
|
29252
|
-
const onError =
|
|
29586
|
+
const onError = useCallback14((e) => {
|
|
29253
29587
|
console.log(e.currentTarget.error);
|
|
29254
29588
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
29255
29589
|
if (loop) {
|
|
@@ -29263,7 +29597,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
29263
29597
|
console.warn(errMessage);
|
|
29264
29598
|
}
|
|
29265
29599
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
29266
|
-
const onDuration =
|
|
29600
|
+
const onDuration = useCallback14((src, durationInSeconds) => {
|
|
29267
29601
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
29268
29602
|
}, [setDurations]);
|
|
29269
29603
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -29355,6 +29689,7 @@ var resolveSolidPixelDensity = (pixelDensity) => {
|
|
|
29355
29689
|
var solidSchema = {
|
|
29356
29690
|
durationInFrames: durationInFramesField,
|
|
29357
29691
|
from: fromField,
|
|
29692
|
+
freeze: freezeField,
|
|
29358
29693
|
color: {
|
|
29359
29694
|
type: "color",
|
|
29360
29695
|
default: "transparent",
|
|
@@ -29409,7 +29744,7 @@ var SolidInner = ({
|
|
|
29409
29744
|
return canvas;
|
|
29410
29745
|
}, []);
|
|
29411
29746
|
const chainState = useEffectChainState();
|
|
29412
|
-
const canvasRef =
|
|
29747
|
+
const canvasRef = useCallback15((canvas) => {
|
|
29413
29748
|
setOutputCanvas(canvas);
|
|
29414
29749
|
if (typeof reference === "function") {
|
|
29415
29750
|
reference(canvas);
|
|
@@ -29493,6 +29828,7 @@ var SolidOuter = forwardRef8(({
|
|
|
29493
29828
|
style,
|
|
29494
29829
|
name,
|
|
29495
29830
|
from,
|
|
29831
|
+
freeze,
|
|
29496
29832
|
hidden,
|
|
29497
29833
|
showInTimeline,
|
|
29498
29834
|
pixelDensity,
|
|
@@ -29506,6 +29842,7 @@ var SolidOuter = forwardRef8(({
|
|
|
29506
29842
|
return /* @__PURE__ */ jsx24(Sequence, {
|
|
29507
29843
|
layout: "none",
|
|
29508
29844
|
from,
|
|
29845
|
+
freeze,
|
|
29509
29846
|
hidden,
|
|
29510
29847
|
showInTimeline,
|
|
29511
29848
|
_experimentalControls: controls,
|
|
@@ -29513,7 +29850,7 @@ var SolidOuter = forwardRef8(({
|
|
|
29513
29850
|
durationInFrames,
|
|
29514
29851
|
name: name ?? "<Solid>",
|
|
29515
29852
|
_remotionInternalRefForOutline: actualRef,
|
|
29516
|
-
_remotionInternalDocumentationLink:
|
|
29853
|
+
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/solid",
|
|
29517
29854
|
...props2,
|
|
29518
29855
|
children: /* @__PURE__ */ jsx24(SolidInner, {
|
|
29519
29856
|
reference: actualRef,
|
|
@@ -29530,6 +29867,7 @@ var SolidOuter = forwardRef8(({
|
|
|
29530
29867
|
});
|
|
29531
29868
|
var Solid = wrapInSchema({
|
|
29532
29869
|
Component: SolidOuter,
|
|
29870
|
+
componentIdentity: "dev.remotion.remotion.Solid",
|
|
29533
29871
|
schema: solidSchema,
|
|
29534
29872
|
supportsEffects: true
|
|
29535
29873
|
});
|
|
@@ -29619,7 +29957,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
29619
29957
|
const offscreenRef = useRef22(null);
|
|
29620
29958
|
const divRef = useRef22(null);
|
|
29621
29959
|
const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}`;
|
|
29622
|
-
const setLayoutCanvasRef =
|
|
29960
|
+
const setLayoutCanvasRef = useCallback16((node) => {
|
|
29623
29961
|
canvas2dRef.current = node;
|
|
29624
29962
|
if (typeof ref === "function") {
|
|
29625
29963
|
ref(node);
|
|
@@ -29641,7 +29979,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
29641
29979
|
const initializedRef = useRef22(false);
|
|
29642
29980
|
const onInitCleanupRef = useRef22(null);
|
|
29643
29981
|
const unmountedRef = useRef22(false);
|
|
29644
|
-
const onPaintCb =
|
|
29982
|
+
const onPaintCb = useCallback16(async () => {
|
|
29645
29983
|
const element = divRef.current;
|
|
29646
29984
|
if (!element) {
|
|
29647
29985
|
throw new Error("Canvas or scene element not found");
|
|
@@ -29814,7 +30152,7 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
29814
30152
|
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
29815
30153
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
29816
30154
|
const actualRef = useRef22(null);
|
|
29817
|
-
const setCanvasRef =
|
|
30155
|
+
const setCanvasRef = useCallback16((node) => {
|
|
29818
30156
|
actualRef.current = node;
|
|
29819
30157
|
if (typeof ref === "function") {
|
|
29820
30158
|
ref(node);
|
|
@@ -29825,7 +30163,7 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
29825
30163
|
return /* @__PURE__ */ jsx25(Sequence, {
|
|
29826
30164
|
durationInFrames: resolvedDuration,
|
|
29827
30165
|
name: name ?? "<HtmlInCanvas>",
|
|
29828
|
-
_remotionInternalDocumentationLink:
|
|
30166
|
+
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/remotion/html-in-canvas",
|
|
29829
30167
|
_experimentalControls: controls,
|
|
29830
30168
|
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
29831
30169
|
_remotionInternalRefForOutline: actualRef,
|
|
@@ -29849,11 +30187,13 @@ HtmlInCanvasInner.displayName = "HtmlInCanvas";
|
|
|
29849
30187
|
var htmlInCanvasSchema = {
|
|
29850
30188
|
durationInFrames: durationInFramesField,
|
|
29851
30189
|
from: fromField,
|
|
30190
|
+
freeze: freezeField,
|
|
29852
30191
|
...sequenceVisualStyleSchema,
|
|
29853
30192
|
hidden: hiddenField
|
|
29854
30193
|
};
|
|
29855
30194
|
var HtmlInCanvasWrapped = wrapInSchema({
|
|
29856
30195
|
Component: HtmlInCanvasInner,
|
|
30196
|
+
componentIdentity: "dev.remotion.remotion.HtmlInCanvas",
|
|
29857
30197
|
schema: htmlInCanvasSchema,
|
|
29858
30198
|
supportsEffects: true
|
|
29859
30199
|
});
|
|
@@ -29871,6 +30211,7 @@ function truncateSrcForLabel(src) {
|
|
|
29871
30211
|
var canvasImageSchema = {
|
|
29872
30212
|
durationInFrames: durationInFramesField,
|
|
29873
30213
|
from: fromField,
|
|
30214
|
+
freeze: freezeField,
|
|
29874
30215
|
fit: {
|
|
29875
30216
|
type: "enum",
|
|
29876
30217
|
default: "fill",
|
|
@@ -29976,7 +30317,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
29976
30317
|
}
|
|
29977
30318
|
return document.createElement("canvas");
|
|
29978
30319
|
}, []);
|
|
29979
|
-
const canvasRef =
|
|
30320
|
+
const canvasRef = useCallback17((canvas) => {
|
|
29980
30321
|
setOutputCanvas(canvas);
|
|
29981
30322
|
if (refForOutline) {
|
|
29982
30323
|
refForOutline.current = canvas;
|
|
@@ -30123,6 +30464,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
30123
30464
|
delayRenderTimeoutInMilliseconds,
|
|
30124
30465
|
durationInFrames,
|
|
30125
30466
|
from,
|
|
30467
|
+
freeze,
|
|
30126
30468
|
hidden,
|
|
30127
30469
|
name,
|
|
30128
30470
|
showInTimeline,
|
|
@@ -30144,6 +30486,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
30144
30486
|
layout: "none",
|
|
30145
30487
|
from: from ?? 0,
|
|
30146
30488
|
durationInFrames: durationInFrames ?? Infinity,
|
|
30489
|
+
freeze,
|
|
30147
30490
|
hidden,
|
|
30148
30491
|
showInTimeline: showInTimeline ?? true,
|
|
30149
30492
|
name: name ?? "<CanvasImage>",
|
|
@@ -30176,6 +30519,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
30176
30519
|
});
|
|
30177
30520
|
var CanvasImage = wrapInSchema({
|
|
30178
30521
|
Component: CanvasImageInner,
|
|
30522
|
+
componentIdentity: "dev.remotion.remotion.CanvasImage",
|
|
30179
30523
|
schema: canvasImageSchema,
|
|
30180
30524
|
supportsEffects: true
|
|
30181
30525
|
});
|
|
@@ -30193,11 +30537,11 @@ var IFrameRefForwarding = ({
|
|
|
30193
30537
|
retries: delayRenderRetries ?? undefined,
|
|
30194
30538
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
30195
30539
|
}));
|
|
30196
|
-
const didLoad =
|
|
30540
|
+
const didLoad = useCallback18((e) => {
|
|
30197
30541
|
continueRender2(handle);
|
|
30198
30542
|
onLoad?.(e);
|
|
30199
30543
|
}, [handle, onLoad, continueRender2]);
|
|
30200
|
-
const didGetError =
|
|
30544
|
+
const didGetError = useCallback18((e) => {
|
|
30201
30545
|
continueRender2(handle);
|
|
30202
30546
|
if (onError) {
|
|
30203
30547
|
onError(e);
|
|
@@ -30239,7 +30583,7 @@ var ImgContent = ({
|
|
|
30239
30583
|
if (!_propsValid) {
|
|
30240
30584
|
throw new Error("typecheck error");
|
|
30241
30585
|
}
|
|
30242
|
-
const imageCallbackRef =
|
|
30586
|
+
const imageCallbackRef = useCallback19((img) => {
|
|
30243
30587
|
imageRef.current = img;
|
|
30244
30588
|
refForOutline.current = img;
|
|
30245
30589
|
if (typeof ref === "function") {
|
|
@@ -30249,7 +30593,7 @@ var ImgContent = ({
|
|
|
30249
30593
|
}
|
|
30250
30594
|
}, [ref, refForOutline]);
|
|
30251
30595
|
const actualSrc = usePreload(src);
|
|
30252
|
-
const retryIn =
|
|
30596
|
+
const retryIn = useCallback19((timeout) => {
|
|
30253
30597
|
if (!imageRef.current) {
|
|
30254
30598
|
return;
|
|
30255
30599
|
}
|
|
@@ -30267,7 +30611,7 @@ var ImgContent = ({
|
|
|
30267
30611
|
}, timeout);
|
|
30268
30612
|
}, []);
|
|
30269
30613
|
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
30270
|
-
const didGetError =
|
|
30614
|
+
const didGetError = useCallback19((e) => {
|
|
30271
30615
|
if (!errors.current) {
|
|
30272
30616
|
return;
|
|
30273
30617
|
}
|
|
@@ -30377,6 +30721,7 @@ var NativeImgInner = ({
|
|
|
30377
30721
|
src,
|
|
30378
30722
|
from,
|
|
30379
30723
|
durationInFrames,
|
|
30724
|
+
freeze,
|
|
30380
30725
|
_experimentalControls: controls,
|
|
30381
30726
|
_remotionInternalRefForOutline: refForOutline,
|
|
30382
30727
|
...props2
|
|
@@ -30388,8 +30733,9 @@ var NativeImgInner = ({
|
|
|
30388
30733
|
layout: "none",
|
|
30389
30734
|
from: from ?? 0,
|
|
30390
30735
|
durationInFrames: durationInFrames ?? Infinity,
|
|
30736
|
+
freeze,
|
|
30391
30737
|
_remotionInternalStack: stack,
|
|
30392
|
-
_remotionInternalDocumentationLink:
|
|
30738
|
+
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
|
|
30393
30739
|
_remotionInternalIsMedia: { type: "image", src },
|
|
30394
30740
|
name: name ?? "<Img>",
|
|
30395
30741
|
_experimentalControls: controls,
|
|
@@ -30407,6 +30753,7 @@ var CanvasImageWithPrivateProps = CanvasImage;
|
|
|
30407
30753
|
var imgSchema = {
|
|
30408
30754
|
durationInFrames: durationInFramesField,
|
|
30409
30755
|
from: fromField,
|
|
30756
|
+
freeze: freezeField,
|
|
30410
30757
|
...sequenceVisualStyleSchema,
|
|
30411
30758
|
hidden: hiddenField
|
|
30412
30759
|
};
|
|
@@ -30462,6 +30809,7 @@ var ImgInner = ({
|
|
|
30462
30809
|
src,
|
|
30463
30810
|
from,
|
|
30464
30811
|
durationInFrames,
|
|
30812
|
+
freeze,
|
|
30465
30813
|
_experimentalControls: controls,
|
|
30466
30814
|
width,
|
|
30467
30815
|
height,
|
|
@@ -30486,6 +30834,7 @@ var ImgInner = ({
|
|
|
30486
30834
|
src,
|
|
30487
30835
|
from,
|
|
30488
30836
|
durationInFrames,
|
|
30837
|
+
freeze,
|
|
30489
30838
|
_experimentalControls: controls,
|
|
30490
30839
|
width,
|
|
30491
30840
|
height,
|
|
@@ -30527,11 +30876,12 @@ var ImgInner = ({
|
|
|
30527
30876
|
delayRenderTimeoutInMilliseconds,
|
|
30528
30877
|
from,
|
|
30529
30878
|
durationInFrames,
|
|
30879
|
+
freeze,
|
|
30530
30880
|
hidden,
|
|
30531
30881
|
name: name ?? "<Img>",
|
|
30532
30882
|
showInTimeline,
|
|
30533
30883
|
stack,
|
|
30534
|
-
_remotionInternalDocumentationLink:
|
|
30884
|
+
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
|
|
30535
30885
|
_experimentalControls: controls,
|
|
30536
30886
|
_remotionInternalRefForOutline: refForOutline,
|
|
30537
30887
|
...canvasProps
|
|
@@ -30539,6 +30889,7 @@ var ImgInner = ({
|
|
|
30539
30889
|
};
|
|
30540
30890
|
var Img = wrapInSchema({
|
|
30541
30891
|
Component: ImgInner,
|
|
30892
|
+
componentIdentity: "dev.remotion.remotion.Img",
|
|
30542
30893
|
schema: imgSchema,
|
|
30543
30894
|
supportsEffects: true
|
|
30544
30895
|
});
|
|
@@ -30546,6 +30897,7 @@ addSequenceStackTraces(Img);
|
|
|
30546
30897
|
var interactiveElementSchema = {
|
|
30547
30898
|
durationInFrames: durationInFramesField,
|
|
30548
30899
|
from: fromField,
|
|
30900
|
+
freeze: freezeField,
|
|
30549
30901
|
...sequenceVisualStyleSchema,
|
|
30550
30902
|
hidden: hiddenField
|
|
30551
30903
|
};
|
|
@@ -30561,6 +30913,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
30561
30913
|
const {
|
|
30562
30914
|
durationInFrames,
|
|
30563
30915
|
from,
|
|
30916
|
+
freeze,
|
|
30564
30917
|
hidden,
|
|
30565
30918
|
name,
|
|
30566
30919
|
showInTimeline,
|
|
@@ -30569,7 +30922,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
30569
30922
|
...props2
|
|
30570
30923
|
} = propsWithControls;
|
|
30571
30924
|
const refForOutline = useRef25(null);
|
|
30572
|
-
const callbackRef =
|
|
30925
|
+
const callbackRef = useCallback20((element) => {
|
|
30573
30926
|
refForOutline.current = element;
|
|
30574
30927
|
setRef(ref, element);
|
|
30575
30928
|
}, [ref]);
|
|
@@ -30577,11 +30930,13 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
30577
30930
|
layout: "none",
|
|
30578
30931
|
from: from ?? 0,
|
|
30579
30932
|
durationInFrames: durationInFrames ?? Infinity,
|
|
30933
|
+
freeze,
|
|
30580
30934
|
hidden,
|
|
30581
30935
|
name: name ?? displayName,
|
|
30582
30936
|
showInTimeline: showInTimeline ?? true,
|
|
30583
30937
|
_experimentalControls,
|
|
30584
30938
|
_remotionInternalStack: stack,
|
|
30939
|
+
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive",
|
|
30585
30940
|
_remotionInternalRefForOutline: refForOutline,
|
|
30586
30941
|
children: React29.createElement(tag, {
|
|
30587
30942
|
...props2,
|
|
@@ -30592,6 +30947,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
30592
30947
|
Inner.displayName = displayName;
|
|
30593
30948
|
const Wrapped = wrapInSchema({
|
|
30594
30949
|
Component: Inner,
|
|
30950
|
+
componentIdentity: `dev.remotion.remotion.${displayName.slice(1, -1)}`,
|
|
30595
30951
|
schema: interactiveElementSchema,
|
|
30596
30952
|
supportsEffects: false
|
|
30597
30953
|
});
|
|
@@ -30648,14 +31004,14 @@ var CompositionManagerProvider = ({
|
|
|
30648
31004
|
const [canvasContent, setCanvasContent] = useState18(initialCanvasContent);
|
|
30649
31005
|
const [compositions, setCompositions] = useState18(initialCompositions);
|
|
30650
31006
|
const currentcompositionsRef = useRef26(compositions);
|
|
30651
|
-
const updateCompositions =
|
|
31007
|
+
const updateCompositions = useCallback21((updateComps) => {
|
|
30652
31008
|
setCompositions((comps) => {
|
|
30653
31009
|
const updated = updateComps(comps);
|
|
30654
31010
|
currentcompositionsRef.current = updated;
|
|
30655
31011
|
return updated;
|
|
30656
31012
|
});
|
|
30657
31013
|
}, []);
|
|
30658
|
-
const registerComposition =
|
|
31014
|
+
const registerComposition = useCallback21((comp) => {
|
|
30659
31015
|
updateCompositions((comps) => {
|
|
30660
31016
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
30661
31017
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
@@ -30663,12 +31019,12 @@ var CompositionManagerProvider = ({
|
|
|
30663
31019
|
return [...comps, comp];
|
|
30664
31020
|
});
|
|
30665
31021
|
}, [updateCompositions]);
|
|
30666
|
-
const unregisterComposition =
|
|
31022
|
+
const unregisterComposition = useCallback21((id) => {
|
|
30667
31023
|
setCompositions((comps) => {
|
|
30668
31024
|
return comps.filter((c2) => c2.id !== id);
|
|
30669
31025
|
});
|
|
30670
31026
|
}, []);
|
|
30671
|
-
const registerFolder =
|
|
31027
|
+
const registerFolder = useCallback21((name, parent, nonce, stack) => {
|
|
30672
31028
|
setFolders((prevFolders) => {
|
|
30673
31029
|
return [
|
|
30674
31030
|
...prevFolders,
|
|
@@ -30681,7 +31037,7 @@ var CompositionManagerProvider = ({
|
|
|
30681
31037
|
];
|
|
30682
31038
|
});
|
|
30683
31039
|
}, []);
|
|
30684
|
-
const unregisterFolder =
|
|
31040
|
+
const unregisterFolder = useCallback21((name, parent) => {
|
|
30685
31041
|
setFolders((prevFolders) => {
|
|
30686
31042
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
30687
31043
|
});
|
|
@@ -31320,7 +31676,7 @@ var OffthreadVideoForRendering = ({
|
|
|
31320
31676
|
continueRender2,
|
|
31321
31677
|
delayRender2
|
|
31322
31678
|
]);
|
|
31323
|
-
const onErr =
|
|
31679
|
+
const onErr = useCallback22(() => {
|
|
31324
31680
|
if (onError) {
|
|
31325
31681
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
31326
31682
|
} else {
|
|
@@ -31330,7 +31686,7 @@ var OffthreadVideoForRendering = ({
|
|
|
31330
31686
|
const className = useMemo35(() => {
|
|
31331
31687
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
31332
31688
|
}, [props2.className]);
|
|
31333
|
-
const onImageFrame =
|
|
31689
|
+
const onImageFrame = useCallback22((img) => {
|
|
31334
31690
|
if (onVideoFrame) {
|
|
31335
31691
|
onVideoFrame(img);
|
|
31336
31692
|
}
|
|
@@ -31463,7 +31819,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
31463
31819
|
mediaVolume
|
|
31464
31820
|
});
|
|
31465
31821
|
warnAboutTooHighVolume(userPreferredVolume);
|
|
31466
|
-
const getStack =
|
|
31822
|
+
const getStack = useCallback23(() => {
|
|
31467
31823
|
return _remotionInternalStack ?? null;
|
|
31468
31824
|
}, [_remotionInternalStack]);
|
|
31469
31825
|
useMediaInTimeline({
|
|
@@ -31479,7 +31835,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
31479
31835
|
premountDisplay: parentSequence?.premountDisplay ?? null,
|
|
31480
31836
|
postmountDisplay: parentSequence?.postmountDisplay ?? null,
|
|
31481
31837
|
loopDisplay: undefined,
|
|
31482
|
-
documentationLink:
|
|
31838
|
+
documentationLink: onlyWarnForMediaSeekingError ? "https://www.remotion.dev/docs/offthreadvideo" : "https://www.remotion.dev/docs/html5-video",
|
|
31483
31839
|
refForOutline: videoRef
|
|
31484
31840
|
});
|
|
31485
31841
|
useMediaPlayback({
|
|
@@ -31610,6 +31966,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
31610
31966
|
isClientSideRendering: false
|
|
31611
31967
|
});
|
|
31612
31968
|
return /* @__PURE__ */ jsx34("video", {
|
|
31969
|
+
...nativeProps,
|
|
31613
31970
|
ref: videoRef,
|
|
31614
31971
|
muted: muted || mediaMuted || userPreferredVolume <= 0,
|
|
31615
31972
|
playsInline: true,
|
|
@@ -31618,7 +31975,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
31618
31975
|
style: actualStyle,
|
|
31619
31976
|
disableRemotePlayback: true,
|
|
31620
31977
|
crossOrigin: crossOriginValue,
|
|
31621
|
-
|
|
31978
|
+
controls: false
|
|
31622
31979
|
});
|
|
31623
31980
|
};
|
|
31624
31981
|
var VideoForPreview = forwardRef13(VideoForDevelopmentRefForwardingFunction);
|
|
@@ -31638,7 +31995,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
31638
31995
|
if (environment.isClientSideRendering) {
|
|
31639
31996
|
throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
31640
31997
|
}
|
|
31641
|
-
const onDuration =
|
|
31998
|
+
const onDuration = useCallback24(() => {
|
|
31642
31999
|
return;
|
|
31643
32000
|
}, []);
|
|
31644
32001
|
if (typeof props2.src !== "string") {
|
|
@@ -32008,40 +32365,17 @@ var Internals = {
|
|
|
32008
32365
|
makeStaticDragOverride,
|
|
32009
32366
|
makeKeyframedDragOverride,
|
|
32010
32367
|
resolveDragOverrideValue,
|
|
32011
|
-
getStaticDragOverrideValue,
|
|
32012
|
-
OverrideIdsToNodePathsGettersContext,
|
|
32013
|
-
OverrideIdsToNodePathsSettersContext,
|
|
32014
|
-
findPropsToDelete,
|
|
32015
|
-
makeSequencePropsSubscriptionKey,
|
|
32016
|
-
getPropStatusesCtx,
|
|
32017
|
-
getEffectPropStatusesCtx,
|
|
32018
|
-
hiddenField,
|
|
32019
|
-
durationInFramesField,
|
|
32020
|
-
|
|
32021
|
-
|
|
32022
|
-
var validateFrame = ({
|
|
32023
|
-
allowFloats,
|
|
32024
|
-
durationInFrames,
|
|
32025
|
-
frame
|
|
32026
|
-
}) => {
|
|
32027
|
-
if (typeof frame === "undefined") {
|
|
32028
|
-
throw new TypeError(`Argument missing for parameter "frame"`);
|
|
32029
|
-
}
|
|
32030
|
-
if (typeof frame !== "number") {
|
|
32031
|
-
throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
|
|
32032
|
-
}
|
|
32033
|
-
if (!Number.isFinite(frame)) {
|
|
32034
|
-
throw new RangeError(`Frame ${frame} is not finite`);
|
|
32035
|
-
}
|
|
32036
|
-
if (frame % 1 !== 0 && !allowFloats) {
|
|
32037
|
-
throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
|
|
32038
|
-
}
|
|
32039
|
-
if (frame < 0 && frame < -durationInFrames) {
|
|
32040
|
-
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the lowest frame that can be rendered is ${-durationInFrames}`);
|
|
32041
|
-
}
|
|
32042
|
-
if (frame > durationInFrames - 1) {
|
|
32043
|
-
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
32044
|
-
}
|
|
32368
|
+
getStaticDragOverrideValue,
|
|
32369
|
+
OverrideIdsToNodePathsGettersContext,
|
|
32370
|
+
OverrideIdsToNodePathsSettersContext,
|
|
32371
|
+
findPropsToDelete,
|
|
32372
|
+
makeSequencePropsSubscriptionKey,
|
|
32373
|
+
getPropStatusesCtx,
|
|
32374
|
+
getEffectPropStatusesCtx,
|
|
32375
|
+
hiddenField,
|
|
32376
|
+
durationInFramesField,
|
|
32377
|
+
freezeField,
|
|
32378
|
+
fromField
|
|
32045
32379
|
};
|
|
32046
32380
|
var flattenChildren = (children) => {
|
|
32047
32381
|
const childrenArray = React40.Children.toArray(children);
|
|
@@ -32115,257 +32449,24 @@ var SeriesInner = (props2) => {
|
|
|
32115
32449
|
});
|
|
32116
32450
|
}, [props2.children]);
|
|
32117
32451
|
return /* @__PURE__ */ jsx37(IsInsideSeriesContainer, {
|
|
32118
|
-
children: /* @__PURE__ */ jsx37(Sequence, {
|
|
32119
|
-
layout: "none",
|
|
32120
|
-
name: "<Series>",
|
|
32121
|
-
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/series",
|
|
32122
|
-
...props2,
|
|
32123
|
-
children: childrenValue
|
|
32124
|
-
})
|
|
32125
|
-
});
|
|
32126
|
-
};
|
|
32127
|
-
var Series = Object.assign(wrapInSchema({
|
|
32128
|
-
Component: SeriesInner,
|
|
32129
|
-
schema: sequenceSchemaDefaultLayoutNone,
|
|
32130
|
-
supportsEffects: false
|
|
32131
|
-
}), {
|
|
32132
|
-
Sequence: SeriesSequence
|
|
32133
|
-
});
|
|
32134
|
-
addSequenceStackTraces(Series);
|
|
32135
|
-
var validateSpringDuration = (dur) => {
|
|
32136
|
-
if (typeof dur === "undefined") {
|
|
32137
|
-
return;
|
|
32138
|
-
}
|
|
32139
|
-
if (typeof dur !== "number") {
|
|
32140
|
-
throw new TypeError(`A "duration" of a spring must be a "number" but is "${typeof dur}"`);
|
|
32141
|
-
}
|
|
32142
|
-
if (Number.isNaN(dur)) {
|
|
32143
|
-
throw new TypeError('A "duration" of a spring is NaN, which it must not be');
|
|
32144
|
-
}
|
|
32145
|
-
if (!Number.isFinite(dur)) {
|
|
32146
|
-
throw new TypeError('A "duration" of a spring must be finite, but is ' + dur);
|
|
32147
|
-
}
|
|
32148
|
-
if (dur <= 0) {
|
|
32149
|
-
throw new TypeError('A "duration" of a spring must be positive, but is ' + dur);
|
|
32150
|
-
}
|
|
32151
|
-
};
|
|
32152
|
-
var defaultSpringConfig = {
|
|
32153
|
-
damping: 10,
|
|
32154
|
-
mass: 1,
|
|
32155
|
-
stiffness: 100,
|
|
32156
|
-
overshootClamping: false
|
|
32157
|
-
};
|
|
32158
|
-
var advanceCache = {};
|
|
32159
|
-
function advance({
|
|
32160
|
-
animation,
|
|
32161
|
-
now,
|
|
32162
|
-
config
|
|
32163
|
-
}) {
|
|
32164
|
-
const { toValue: toValue2, lastTimestamp, current, velocity } = animation;
|
|
32165
|
-
const deltaTime = Math.min(now - lastTimestamp, 64);
|
|
32166
|
-
if (config.damping <= 0) {
|
|
32167
|
-
throw new Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");
|
|
32168
|
-
}
|
|
32169
|
-
const c2 = config.damping;
|
|
32170
|
-
const m = config.mass;
|
|
32171
|
-
const k = config.stiffness;
|
|
32172
|
-
const cacheKey = [
|
|
32173
|
-
toValue2,
|
|
32174
|
-
lastTimestamp,
|
|
32175
|
-
current,
|
|
32176
|
-
velocity,
|
|
32177
|
-
c2,
|
|
32178
|
-
m,
|
|
32179
|
-
k,
|
|
32180
|
-
now
|
|
32181
|
-
].join("-");
|
|
32182
|
-
if (advanceCache[cacheKey]) {
|
|
32183
|
-
return advanceCache[cacheKey];
|
|
32184
|
-
}
|
|
32185
|
-
const v0 = -velocity;
|
|
32186
|
-
const x0 = toValue2 - current;
|
|
32187
|
-
const zeta = c2 / (2 * Math.sqrt(k * m));
|
|
32188
|
-
const omega0 = Math.sqrt(k / m);
|
|
32189
|
-
const omega1 = omega0 * Math.sqrt(1 - zeta ** 2);
|
|
32190
|
-
const t = deltaTime / 1000;
|
|
32191
|
-
const sin1 = Math.sin(omega1 * t);
|
|
32192
|
-
const cos1 = Math.cos(omega1 * t);
|
|
32193
|
-
const underDampedEnvelope = Math.exp(-zeta * omega0 * t);
|
|
32194
|
-
const underDampedFrag1 = underDampedEnvelope * (sin1 * ((v0 + zeta * omega0 * x0) / omega1) + x0 * cos1);
|
|
32195
|
-
const underDampedPosition = toValue2 - underDampedFrag1;
|
|
32196
|
-
const underDampedVelocity = zeta * omega0 * underDampedFrag1 - underDampedEnvelope * (cos1 * (v0 + zeta * omega0 * x0) - omega1 * x0 * sin1);
|
|
32197
|
-
const criticallyDampedEnvelope = Math.exp(-omega0 * t);
|
|
32198
|
-
const criticallyDampedPosition = toValue2 - criticallyDampedEnvelope * (x0 + (v0 + omega0 * x0) * t);
|
|
32199
|
-
const criticallyDampedVelocity = criticallyDampedEnvelope * (v0 * (t * omega0 - 1) + t * x0 * omega0 * omega0);
|
|
32200
|
-
const animationNode = {
|
|
32201
|
-
toValue: toValue2,
|
|
32202
|
-
prevPosition: current,
|
|
32203
|
-
lastTimestamp: now,
|
|
32204
|
-
current: zeta < 1 ? underDampedPosition : criticallyDampedPosition,
|
|
32205
|
-
velocity: zeta < 1 ? underDampedVelocity : criticallyDampedVelocity
|
|
32206
|
-
};
|
|
32207
|
-
advanceCache[cacheKey] = animationNode;
|
|
32208
|
-
return animationNode;
|
|
32209
|
-
}
|
|
32210
|
-
var calculationCache = {};
|
|
32211
|
-
function springCalculation({
|
|
32212
|
-
frame,
|
|
32213
|
-
fps,
|
|
32214
|
-
config = {}
|
|
32215
|
-
}) {
|
|
32216
|
-
const from = 0;
|
|
32217
|
-
const to = 1;
|
|
32218
|
-
const cacheKey = [
|
|
32219
|
-
frame,
|
|
32220
|
-
fps,
|
|
32221
|
-
config.damping,
|
|
32222
|
-
config.mass,
|
|
32223
|
-
config.overshootClamping,
|
|
32224
|
-
config.stiffness
|
|
32225
|
-
].join("-");
|
|
32226
|
-
if (calculationCache[cacheKey]) {
|
|
32227
|
-
return calculationCache[cacheKey];
|
|
32228
|
-
}
|
|
32229
|
-
let animation = {
|
|
32230
|
-
lastTimestamp: 0,
|
|
32231
|
-
current: from,
|
|
32232
|
-
toValue: to,
|
|
32233
|
-
velocity: 0,
|
|
32234
|
-
prevPosition: 0
|
|
32235
|
-
};
|
|
32236
|
-
const frameClamped = Math.max(0, frame);
|
|
32237
|
-
const unevenRest = frameClamped % 1;
|
|
32238
|
-
for (let f = 0;f <= Math.floor(frameClamped); f++) {
|
|
32239
|
-
if (f === Math.floor(frameClamped)) {
|
|
32240
|
-
f += unevenRest;
|
|
32241
|
-
}
|
|
32242
|
-
const time = f / fps * 1000;
|
|
32243
|
-
animation = advance({
|
|
32244
|
-
animation,
|
|
32245
|
-
now: time,
|
|
32246
|
-
config: {
|
|
32247
|
-
...defaultSpringConfig,
|
|
32248
|
-
...config
|
|
32249
|
-
}
|
|
32250
|
-
});
|
|
32251
|
-
}
|
|
32252
|
-
calculationCache[cacheKey] = animation;
|
|
32253
|
-
return animation;
|
|
32254
|
-
}
|
|
32255
|
-
var cache = new Map;
|
|
32256
|
-
function measureSpring({
|
|
32257
|
-
fps,
|
|
32258
|
-
config = {},
|
|
32259
|
-
threshold = 0.005
|
|
32260
|
-
}) {
|
|
32261
|
-
if (typeof threshold !== "number") {
|
|
32262
|
-
throw new TypeError(`threshold must be a number, got ${threshold} of type ${typeof threshold}`);
|
|
32263
|
-
}
|
|
32264
|
-
if (threshold === 0) {
|
|
32265
|
-
return Infinity;
|
|
32266
|
-
}
|
|
32267
|
-
if (threshold === 1) {
|
|
32268
|
-
return 0;
|
|
32269
|
-
}
|
|
32270
|
-
if (isNaN(threshold)) {
|
|
32271
|
-
throw new TypeError("Threshold is NaN");
|
|
32272
|
-
}
|
|
32273
|
-
if (!Number.isFinite(threshold)) {
|
|
32274
|
-
throw new TypeError("Threshold is not finite");
|
|
32275
|
-
}
|
|
32276
|
-
if (threshold < 0) {
|
|
32277
|
-
throw new TypeError("Threshold is below 0");
|
|
32278
|
-
}
|
|
32279
|
-
const cacheKey = [
|
|
32280
|
-
fps,
|
|
32281
|
-
config.damping,
|
|
32282
|
-
config.mass,
|
|
32283
|
-
config.overshootClamping,
|
|
32284
|
-
config.stiffness,
|
|
32285
|
-
threshold
|
|
32286
|
-
].join("-");
|
|
32287
|
-
if (cache.has(cacheKey)) {
|
|
32288
|
-
return cache.get(cacheKey);
|
|
32289
|
-
}
|
|
32290
|
-
validateFps(fps, "to the measureSpring() function", false);
|
|
32291
|
-
let frame = 0;
|
|
32292
|
-
let finishedFrame = 0;
|
|
32293
|
-
const calc = () => {
|
|
32294
|
-
return springCalculation({
|
|
32295
|
-
fps,
|
|
32296
|
-
frame,
|
|
32297
|
-
config
|
|
32298
|
-
});
|
|
32299
|
-
};
|
|
32300
|
-
let animation = calc();
|
|
32301
|
-
const calcDifference = () => {
|
|
32302
|
-
return Math.abs(animation.current - animation.toValue);
|
|
32303
|
-
};
|
|
32304
|
-
let difference = calcDifference();
|
|
32305
|
-
while (difference >= threshold) {
|
|
32306
|
-
frame++;
|
|
32307
|
-
animation = calc();
|
|
32308
|
-
difference = calcDifference();
|
|
32309
|
-
}
|
|
32310
|
-
finishedFrame = frame;
|
|
32311
|
-
for (let i = 0;i < 20; i++) {
|
|
32312
|
-
frame++;
|
|
32313
|
-
animation = calc();
|
|
32314
|
-
difference = calcDifference();
|
|
32315
|
-
if (difference >= threshold) {
|
|
32316
|
-
i = 0;
|
|
32317
|
-
finishedFrame = frame + 1;
|
|
32318
|
-
}
|
|
32319
|
-
}
|
|
32320
|
-
cache.set(cacheKey, finishedFrame);
|
|
32321
|
-
return finishedFrame;
|
|
32322
|
-
}
|
|
32323
|
-
function spring({
|
|
32324
|
-
frame: passedFrame,
|
|
32325
|
-
fps,
|
|
32326
|
-
config = {},
|
|
32327
|
-
from = 0,
|
|
32328
|
-
to = 1,
|
|
32329
|
-
durationInFrames: passedDurationInFrames,
|
|
32330
|
-
durationRestThreshold,
|
|
32331
|
-
delay = 0,
|
|
32332
|
-
reverse = false
|
|
32333
|
-
}) {
|
|
32334
|
-
validateSpringDuration(passedDurationInFrames);
|
|
32335
|
-
validateFrame({
|
|
32336
|
-
frame: passedFrame,
|
|
32337
|
-
durationInFrames: Infinity,
|
|
32338
|
-
allowFloats: true
|
|
32339
|
-
});
|
|
32340
|
-
validateFps(fps, "to spring()", false);
|
|
32341
|
-
const needsToCalculateNaturalDuration = reverse || typeof passedDurationInFrames !== "undefined";
|
|
32342
|
-
const naturalDuration = needsToCalculateNaturalDuration ? measureSpring({
|
|
32343
|
-
fps,
|
|
32344
|
-
config,
|
|
32345
|
-
threshold: durationRestThreshold
|
|
32346
|
-
}) : undefined;
|
|
32347
|
-
const naturalDurationGetter = needsToCalculateNaturalDuration ? {
|
|
32348
|
-
get: () => naturalDuration
|
|
32349
|
-
} : {
|
|
32350
|
-
get: () => {
|
|
32351
|
-
throw new Error("did not calculate natural duration, this is an error with Remotion. Please report");
|
|
32352
|
-
}
|
|
32353
|
-
};
|
|
32354
|
-
const reverseProcessed = reverse ? (passedDurationInFrames ?? naturalDurationGetter.get()) - passedFrame : passedFrame;
|
|
32355
|
-
const delayProcessed = reverseProcessed + (reverse ? delay : -delay);
|
|
32356
|
-
const durationProcessed = passedDurationInFrames === undefined ? delayProcessed : delayProcessed / (passedDurationInFrames / naturalDurationGetter.get());
|
|
32357
|
-
if (passedDurationInFrames && delayProcessed > passedDurationInFrames) {
|
|
32358
|
-
return to;
|
|
32359
|
-
}
|
|
32360
|
-
const spr = springCalculation({
|
|
32361
|
-
fps,
|
|
32362
|
-
frame: durationProcessed,
|
|
32363
|
-
config
|
|
32452
|
+
children: /* @__PURE__ */ jsx37(Sequence, {
|
|
32453
|
+
layout: "none",
|
|
32454
|
+
name: "<Series>",
|
|
32455
|
+
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/series",
|
|
32456
|
+
...props2,
|
|
32457
|
+
children: childrenValue
|
|
32458
|
+
})
|
|
32364
32459
|
});
|
|
32365
|
-
|
|
32366
|
-
|
|
32367
|
-
|
|
32368
|
-
|
|
32460
|
+
};
|
|
32461
|
+
var Series = Object.assign(wrapInSchema({
|
|
32462
|
+
Component: SeriesInner,
|
|
32463
|
+
componentIdentity: "dev.remotion.remotion.Series",
|
|
32464
|
+
schema: sequenceSchemaDefaultLayoutNone,
|
|
32465
|
+
supportsEffects: false
|
|
32466
|
+
}), {
|
|
32467
|
+
Sequence: SeriesSequence
|
|
32468
|
+
});
|
|
32469
|
+
addSequenceStackTraces(Series);
|
|
32369
32470
|
var problematicCharacters = {
|
|
32370
32471
|
"%3A": ":",
|
|
32371
32472
|
"%2F": "/",
|
|
@@ -32824,7 +32925,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
32824
32925
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
32825
32926
|
}
|
|
32826
32927
|
const preloadedSrc = usePreload(props2.src);
|
|
32827
|
-
const onDuration =
|
|
32928
|
+
const onDuration = useCallback25((src, durationInSeconds) => {
|
|
32828
32929
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
32829
32930
|
}, [setDurations]);
|
|
32830
32931
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
@@ -32934,7 +33035,7 @@ addSequenceStackTraces(Composition);
|
|
|
32934
33035
|
addSequenceStackTraces(Folder);
|
|
32935
33036
|
|
|
32936
33037
|
// ../shapes/dist/esm/index.mjs
|
|
32937
|
-
import React, { useCallback as
|
|
33038
|
+
import React, { useCallback as useCallback26, useMemo as useMemo40, useRef as useRef29 } from "react";
|
|
32938
33039
|
import { version } from "react-dom";
|
|
32939
33040
|
import { jsx as jsx40, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
32940
33041
|
import { jsx as jsx210 } from "react/jsx-runtime";
|
|
@@ -32946,6 +33047,7 @@ import { jsx as jsx72 } from "react/jsx-runtime";
|
|
|
32946
33047
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
32947
33048
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
32948
33049
|
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
33050
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
32949
33051
|
var unitDir = (from, to) => {
|
|
32950
33052
|
const dx = to[0] - from[0];
|
|
32951
33053
|
const dy = to[1] - from[1];
|
|
@@ -33104,6 +33206,7 @@ var RenderSvg = ({
|
|
|
33104
33206
|
pixelDensity,
|
|
33105
33207
|
durationInFrames,
|
|
33106
33208
|
from,
|
|
33209
|
+
freeze,
|
|
33107
33210
|
hidden,
|
|
33108
33211
|
name,
|
|
33109
33212
|
showInTimeline,
|
|
@@ -33124,10 +33227,10 @@ var RenderSvg = ({
|
|
|
33124
33227
|
};
|
|
33125
33228
|
}, [pathStyle]);
|
|
33126
33229
|
const outlineRef = useRef29(null);
|
|
33127
|
-
const setSvgRef =
|
|
33230
|
+
const setSvgRef = useCallback26((node) => {
|
|
33128
33231
|
outlineRef.current = node;
|
|
33129
33232
|
}, []);
|
|
33130
|
-
const setCanvasRef =
|
|
33233
|
+
const setCanvasRef = useCallback26((canvas) => {
|
|
33131
33234
|
outlineRef.current = canvas;
|
|
33132
33235
|
}, []);
|
|
33133
33236
|
const memoizedEffectDefinitions = Internals.useMemoizedEffectDefinitions(effects);
|
|
@@ -33212,6 +33315,7 @@ var RenderSvg = ({
|
|
|
33212
33315
|
return /* @__PURE__ */ jsx40(Sequence, {
|
|
33213
33316
|
layout: "none",
|
|
33214
33317
|
from,
|
|
33318
|
+
freeze,
|
|
33215
33319
|
hidden,
|
|
33216
33320
|
showInTimeline,
|
|
33217
33321
|
_experimentalControls: controls,
|
|
@@ -33262,56 +33366,477 @@ var colorField = ({
|
|
|
33262
33366
|
description
|
|
33263
33367
|
};
|
|
33264
33368
|
};
|
|
33265
|
-
var enumField = ({
|
|
33266
|
-
defaultValue,
|
|
33267
|
-
description,
|
|
33268
|
-
variants
|
|
33369
|
+
var enumField = ({
|
|
33370
|
+
defaultValue,
|
|
33371
|
+
description,
|
|
33372
|
+
variants
|
|
33373
|
+
}) => {
|
|
33374
|
+
return {
|
|
33375
|
+
type: "enum",
|
|
33376
|
+
default: defaultValue,
|
|
33377
|
+
description,
|
|
33378
|
+
variants: Object.fromEntries(variants.map((variant) => [variant, {}]))
|
|
33379
|
+
};
|
|
33380
|
+
};
|
|
33381
|
+
var makeShapeSchema = (shapeFields) => {
|
|
33382
|
+
return {
|
|
33383
|
+
from: Internals.sequenceSchema.from,
|
|
33384
|
+
freeze: Internals.sequenceSchema.freeze,
|
|
33385
|
+
durationInFrames: Internals.sequenceSchema.durationInFrames,
|
|
33386
|
+
...shapeFields,
|
|
33387
|
+
fill: colorField({
|
|
33388
|
+
defaultValue: "#0b84ff",
|
|
33389
|
+
description: "Fill"
|
|
33390
|
+
}),
|
|
33391
|
+
...Internals.sequenceVisualStyleSchema,
|
|
33392
|
+
hidden: Internals.sequenceSchema.hidden
|
|
33393
|
+
};
|
|
33394
|
+
};
|
|
33395
|
+
var arrowSchema = makeShapeSchema({
|
|
33396
|
+
length: numberField({
|
|
33397
|
+
defaultValue: 300,
|
|
33398
|
+
description: "Length",
|
|
33399
|
+
min: 0
|
|
33400
|
+
}),
|
|
33401
|
+
headWidth: numberField({
|
|
33402
|
+
defaultValue: 185,
|
|
33403
|
+
description: "Head Width",
|
|
33404
|
+
min: 0
|
|
33405
|
+
}),
|
|
33406
|
+
headLength: numberField({
|
|
33407
|
+
defaultValue: 120,
|
|
33408
|
+
description: "Head Length",
|
|
33409
|
+
min: 0
|
|
33410
|
+
}),
|
|
33411
|
+
shaftWidth: numberField({
|
|
33412
|
+
defaultValue: 80,
|
|
33413
|
+
description: "Shaft Width",
|
|
33414
|
+
min: 0
|
|
33415
|
+
}),
|
|
33416
|
+
direction: enumField({
|
|
33417
|
+
defaultValue: "right",
|
|
33418
|
+
description: "Direction",
|
|
33419
|
+
variants: ["right", "left", "up", "down"]
|
|
33420
|
+
}),
|
|
33421
|
+
cornerRadius: numberField({
|
|
33422
|
+
defaultValue: 0,
|
|
33423
|
+
description: "Corner Radius",
|
|
33424
|
+
min: 0
|
|
33425
|
+
})
|
|
33426
|
+
});
|
|
33427
|
+
var ArrowInner = ({
|
|
33428
|
+
length: length2,
|
|
33429
|
+
headWidth,
|
|
33430
|
+
headLength,
|
|
33431
|
+
shaftWidth,
|
|
33432
|
+
direction,
|
|
33433
|
+
cornerRadius,
|
|
33434
|
+
...props
|
|
33435
|
+
}) => {
|
|
33436
|
+
return /* @__PURE__ */ jsx210(RenderSvg, {
|
|
33437
|
+
defaultName: "<Arrow>",
|
|
33438
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/arrow",
|
|
33439
|
+
...makeArrow({
|
|
33440
|
+
length: length2,
|
|
33441
|
+
headWidth,
|
|
33442
|
+
headLength,
|
|
33443
|
+
shaftWidth,
|
|
33444
|
+
direction,
|
|
33445
|
+
cornerRadius
|
|
33446
|
+
}),
|
|
33447
|
+
...props
|
|
33448
|
+
});
|
|
33449
|
+
};
|
|
33450
|
+
var Arrow = Internals.wrapInSchema({
|
|
33451
|
+
Component: ArrowInner,
|
|
33452
|
+
componentIdentity: "dev.remotion.shapes.Arrow",
|
|
33453
|
+
schema: arrowSchema,
|
|
33454
|
+
supportsEffects: true
|
|
33455
|
+
});
|
|
33456
|
+
Internals.addSequenceStackTraces(Arrow);
|
|
33457
|
+
var shortenVector = (vector, radius) => {
|
|
33458
|
+
const [x, y] = vector;
|
|
33459
|
+
const currentLength = Math.sqrt(x * x + y * y);
|
|
33460
|
+
const scalingFactor = (currentLength - radius) / currentLength;
|
|
33461
|
+
return [x * scalingFactor, y * scalingFactor];
|
|
33462
|
+
};
|
|
33463
|
+
var scaleVectorToLength = (vector, length2) => {
|
|
33464
|
+
const [x, y] = vector;
|
|
33465
|
+
const currentLength = Math.sqrt(x * x + y * y);
|
|
33466
|
+
const scalingFactor = length2 / currentLength;
|
|
33467
|
+
return [x * scalingFactor, y * scalingFactor];
|
|
33468
|
+
};
|
|
33469
|
+
var joinPoints = (points, {
|
|
33470
|
+
edgeRoundness,
|
|
33471
|
+
cornerRadius,
|
|
33472
|
+
roundCornerStrategy
|
|
33473
|
+
}) => {
|
|
33474
|
+
return points.map(([x, y], i) => {
|
|
33475
|
+
const prevPointIndex = i === 0 ? points.length - 2 : i - 1;
|
|
33476
|
+
const prevPoint = points[prevPointIndex];
|
|
33477
|
+
const nextPointIndex = i === points.length - 1 ? 1 : i + 1;
|
|
33478
|
+
const nextPoint = points[nextPointIndex];
|
|
33479
|
+
const middleOfLine = [(x + nextPoint[0]) / 2, (y + nextPoint[1]) / 2];
|
|
33480
|
+
const prevPointMiddleOfLine = [
|
|
33481
|
+
(x + prevPoint[0]) / 2,
|
|
33482
|
+
(y + prevPoint[1]) / 2
|
|
33483
|
+
];
|
|
33484
|
+
const prevVector = [x - prevPoint[0], y - prevPoint[1]];
|
|
33485
|
+
const nextVector = [nextPoint[0] - x, nextPoint[1] - y];
|
|
33486
|
+
if (i === 0) {
|
|
33487
|
+
if (edgeRoundness !== null) {
|
|
33488
|
+
return [
|
|
33489
|
+
{
|
|
33490
|
+
type: "M",
|
|
33491
|
+
x: middleOfLine[0],
|
|
33492
|
+
y: middleOfLine[1]
|
|
33493
|
+
}
|
|
33494
|
+
];
|
|
33495
|
+
}
|
|
33496
|
+
if (cornerRadius !== 0) {
|
|
33497
|
+
const computeRadius = shortenVector(nextVector, cornerRadius);
|
|
33498
|
+
return [
|
|
33499
|
+
{
|
|
33500
|
+
type: "M",
|
|
33501
|
+
x: computeRadius[0] + x,
|
|
33502
|
+
y: computeRadius[1] + y
|
|
33503
|
+
}
|
|
33504
|
+
];
|
|
33505
|
+
}
|
|
33506
|
+
return [
|
|
33507
|
+
{
|
|
33508
|
+
type: "M",
|
|
33509
|
+
x,
|
|
33510
|
+
y
|
|
33511
|
+
}
|
|
33512
|
+
];
|
|
33513
|
+
}
|
|
33514
|
+
if (cornerRadius && edgeRoundness !== null) {
|
|
33515
|
+
throw new Error(`"cornerRadius" and "edgeRoundness" cannot be specified at the same time.`);
|
|
33516
|
+
}
|
|
33517
|
+
if (edgeRoundness === null) {
|
|
33518
|
+
if (cornerRadius === 0) {
|
|
33519
|
+
return [
|
|
33520
|
+
{
|
|
33521
|
+
type: "L",
|
|
33522
|
+
x,
|
|
33523
|
+
y
|
|
33524
|
+
}
|
|
33525
|
+
];
|
|
33526
|
+
}
|
|
33527
|
+
const prevVectorMinusRadius = shortenVector(prevVector, cornerRadius);
|
|
33528
|
+
const prevVectorLength = scaleVectorToLength(prevVector, cornerRadius);
|
|
33529
|
+
const nextVectorMinusRadius = scaleVectorToLength(nextVector, cornerRadius);
|
|
33530
|
+
const firstDraw = [
|
|
33531
|
+
prevPoint[0] + prevVectorMinusRadius[0],
|
|
33532
|
+
prevPoint[1] + prevVectorMinusRadius[1]
|
|
33533
|
+
];
|
|
33534
|
+
return [
|
|
33535
|
+
{
|
|
33536
|
+
type: "L",
|
|
33537
|
+
x: firstDraw[0],
|
|
33538
|
+
y: firstDraw[1]
|
|
33539
|
+
},
|
|
33540
|
+
roundCornerStrategy === "arc" ? {
|
|
33541
|
+
type: "a",
|
|
33542
|
+
rx: cornerRadius,
|
|
33543
|
+
ry: cornerRadius,
|
|
33544
|
+
xAxisRotation: 0,
|
|
33545
|
+
dx: prevVectorLength[0] + nextVectorMinusRadius[0],
|
|
33546
|
+
dy: prevVectorLength[1] + nextVectorMinusRadius[1],
|
|
33547
|
+
largeArcFlag: false,
|
|
33548
|
+
sweepFlag: true
|
|
33549
|
+
} : {
|
|
33550
|
+
type: "C",
|
|
33551
|
+
x: firstDraw[0] + prevVectorLength[0] + nextVectorMinusRadius[0],
|
|
33552
|
+
y: firstDraw[1] + prevVectorLength[1] + nextVectorMinusRadius[1],
|
|
33553
|
+
cp1x: x,
|
|
33554
|
+
cp1y: y,
|
|
33555
|
+
cp2x: x,
|
|
33556
|
+
cp2y: y
|
|
33557
|
+
}
|
|
33558
|
+
];
|
|
33559
|
+
}
|
|
33560
|
+
const controlPoint1 = [
|
|
33561
|
+
prevPointMiddleOfLine[0] + prevVector[0] * edgeRoundness * 0.5,
|
|
33562
|
+
prevPointMiddleOfLine[1] + prevVector[1] * edgeRoundness * 0.5
|
|
33563
|
+
];
|
|
33564
|
+
const controlPoint2 = [
|
|
33565
|
+
middleOfLine[0] - nextVector[0] * edgeRoundness * 0.5,
|
|
33566
|
+
middleOfLine[1] - nextVector[1] * edgeRoundness * 0.5
|
|
33567
|
+
];
|
|
33568
|
+
return [
|
|
33569
|
+
{
|
|
33570
|
+
type: "C",
|
|
33571
|
+
cp1x: controlPoint1[0],
|
|
33572
|
+
cp1y: controlPoint1[1],
|
|
33573
|
+
cp2x: controlPoint2[0],
|
|
33574
|
+
cp2y: controlPoint2[1],
|
|
33575
|
+
x: middleOfLine[0],
|
|
33576
|
+
y: middleOfLine[1]
|
|
33577
|
+
}
|
|
33578
|
+
];
|
|
33579
|
+
}).flat(1);
|
|
33580
|
+
};
|
|
33581
|
+
var ensurePositive = (name, value) => {
|
|
33582
|
+
if (typeof value !== "number" || value <= 0) {
|
|
33583
|
+
throw new Error(`"${name}" must be a positive number, got ${value}`);
|
|
33584
|
+
}
|
|
33585
|
+
};
|
|
33586
|
+
var pointerInterval = ({
|
|
33587
|
+
availableLength,
|
|
33588
|
+
pointerBaseWidth,
|
|
33589
|
+
pointerPosition
|
|
33590
|
+
}) => {
|
|
33591
|
+
const center = availableLength * pointerPosition;
|
|
33592
|
+
const half = pointerBaseWidth / 2;
|
|
33593
|
+
return {
|
|
33594
|
+
center,
|
|
33595
|
+
start: Math.max(0, center - half),
|
|
33596
|
+
end: Math.min(availableLength, center + half)
|
|
33597
|
+
};
|
|
33598
|
+
};
|
|
33599
|
+
var areSamePoint = (a2, b2) => {
|
|
33600
|
+
return a2[0] === b2[0] && a2[1] === b2[1];
|
|
33601
|
+
};
|
|
33602
|
+
var normalizeClosedPoints = (points) => {
|
|
33603
|
+
const deduplicated = points.reduce((acc, entry) => {
|
|
33604
|
+
const previous = acc[acc.length - 1];
|
|
33605
|
+
if (previous && areSamePoint(previous.point, entry.point)) {
|
|
33606
|
+
acc[acc.length - 1] = {
|
|
33607
|
+
point: previous.point,
|
|
33608
|
+
round: previous.round && entry.round
|
|
33609
|
+
};
|
|
33610
|
+
return acc;
|
|
33611
|
+
}
|
|
33612
|
+
return [...acc, entry];
|
|
33613
|
+
}, []);
|
|
33614
|
+
if (deduplicated.length === 0) {
|
|
33615
|
+
return deduplicated;
|
|
33616
|
+
}
|
|
33617
|
+
const first = deduplicated[0];
|
|
33618
|
+
const last = deduplicated[deduplicated.length - 1];
|
|
33619
|
+
if (areSamePoint(first.point, last.point)) {
|
|
33620
|
+
const [firstEntry, ...rest] = deduplicated;
|
|
33621
|
+
const withoutLast = rest.slice(0, -1);
|
|
33622
|
+
const mergedFirst = {
|
|
33623
|
+
point: firstEntry.point,
|
|
33624
|
+
round: firstEntry.round && last.round
|
|
33625
|
+
};
|
|
33626
|
+
return [mergedFirst, ...withoutLast, mergedFirst];
|
|
33627
|
+
}
|
|
33628
|
+
return [...deduplicated, first];
|
|
33629
|
+
};
|
|
33630
|
+
var unitDir2 = (from, to) => {
|
|
33631
|
+
const dx = to[0] - from[0];
|
|
33632
|
+
const dy = to[1] - from[1];
|
|
33633
|
+
const len = Math.sqrt(dx * dx + dy * dy);
|
|
33634
|
+
if (len === 0) {
|
|
33635
|
+
return [0, 0];
|
|
33636
|
+
}
|
|
33637
|
+
return [dx / len, dy / len];
|
|
33638
|
+
};
|
|
33639
|
+
var makeInstructions2 = ({
|
|
33640
|
+
points,
|
|
33641
|
+
edgeRoundness,
|
|
33642
|
+
cornerRadius
|
|
33643
|
+
}) => {
|
|
33644
|
+
const rawPoints = points.map((p) => p.point);
|
|
33645
|
+
if (edgeRoundness !== null || cornerRadius === 0) {
|
|
33646
|
+
return [
|
|
33647
|
+
...joinPoints(rawPoints, {
|
|
33648
|
+
edgeRoundness,
|
|
33649
|
+
cornerRadius,
|
|
33650
|
+
roundCornerStrategy: "arc"
|
|
33651
|
+
}),
|
|
33652
|
+
{
|
|
33653
|
+
type: "Z"
|
|
33654
|
+
}
|
|
33655
|
+
];
|
|
33656
|
+
}
|
|
33657
|
+
const uniquePoints = areSamePoint(points[0].point, points[points.length - 1].point) ? points.slice(0, -1) : points;
|
|
33658
|
+
const firstPoint = uniquePoints[0];
|
|
33659
|
+
const startDir = firstPoint.round ? unitDir2(uniquePoints[0].point, uniquePoints[1].point) : null;
|
|
33660
|
+
const startPoint = startDir ? [
|
|
33661
|
+
firstPoint.point[0] + startDir[0] * cornerRadius,
|
|
33662
|
+
firstPoint.point[1] + startDir[1] * cornerRadius
|
|
33663
|
+
] : firstPoint.point;
|
|
33664
|
+
const instructions = [
|
|
33665
|
+
{ type: "M", x: startPoint[0], y: startPoint[1] }
|
|
33666
|
+
];
|
|
33667
|
+
for (let i = 1;i < uniquePoints.length; i++) {
|
|
33668
|
+
const current = uniquePoints[i];
|
|
33669
|
+
if (!current.round) {
|
|
33670
|
+
instructions.push({
|
|
33671
|
+
type: "L",
|
|
33672
|
+
x: current.point[0],
|
|
33673
|
+
y: current.point[1]
|
|
33674
|
+
});
|
|
33675
|
+
continue;
|
|
33676
|
+
}
|
|
33677
|
+
const previous = uniquePoints[i - 1].point;
|
|
33678
|
+
const next = uniquePoints[(i + 1) % uniquePoints.length].point;
|
|
33679
|
+
const incoming = unitDir2(previous, current.point);
|
|
33680
|
+
const outgoing = unitDir2(current.point, next);
|
|
33681
|
+
const arcStart = [
|
|
33682
|
+
current.point[0] - incoming[0] * cornerRadius,
|
|
33683
|
+
current.point[1] - incoming[1] * cornerRadius
|
|
33684
|
+
];
|
|
33685
|
+
instructions.push({
|
|
33686
|
+
type: "L",
|
|
33687
|
+
x: arcStart[0],
|
|
33688
|
+
y: arcStart[1]
|
|
33689
|
+
}, {
|
|
33690
|
+
type: "a",
|
|
33691
|
+
rx: cornerRadius,
|
|
33692
|
+
ry: cornerRadius,
|
|
33693
|
+
xAxisRotation: 0,
|
|
33694
|
+
dx: incoming[0] * cornerRadius + outgoing[0] * cornerRadius,
|
|
33695
|
+
dy: incoming[1] * cornerRadius + outgoing[1] * cornerRadius,
|
|
33696
|
+
largeArcFlag: false,
|
|
33697
|
+
sweepFlag: true
|
|
33698
|
+
});
|
|
33699
|
+
}
|
|
33700
|
+
if (firstPoint.round) {
|
|
33701
|
+
const previous = uniquePoints[uniquePoints.length - 1].point;
|
|
33702
|
+
const incoming = unitDir2(previous, firstPoint.point);
|
|
33703
|
+
instructions.push({
|
|
33704
|
+
type: "L",
|
|
33705
|
+
x: firstPoint.point[0] - incoming[0] * cornerRadius,
|
|
33706
|
+
y: firstPoint.point[1] - incoming[1] * cornerRadius
|
|
33707
|
+
}, {
|
|
33708
|
+
type: "a",
|
|
33709
|
+
rx: cornerRadius,
|
|
33710
|
+
ry: cornerRadius,
|
|
33711
|
+
xAxisRotation: 0,
|
|
33712
|
+
dx: incoming[0] * cornerRadius + startDir[0] * cornerRadius,
|
|
33713
|
+
dy: incoming[1] * cornerRadius + startDir[1] * cornerRadius,
|
|
33714
|
+
largeArcFlag: false,
|
|
33715
|
+
sweepFlag: true
|
|
33716
|
+
});
|
|
33717
|
+
}
|
|
33718
|
+
instructions.push({ type: "Z" });
|
|
33719
|
+
return instructions;
|
|
33720
|
+
};
|
|
33721
|
+
var makeCallout = ({
|
|
33722
|
+
width = 500,
|
|
33723
|
+
height = 200,
|
|
33724
|
+
pointerLength = 40,
|
|
33725
|
+
pointerBaseWidth = 60,
|
|
33726
|
+
pointerPosition = 0.5,
|
|
33727
|
+
pointerDirection = "down",
|
|
33728
|
+
edgeRoundness = null,
|
|
33729
|
+
cornerRadius = 0
|
|
33269
33730
|
}) => {
|
|
33270
|
-
|
|
33271
|
-
|
|
33272
|
-
|
|
33273
|
-
|
|
33274
|
-
|
|
33731
|
+
ensurePositive("width", width);
|
|
33732
|
+
ensurePositive("height", height);
|
|
33733
|
+
ensurePositive("pointerLength", pointerLength);
|
|
33734
|
+
ensurePositive("pointerBaseWidth", pointerBaseWidth);
|
|
33735
|
+
if (typeof pointerPosition !== "number" || pointerPosition < 0 || pointerPosition > 1) {
|
|
33736
|
+
throw new Error(`"pointerPosition" must be a number between 0 and 1, got ${pointerPosition}`);
|
|
33737
|
+
}
|
|
33738
|
+
const horizontalInterval = pointerInterval({
|
|
33739
|
+
availableLength: width,
|
|
33740
|
+
pointerBaseWidth,
|
|
33741
|
+
pointerPosition
|
|
33742
|
+
});
|
|
33743
|
+
const verticalInterval = pointerInterval({
|
|
33744
|
+
availableLength: height,
|
|
33745
|
+
pointerBaseWidth,
|
|
33746
|
+
pointerPosition
|
|
33747
|
+
});
|
|
33748
|
+
const pointsByDirection = {
|
|
33749
|
+
up: [
|
|
33750
|
+
{ point: [0, pointerLength], round: true },
|
|
33751
|
+
{ point: [horizontalInterval.start, pointerLength], round: false },
|
|
33752
|
+
{ point: [horizontalInterval.center, 0], round: false },
|
|
33753
|
+
{ point: [horizontalInterval.end, pointerLength], round: false },
|
|
33754
|
+
{ point: [width, pointerLength], round: true },
|
|
33755
|
+
{ point: [width, height + pointerLength], round: true },
|
|
33756
|
+
{ point: [0, height + pointerLength], round: true },
|
|
33757
|
+
{ point: [0, pointerLength], round: true }
|
|
33758
|
+
],
|
|
33759
|
+
down: [
|
|
33760
|
+
{ point: [0, 0], round: true },
|
|
33761
|
+
{ point: [width, 0], round: true },
|
|
33762
|
+
{ point: [width, height], round: true },
|
|
33763
|
+
{ point: [horizontalInterval.end, height], round: false },
|
|
33764
|
+
{
|
|
33765
|
+
point: [horizontalInterval.center, height + pointerLength],
|
|
33766
|
+
round: false
|
|
33767
|
+
},
|
|
33768
|
+
{ point: [horizontalInterval.start, height], round: false },
|
|
33769
|
+
{ point: [0, height], round: true },
|
|
33770
|
+
{ point: [0, 0], round: true }
|
|
33771
|
+
],
|
|
33772
|
+
left: [
|
|
33773
|
+
{ point: [pointerLength, 0], round: true },
|
|
33774
|
+
{ point: [width + pointerLength, 0], round: true },
|
|
33775
|
+
{ point: [width + pointerLength, height], round: true },
|
|
33776
|
+
{ point: [pointerLength, height], round: true },
|
|
33777
|
+
{ point: [pointerLength, verticalInterval.end], round: false },
|
|
33778
|
+
{ point: [0, verticalInterval.center], round: false },
|
|
33779
|
+
{ point: [pointerLength, verticalInterval.start], round: false },
|
|
33780
|
+
{ point: [pointerLength, 0], round: true }
|
|
33781
|
+
],
|
|
33782
|
+
right: [
|
|
33783
|
+
{ point: [0, 0], round: true },
|
|
33784
|
+
{ point: [width, 0], round: true },
|
|
33785
|
+
{ point: [width, verticalInterval.start], round: false },
|
|
33786
|
+
{ point: [width + pointerLength, verticalInterval.center], round: false },
|
|
33787
|
+
{ point: [width, verticalInterval.end], round: false },
|
|
33788
|
+
{ point: [width, height], round: true },
|
|
33789
|
+
{ point: [0, height], round: true },
|
|
33790
|
+
{ point: [0, 0], round: true }
|
|
33791
|
+
]
|
|
33275
33792
|
};
|
|
33276
|
-
|
|
33277
|
-
|
|
33793
|
+
const points = normalizeClosedPoints(pointsByDirection[pointerDirection]);
|
|
33794
|
+
const instructions = makeInstructions2({ points, edgeRoundness, cornerRadius });
|
|
33795
|
+
const path = serializeInstructions(instructions);
|
|
33796
|
+
const shapeWidth = pointerDirection === "left" || pointerDirection === "right" ? width + pointerLength : width;
|
|
33797
|
+
const shapeHeight = pointerDirection === "up" || pointerDirection === "down" ? height + pointerLength : height;
|
|
33798
|
+
const bodyX = pointerDirection === "left" ? pointerLength : 0;
|
|
33799
|
+
const bodyY = pointerDirection === "up" ? pointerLength : 0;
|
|
33278
33800
|
return {
|
|
33279
|
-
|
|
33280
|
-
|
|
33281
|
-
|
|
33282
|
-
|
|
33283
|
-
|
|
33284
|
-
description: "Fill"
|
|
33285
|
-
}),
|
|
33286
|
-
...Internals.sequenceVisualStyleSchema,
|
|
33287
|
-
hidden: Internals.sequenceSchema.hidden
|
|
33801
|
+
width: shapeWidth,
|
|
33802
|
+
height: shapeHeight,
|
|
33803
|
+
instructions,
|
|
33804
|
+
path,
|
|
33805
|
+
transformOrigin: `${bodyX + width / 2} ${bodyY + height / 2}`
|
|
33288
33806
|
};
|
|
33289
33807
|
};
|
|
33290
|
-
var
|
|
33291
|
-
|
|
33292
|
-
defaultValue:
|
|
33293
|
-
description: "
|
|
33294
|
-
min:
|
|
33808
|
+
var calloutSchema = makeShapeSchema({
|
|
33809
|
+
width: numberField({
|
|
33810
|
+
defaultValue: 500,
|
|
33811
|
+
description: "Width",
|
|
33812
|
+
min: 1
|
|
33295
33813
|
}),
|
|
33296
|
-
|
|
33297
|
-
defaultValue:
|
|
33298
|
-
description: "
|
|
33299
|
-
min:
|
|
33814
|
+
height: numberField({
|
|
33815
|
+
defaultValue: 200,
|
|
33816
|
+
description: "Height",
|
|
33817
|
+
min: 1
|
|
33300
33818
|
}),
|
|
33301
|
-
|
|
33302
|
-
defaultValue:
|
|
33303
|
-
description: "
|
|
33304
|
-
min:
|
|
33819
|
+
pointerLength: numberField({
|
|
33820
|
+
defaultValue: 40,
|
|
33821
|
+
description: "Pointer Length",
|
|
33822
|
+
min: 1
|
|
33305
33823
|
}),
|
|
33306
|
-
|
|
33307
|
-
defaultValue:
|
|
33308
|
-
description: "
|
|
33309
|
-
min:
|
|
33824
|
+
pointerBaseWidth: numberField({
|
|
33825
|
+
defaultValue: 60,
|
|
33826
|
+
description: "Pointer Base Width",
|
|
33827
|
+
min: 1
|
|
33310
33828
|
}),
|
|
33311
|
-
|
|
33312
|
-
defaultValue:
|
|
33313
|
-
description: "
|
|
33314
|
-
|
|
33829
|
+
pointerPosition: numberField({
|
|
33830
|
+
defaultValue: 0.5,
|
|
33831
|
+
description: "Pointer Position",
|
|
33832
|
+
min: 0,
|
|
33833
|
+
max: 1,
|
|
33834
|
+
step: 0.01
|
|
33835
|
+
}),
|
|
33836
|
+
pointerDirection: enumField({
|
|
33837
|
+
defaultValue: "down",
|
|
33838
|
+
description: "Pointer Direction",
|
|
33839
|
+
variants: ["up", "down", "left", "right"]
|
|
33315
33840
|
}),
|
|
33316
33841
|
cornerRadius: numberField({
|
|
33317
33842
|
defaultValue: 0,
|
|
@@ -33319,35 +33844,40 @@ var arrowSchema = makeShapeSchema({
|
|
|
33319
33844
|
min: 0
|
|
33320
33845
|
})
|
|
33321
33846
|
});
|
|
33322
|
-
var
|
|
33323
|
-
|
|
33324
|
-
|
|
33325
|
-
|
|
33326
|
-
|
|
33327
|
-
|
|
33847
|
+
var CalloutInner = ({
|
|
33848
|
+
width,
|
|
33849
|
+
height,
|
|
33850
|
+
pointerLength,
|
|
33851
|
+
pointerBaseWidth,
|
|
33852
|
+
pointerPosition,
|
|
33853
|
+
pointerDirection,
|
|
33854
|
+
edgeRoundness,
|
|
33328
33855
|
cornerRadius,
|
|
33329
33856
|
...props
|
|
33330
33857
|
}) => {
|
|
33331
|
-
return /* @__PURE__ */
|
|
33332
|
-
defaultName: "<
|
|
33333
|
-
documentationLink: "https://www.remotion.dev/docs/shapes/
|
|
33334
|
-
...
|
|
33335
|
-
|
|
33336
|
-
|
|
33337
|
-
|
|
33338
|
-
|
|
33339
|
-
|
|
33858
|
+
return /* @__PURE__ */ jsx310(RenderSvg, {
|
|
33859
|
+
defaultName: "<Callout>",
|
|
33860
|
+
documentationLink: "https://www.remotion.dev/docs/shapes/callout",
|
|
33861
|
+
...makeCallout({
|
|
33862
|
+
width,
|
|
33863
|
+
height,
|
|
33864
|
+
pointerLength,
|
|
33865
|
+
pointerBaseWidth,
|
|
33866
|
+
pointerPosition,
|
|
33867
|
+
pointerDirection,
|
|
33868
|
+
edgeRoundness,
|
|
33340
33869
|
cornerRadius
|
|
33341
33870
|
}),
|
|
33342
33871
|
...props
|
|
33343
33872
|
});
|
|
33344
33873
|
};
|
|
33345
|
-
var
|
|
33346
|
-
Component:
|
|
33347
|
-
|
|
33874
|
+
var Callout = Internals.wrapInSchema({
|
|
33875
|
+
Component: CalloutInner,
|
|
33876
|
+
componentIdentity: "dev.remotion.shapes.Callout",
|
|
33877
|
+
schema: calloutSchema,
|
|
33348
33878
|
supportsEffects: true
|
|
33349
33879
|
});
|
|
33350
|
-
Internals.addSequenceStackTraces(
|
|
33880
|
+
Internals.addSequenceStackTraces(Callout);
|
|
33351
33881
|
var makeCircle = ({ radius }) => {
|
|
33352
33882
|
const instructions = [
|
|
33353
33883
|
{
|
|
@@ -33396,7 +33926,7 @@ var circleSchema = makeShapeSchema({
|
|
|
33396
33926
|
})
|
|
33397
33927
|
});
|
|
33398
33928
|
var CircleInner = ({ radius, ...props }) => {
|
|
33399
|
-
return /* @__PURE__ */
|
|
33929
|
+
return /* @__PURE__ */ jsx42(RenderSvg, {
|
|
33400
33930
|
defaultName: "<Circle>",
|
|
33401
33931
|
documentationLink: "https://www.remotion.dev/docs/shapes/circle",
|
|
33402
33932
|
...makeCircle({ radius }),
|
|
@@ -33405,6 +33935,7 @@ var CircleInner = ({ radius, ...props }) => {
|
|
|
33405
33935
|
};
|
|
33406
33936
|
var Circle = Internals.wrapInSchema({
|
|
33407
33937
|
Component: CircleInner,
|
|
33938
|
+
componentIdentity: "dev.remotion.shapes.Circle",
|
|
33408
33939
|
schema: circleSchema,
|
|
33409
33940
|
supportsEffects: true
|
|
33410
33941
|
});
|
|
@@ -33452,7 +33983,7 @@ var ellipseSchema = makeShapeSchema({
|
|
|
33452
33983
|
})
|
|
33453
33984
|
});
|
|
33454
33985
|
var EllipseInner = ({ rx, ry, ...props }) => {
|
|
33455
|
-
return /* @__PURE__ */
|
|
33986
|
+
return /* @__PURE__ */ jsx52(RenderSvg, {
|
|
33456
33987
|
defaultName: "<Ellipse>",
|
|
33457
33988
|
documentationLink: "https://www.remotion.dev/docs/shapes/ellipse",
|
|
33458
33989
|
...makeEllipse({ rx, ry }),
|
|
@@ -33461,6 +33992,7 @@ var EllipseInner = ({ rx, ry, ...props }) => {
|
|
|
33461
33992
|
};
|
|
33462
33993
|
var Ellipse = Internals.wrapInSchema({
|
|
33463
33994
|
Component: EllipseInner,
|
|
33995
|
+
componentIdentity: "dev.remotion.shapes.Ellipse",
|
|
33464
33996
|
schema: ellipseSchema,
|
|
33465
33997
|
supportsEffects: true
|
|
33466
33998
|
});
|
|
@@ -33584,7 +34116,7 @@ var HeartInner = ({
|
|
|
33584
34116
|
depthAdjustment = 0,
|
|
33585
34117
|
...props
|
|
33586
34118
|
}) => {
|
|
33587
|
-
return /* @__PURE__ */
|
|
34119
|
+
return /* @__PURE__ */ jsx62(RenderSvg, {
|
|
33588
34120
|
defaultName: "<Heart>",
|
|
33589
34121
|
documentationLink: "https://www.remotion.dev/docs/shapes/heart",
|
|
33590
34122
|
...makeHeart({
|
|
@@ -33598,6 +34130,7 @@ var HeartInner = ({
|
|
|
33598
34130
|
};
|
|
33599
34131
|
var Heart = Internals.wrapInSchema({
|
|
33600
34132
|
Component: HeartInner,
|
|
34133
|
+
componentIdentity: "dev.remotion.shapes.Heart",
|
|
33601
34134
|
schema: heartSchema,
|
|
33602
34135
|
supportsEffects: true
|
|
33603
34136
|
});
|
|
@@ -33742,7 +34275,7 @@ var PieInner = ({
|
|
|
33742
34275
|
rotation,
|
|
33743
34276
|
...props
|
|
33744
34277
|
}) => {
|
|
33745
|
-
return /* @__PURE__ */
|
|
34278
|
+
return /* @__PURE__ */ jsx72(RenderSvg, {
|
|
33746
34279
|
defaultName: "<Pie>",
|
|
33747
34280
|
documentationLink: "https://www.remotion.dev/docs/shapes/pie",
|
|
33748
34281
|
...makePie({ radius, progress, closePath, counterClockwise, rotation }),
|
|
@@ -33751,134 +34284,11 @@ var PieInner = ({
|
|
|
33751
34284
|
};
|
|
33752
34285
|
var Pie = Internals.wrapInSchema({
|
|
33753
34286
|
Component: PieInner,
|
|
34287
|
+
componentIdentity: "dev.remotion.shapes.Pie",
|
|
33754
34288
|
schema: pieSchema,
|
|
33755
34289
|
supportsEffects: true
|
|
33756
34290
|
});
|
|
33757
34291
|
Internals.addSequenceStackTraces(Pie);
|
|
33758
|
-
var shortenVector = (vector, radius) => {
|
|
33759
|
-
const [x, y] = vector;
|
|
33760
|
-
const currentLength = Math.sqrt(x * x + y * y);
|
|
33761
|
-
const scalingFactor = (currentLength - radius) / currentLength;
|
|
33762
|
-
return [x * scalingFactor, y * scalingFactor];
|
|
33763
|
-
};
|
|
33764
|
-
var scaleVectorToLength = (vector, length2) => {
|
|
33765
|
-
const [x, y] = vector;
|
|
33766
|
-
const currentLength = Math.sqrt(x * x + y * y);
|
|
33767
|
-
const scalingFactor = length2 / currentLength;
|
|
33768
|
-
return [x * scalingFactor, y * scalingFactor];
|
|
33769
|
-
};
|
|
33770
|
-
var joinPoints = (points, {
|
|
33771
|
-
edgeRoundness,
|
|
33772
|
-
cornerRadius,
|
|
33773
|
-
roundCornerStrategy
|
|
33774
|
-
}) => {
|
|
33775
|
-
return points.map(([x, y], i) => {
|
|
33776
|
-
const prevPointIndex = i === 0 ? points.length - 2 : i - 1;
|
|
33777
|
-
const prevPoint = points[prevPointIndex];
|
|
33778
|
-
const nextPointIndex = i === points.length - 1 ? 1 : i + 1;
|
|
33779
|
-
const nextPoint = points[nextPointIndex];
|
|
33780
|
-
const middleOfLine = [(x + nextPoint[0]) / 2, (y + nextPoint[1]) / 2];
|
|
33781
|
-
const prevPointMiddleOfLine = [
|
|
33782
|
-
(x + prevPoint[0]) / 2,
|
|
33783
|
-
(y + prevPoint[1]) / 2
|
|
33784
|
-
];
|
|
33785
|
-
const prevVector = [x - prevPoint[0], y - prevPoint[1]];
|
|
33786
|
-
const nextVector = [nextPoint[0] - x, nextPoint[1] - y];
|
|
33787
|
-
if (i === 0) {
|
|
33788
|
-
if (edgeRoundness !== null) {
|
|
33789
|
-
return [
|
|
33790
|
-
{
|
|
33791
|
-
type: "M",
|
|
33792
|
-
x: middleOfLine[0],
|
|
33793
|
-
y: middleOfLine[1]
|
|
33794
|
-
}
|
|
33795
|
-
];
|
|
33796
|
-
}
|
|
33797
|
-
if (cornerRadius !== 0) {
|
|
33798
|
-
const computeRadius = shortenVector(nextVector, cornerRadius);
|
|
33799
|
-
return [
|
|
33800
|
-
{
|
|
33801
|
-
type: "M",
|
|
33802
|
-
x: computeRadius[0] + x,
|
|
33803
|
-
y: computeRadius[1] + y
|
|
33804
|
-
}
|
|
33805
|
-
];
|
|
33806
|
-
}
|
|
33807
|
-
return [
|
|
33808
|
-
{
|
|
33809
|
-
type: "M",
|
|
33810
|
-
x,
|
|
33811
|
-
y
|
|
33812
|
-
}
|
|
33813
|
-
];
|
|
33814
|
-
}
|
|
33815
|
-
if (cornerRadius && edgeRoundness !== null) {
|
|
33816
|
-
throw new Error(`"cornerRadius" and "edgeRoundness" cannot be specified at the same time.`);
|
|
33817
|
-
}
|
|
33818
|
-
if (edgeRoundness === null) {
|
|
33819
|
-
if (cornerRadius === 0) {
|
|
33820
|
-
return [
|
|
33821
|
-
{
|
|
33822
|
-
type: "L",
|
|
33823
|
-
x,
|
|
33824
|
-
y
|
|
33825
|
-
}
|
|
33826
|
-
];
|
|
33827
|
-
}
|
|
33828
|
-
const prevVectorMinusRadius = shortenVector(prevVector, cornerRadius);
|
|
33829
|
-
const prevVectorLength = scaleVectorToLength(prevVector, cornerRadius);
|
|
33830
|
-
const nextVectorMinusRadius = scaleVectorToLength(nextVector, cornerRadius);
|
|
33831
|
-
const firstDraw = [
|
|
33832
|
-
prevPoint[0] + prevVectorMinusRadius[0],
|
|
33833
|
-
prevPoint[1] + prevVectorMinusRadius[1]
|
|
33834
|
-
];
|
|
33835
|
-
return [
|
|
33836
|
-
{
|
|
33837
|
-
type: "L",
|
|
33838
|
-
x: firstDraw[0],
|
|
33839
|
-
y: firstDraw[1]
|
|
33840
|
-
},
|
|
33841
|
-
roundCornerStrategy === "arc" ? {
|
|
33842
|
-
type: "a",
|
|
33843
|
-
rx: cornerRadius,
|
|
33844
|
-
ry: cornerRadius,
|
|
33845
|
-
xAxisRotation: 0,
|
|
33846
|
-
dx: prevVectorLength[0] + nextVectorMinusRadius[0],
|
|
33847
|
-
dy: prevVectorLength[1] + nextVectorMinusRadius[1],
|
|
33848
|
-
largeArcFlag: false,
|
|
33849
|
-
sweepFlag: true
|
|
33850
|
-
} : {
|
|
33851
|
-
type: "C",
|
|
33852
|
-
x: firstDraw[0] + prevVectorLength[0] + nextVectorMinusRadius[0],
|
|
33853
|
-
y: firstDraw[1] + prevVectorLength[1] + nextVectorMinusRadius[1],
|
|
33854
|
-
cp1x: x,
|
|
33855
|
-
cp1y: y,
|
|
33856
|
-
cp2x: x,
|
|
33857
|
-
cp2y: y
|
|
33858
|
-
}
|
|
33859
|
-
];
|
|
33860
|
-
}
|
|
33861
|
-
const controlPoint1 = [
|
|
33862
|
-
prevPointMiddleOfLine[0] + prevVector[0] * edgeRoundness * 0.5,
|
|
33863
|
-
prevPointMiddleOfLine[1] + prevVector[1] * edgeRoundness * 0.5
|
|
33864
|
-
];
|
|
33865
|
-
const controlPoint2 = [
|
|
33866
|
-
middleOfLine[0] - nextVector[0] * edgeRoundness * 0.5,
|
|
33867
|
-
middleOfLine[1] - nextVector[1] * edgeRoundness * 0.5
|
|
33868
|
-
];
|
|
33869
|
-
return [
|
|
33870
|
-
{
|
|
33871
|
-
type: "C",
|
|
33872
|
-
cp1x: controlPoint1[0],
|
|
33873
|
-
cp1y: controlPoint1[1],
|
|
33874
|
-
cp2x: controlPoint2[0],
|
|
33875
|
-
cp2y: controlPoint2[1],
|
|
33876
|
-
x: middleOfLine[0],
|
|
33877
|
-
y: middleOfLine[1]
|
|
33878
|
-
}
|
|
33879
|
-
];
|
|
33880
|
-
}).flat(1);
|
|
33881
|
-
};
|
|
33882
34292
|
function polygon({
|
|
33883
34293
|
points,
|
|
33884
34294
|
radius,
|
|
@@ -33959,7 +34369,7 @@ var PolygonInner = ({
|
|
|
33959
34369
|
edgeRoundness,
|
|
33960
34370
|
...props
|
|
33961
34371
|
}) => {
|
|
33962
|
-
return /* @__PURE__ */
|
|
34372
|
+
return /* @__PURE__ */ jsx82(RenderSvg, {
|
|
33963
34373
|
defaultName: "<Polygon>",
|
|
33964
34374
|
documentationLink: "https://www.remotion.dev/docs/shapes/polygon",
|
|
33965
34375
|
...makePolygon({
|
|
@@ -33973,6 +34383,7 @@ var PolygonInner = ({
|
|
|
33973
34383
|
};
|
|
33974
34384
|
var Polygon = Internals.wrapInSchema({
|
|
33975
34385
|
Component: PolygonInner,
|
|
34386
|
+
componentIdentity: "dev.remotion.shapes.Polygon",
|
|
33976
34387
|
schema: polygonSchema,
|
|
33977
34388
|
supportsEffects: true
|
|
33978
34389
|
});
|
|
@@ -34029,7 +34440,7 @@ var RectInner = ({
|
|
|
34029
34440
|
cornerRadius,
|
|
34030
34441
|
...props
|
|
34031
34442
|
}) => {
|
|
34032
|
-
return /* @__PURE__ */
|
|
34443
|
+
return /* @__PURE__ */ jsx92(RenderSvg, {
|
|
34033
34444
|
defaultName: "<Rect>",
|
|
34034
34445
|
documentationLink: "https://www.remotion.dev/docs/shapes/rect",
|
|
34035
34446
|
...makeRect({ height, width, edgeRoundness, cornerRadius }),
|
|
@@ -34038,6 +34449,7 @@ var RectInner = ({
|
|
|
34038
34449
|
};
|
|
34039
34450
|
var Rect = Internals.wrapInSchema({
|
|
34040
34451
|
Component: RectInner,
|
|
34452
|
+
componentIdentity: "dev.remotion.shapes.Rect",
|
|
34041
34453
|
schema: rectSchema,
|
|
34042
34454
|
supportsEffects: true
|
|
34043
34455
|
});
|
|
@@ -34132,7 +34544,7 @@ var StarInner = ({
|
|
|
34132
34544
|
edgeRoundness,
|
|
34133
34545
|
...props
|
|
34134
34546
|
}) => {
|
|
34135
|
-
return /* @__PURE__ */
|
|
34547
|
+
return /* @__PURE__ */ jsx102(RenderSvg, {
|
|
34136
34548
|
defaultName: "<Star>",
|
|
34137
34549
|
documentationLink: "https://www.remotion.dev/docs/shapes/star",
|
|
34138
34550
|
...makeStar({
|
|
@@ -34147,6 +34559,7 @@ var StarInner = ({
|
|
|
34147
34559
|
};
|
|
34148
34560
|
var Star = Internals.wrapInSchema({
|
|
34149
34561
|
Component: StarInner,
|
|
34562
|
+
componentIdentity: "dev.remotion.shapes.Star",
|
|
34150
34563
|
schema: starSchema,
|
|
34151
34564
|
supportsEffects: true
|
|
34152
34565
|
});
|
|
@@ -34243,7 +34656,7 @@ var TriangleInner = ({
|
|
|
34243
34656
|
cornerRadius,
|
|
34244
34657
|
...props
|
|
34245
34658
|
}) => {
|
|
34246
|
-
return /* @__PURE__ */
|
|
34659
|
+
return /* @__PURE__ */ jsx112(RenderSvg, {
|
|
34247
34660
|
defaultName: "<Triangle>",
|
|
34248
34661
|
documentationLink: "https://www.remotion.dev/docs/shapes/triangle",
|
|
34249
34662
|
...makeTriangle({ length: length2, direction, edgeRoundness, cornerRadius }),
|
|
@@ -34252,6 +34665,7 @@ var TriangleInner = ({
|
|
|
34252
34665
|
};
|
|
34253
34666
|
var Triangle = Internals.wrapInSchema({
|
|
34254
34667
|
Component: TriangleInner,
|
|
34668
|
+
componentIdentity: "dev.remotion.shapes.Triangle",
|
|
34255
34669
|
schema: triangleSchema,
|
|
34256
34670
|
supportsEffects: true
|
|
34257
34671
|
});
|
|
@@ -35332,7 +35746,7 @@ import { jsx as jsx83, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
|
35332
35746
|
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
35333
35747
|
import React72 from "react";
|
|
35334
35748
|
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
35335
|
-
import { jsx as
|
|
35749
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
35336
35750
|
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
35337
35751
|
import * as React36 from "react";
|
|
35338
35752
|
import * as ReactDOM4 from "react-dom";
|
|
@@ -35892,7 +36306,7 @@ var Button = ({
|
|
|
35892
36306
|
const [dimensions, setDimensions] = useState22(null);
|
|
35893
36307
|
const ref = useRef210(null);
|
|
35894
36308
|
const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
|
|
35895
|
-
const onPointerEnter =
|
|
36309
|
+
const onPointerEnter = useCallback27((e) => {
|
|
35896
36310
|
if (e.pointerType !== "mouse") {
|
|
35897
36311
|
return;
|
|
35898
36312
|
}
|
|
@@ -35929,7 +36343,7 @@ var Button = ({
|
|
|
35929
36343
|
const isDisabled = disabled || loading;
|
|
35930
36344
|
const isAnchor = !asChild && "href" in rest && rest.href !== undefined;
|
|
35931
36345
|
const sharedClasses = cn("text-text", "inline-flex", "justify-center", "bg-button-bg", "items-center", "font-brand", "border-solid", "text-[1em]", "rounded-lg", "border-black", "border-2", "border-b-4", "cursor-pointer", "px-4", "h-12", "flex-row", "items-center", "relative", "overflow-hidden", isDisabled && "cursor-default opacity-50", className);
|
|
35932
|
-
const preventInteraction =
|
|
36346
|
+
const preventInteraction = useCallback27((e) => {
|
|
35933
36347
|
e.preventDefault();
|
|
35934
36348
|
e.stopPropagation();
|
|
35935
36349
|
}, []);
|
|
@@ -36140,7 +36554,7 @@ var Link = ({
|
|
|
36140
36554
|
className,
|
|
36141
36555
|
...props
|
|
36142
36556
|
}) => {
|
|
36143
|
-
return /* @__PURE__ */
|
|
36557
|
+
return /* @__PURE__ */ jsx113("a", {
|
|
36144
36558
|
...props,
|
|
36145
36559
|
className: cn(className, "text-brand underline underline-offset-4"),
|
|
36146
36560
|
children: props.children
|
|
@@ -42023,7 +42437,7 @@ var Triangle22 = (props) => {
|
|
|
42023
42437
|
};
|
|
42024
42438
|
|
|
42025
42439
|
// src/components/prompts/PromptsSubmit.tsx
|
|
42026
|
-
import { useCallback as
|
|
42440
|
+
import { useCallback as useCallback40, useEffect as useEffect47, useRef as useRef50, useState as useState45 } from "react";
|
|
42027
42441
|
|
|
42028
42442
|
// src/components/prompts/config.ts
|
|
42029
42443
|
var REMOTION_PRO_ORIGIN = "https://www.remotion.pro";
|
|
@@ -44499,10 +44913,10 @@ import"react-dom";
|
|
|
44499
44913
|
"use client";
|
|
44500
44914
|
|
|
44501
44915
|
// src/components/prompts/MuxPlayer.tsx
|
|
44502
|
-
import { useCallback as
|
|
44916
|
+
import { useCallback as useCallback39 } from "react";
|
|
44503
44917
|
import { jsx as jsx45, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
44504
44918
|
var MuxPlayer = ({ playbackId, title, rounded = true }) => {
|
|
44505
|
-
const onProviderChange =
|
|
44919
|
+
const onProviderChange = useCallback39((provider2, _e) => {
|
|
44506
44920
|
if (isHLSProvider(provider2)) {
|
|
44507
44921
|
provider2.library = () => import("hls.js");
|
|
44508
44922
|
}
|
|
@@ -44599,7 +45013,7 @@ var PromptsSubmitPage = () => {
|
|
|
44599
45013
|
};
|
|
44600
45014
|
}, []);
|
|
44601
45015
|
const fileInputRef = useRef50(null);
|
|
44602
|
-
const startUpload =
|
|
45016
|
+
const startUpload = useCallback40(async (file) => {
|
|
44603
45017
|
setUploadState({ type: "uploading", progress: 0 });
|
|
44604
45018
|
try {
|
|
44605
45019
|
const res = await fetch(`${REMOTION_PRO_ORIGIN}/api/prompts/upload`, {
|
|
@@ -44648,13 +45062,13 @@ var PromptsSubmitPage = () => {
|
|
|
44648
45062
|
});
|
|
44649
45063
|
}
|
|
44650
45064
|
}, []);
|
|
44651
|
-
const onFileSelect =
|
|
45065
|
+
const onFileSelect = useCallback40((e2) => {
|
|
44652
45066
|
const file = e2.target.files?.[0];
|
|
44653
45067
|
if (!file)
|
|
44654
45068
|
return;
|
|
44655
45069
|
startUpload(file);
|
|
44656
45070
|
}, [startUpload]);
|
|
44657
|
-
const onDrop =
|
|
45071
|
+
const onDrop = useCallback40((e2) => {
|
|
44658
45072
|
e2.preventDefault();
|
|
44659
45073
|
setIsDragging(false);
|
|
44660
45074
|
if (uploadState.type !== "idle")
|
|
@@ -44666,21 +45080,21 @@ var PromptsSubmitPage = () => {
|
|
|
44666
45080
|
return;
|
|
44667
45081
|
startUpload(file);
|
|
44668
45082
|
}, [startUpload, uploadState.type]);
|
|
44669
|
-
const onDragOver =
|
|
45083
|
+
const onDragOver = useCallback40((e2) => {
|
|
44670
45084
|
e2.preventDefault();
|
|
44671
45085
|
}, []);
|
|
44672
|
-
const onDragEnter =
|
|
45086
|
+
const onDragEnter = useCallback40(() => {
|
|
44673
45087
|
if (uploadState.type === "idle") {
|
|
44674
45088
|
setIsDragging(true);
|
|
44675
45089
|
}
|
|
44676
45090
|
}, [uploadState.type]);
|
|
44677
|
-
const onDragLeave =
|
|
45091
|
+
const onDragLeave = useCallback40((e2) => {
|
|
44678
45092
|
if (e2.currentTarget === e2.target) {
|
|
44679
45093
|
setIsDragging(false);
|
|
44680
45094
|
}
|
|
44681
45095
|
}, []);
|
|
44682
45096
|
const submitPossible = title.length > 0 && title.length <= 80 && prompt.length > 0 && usernameType && username.length > 0 && uploadState.type === "ready" && (submitStatus.type === "idle" || submitStatus.type === "error");
|
|
44683
|
-
const submit =
|
|
45097
|
+
const submit = useCallback40(async () => {
|
|
44684
45098
|
if (!submitPossible || uploadState.type !== "ready")
|
|
44685
45099
|
return;
|
|
44686
45100
|
setSubmitStatus({ type: "submitting" });
|