@remotion/promo-pages 4.0.470 → 4.0.472
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 +2682 -1556
- package/dist/design.js +1443 -887
- package/dist/experts.js +1270 -714
- package/dist/homepage/Pricing.js +1443 -887
- package/dist/prompts/PromptsGallery.js +1447 -891
- package/dist/prompts/PromptsShow.js +1233 -677
- package/dist/prompts/PromptsSubmit.js +1234 -678
- package/dist/tailwind.css +235 -29
- package/dist/team.js +1444 -888
- package/dist/template-modal-content.js +1449 -893
- package/dist/templates.js +1443 -887
- package/package.json +13 -13
- package/dist/cn.d.ts +0 -2
- package/dist/cn.js +0 -5
- package/dist/components/3DEngine/ButtonDemo.d.ts +0 -2
- package/dist/components/3DEngine/ButtonDemo.js +0 -43
- package/dist/components/3DEngine/Faces.d.ts +0 -5
- package/dist/components/3DEngine/Faces.js +0 -7
- package/dist/components/3DEngine/Outer.d.ts +0 -8
- package/dist/components/3DEngine/Outer.js +0 -56
- package/dist/components/3DEngine/Switch.d.ts +0 -4
- package/dist/components/3DEngine/Switch.js +0 -4
- package/dist/components/3DEngine/get-child-node-from.d.ts +0 -1
- package/dist/components/3DEngine/get-child-node-from.js +0 -14
- package/dist/components/3DEngine/hover-transforms.d.ts +0 -9
- package/dist/components/3DEngine/hover-transforms.js +0 -177
- package/dist/components/BackButton.d.ts +0 -6
- package/dist/components/BackButton.js +0 -9
- package/dist/components/CommandCopyButton.d.ts +0 -5
- package/dist/components/CommandCopyButton.js +0 -4
- package/dist/components/Homepage.d.ts +0 -6
- package/dist/components/Homepage.js +0 -20
- package/dist/components/ManageTeamMembers.d.ts +0 -2
- package/dist/components/ManageTeamMembers.js +0 -42
- package/dist/components/Spinner.d.ts +0 -3
- package/dist/components/Spinner.js +0 -4
- package/dist/components/TeamPicture.d.ts +0 -1
- package/dist/components/TeamPicture.js +0 -4
- package/dist/components/design.d.ts +0 -1
- package/dist/components/design.js +0 -33
- package/dist/components/experts/ExpertsPage.d.ts +0 -11
- package/dist/components/experts/ExpertsPage.js +0 -50
- package/dist/components/experts/experts-data.d.ts +0 -19
- package/dist/components/experts/experts-data.js +0 -391
- package/dist/components/experts/experts-icons.d.ts +0 -8
- package/dist/components/experts/experts-icons.js +0 -42
- package/dist/components/experts.d.ts +0 -3
- package/dist/components/experts.js +0 -2
- package/dist/components/homepage/BackgroundAnimation.d.ts +0 -2
- package/dist/components/homepage/BackgroundAnimation.js +0 -66
- package/dist/components/homepage/ChooseTemplate.d.ts +0 -2
- package/dist/components/homepage/ChooseTemplate.js +0 -25
- package/dist/components/homepage/CommunityStats.d.ts +0 -3
- package/dist/components/homepage/CommunityStats.js +0 -6
- package/dist/components/homepage/CommunityStatsItems.d.ts +0 -7
- package/dist/components/homepage/CommunityStatsItems.js +0 -58
- package/dist/components/homepage/Demo/Card.d.ts +0 -15
- package/dist/components/homepage/Demo/Card.js +0 -174
- package/dist/components/homepage/Demo/Cards.d.ts +0 -15
- package/dist/components/homepage/Demo/Cards.js +0 -57
- package/dist/components/homepage/Demo/Comp.d.ts +0 -38
- package/dist/components/homepage/Demo/Comp.js +0 -72
- package/dist/components/homepage/Demo/CurrentCountry.d.ts +0 -9
- package/dist/components/homepage/Demo/CurrentCountry.js +0 -48
- package/dist/components/homepage/Demo/DemoError.d.ts +0 -2
- package/dist/components/homepage/Demo/DemoError.js +0 -10
- package/dist/components/homepage/Demo/DemoErrorIcon.d.ts +0 -2
- package/dist/components/homepage/Demo/DemoErrorIcon.js +0 -16
- package/dist/components/homepage/Demo/DemoRender.d.ts +0 -33
- package/dist/components/homepage/Demo/DemoRender.js +0 -107
- package/dist/components/homepage/Demo/DigitWheel.d.ts +0 -9
- package/dist/components/homepage/Demo/DigitWheel.js +0 -94
- package/dist/components/homepage/Demo/DisplayedEmoji.d.ts +0 -5
- package/dist/components/homepage/Demo/DisplayedEmoji.js +0 -59
- package/dist/components/homepage/Demo/DoneCheckmark.d.ts +0 -2
- package/dist/components/homepage/Demo/DoneCheckmark.js +0 -20
- package/dist/components/homepage/Demo/DownloadNudge.d.ts +0 -2
- package/dist/components/homepage/Demo/DownloadNudge.js +0 -27
- package/dist/components/homepage/Demo/DragAndDropNudge.d.ts +0 -3
- package/dist/components/homepage/Demo/DragAndDropNudge.js +0 -26
- package/dist/components/homepage/Demo/EmojiCard.d.ts +0 -10
- package/dist/components/homepage/Demo/EmojiCard.js +0 -120
- package/dist/components/homepage/Demo/Minus.d.ts +0 -5
- package/dist/components/homepage/Demo/Minus.js +0 -11
- package/dist/components/homepage/Demo/PlayPauseButton.d.ts +0 -5
- package/dist/components/homepage/Demo/PlayPauseButton.js +0 -47
- package/dist/components/homepage/Demo/PlayerControls.d.ts +0 -8
- package/dist/components/homepage/Demo/PlayerControls.js +0 -15
- package/dist/components/homepage/Demo/PlayerSeekBar.d.ts +0 -11
- package/dist/components/homepage/Demo/PlayerSeekBar.js +0 -216
- package/dist/components/homepage/Demo/PlayerVolume.d.ts +0 -5
- package/dist/components/homepage/Demo/PlayerVolume.js +0 -53
- package/dist/components/homepage/Demo/Progress.d.ts +0 -4
- package/dist/components/homepage/Demo/Progress.js +0 -14
- package/dist/components/homepage/Demo/Spinner.d.ts +0 -5
- package/dist/components/homepage/Demo/Spinner.js +0 -37
- package/dist/components/homepage/Demo/Switcher.d.ts +0 -6
- package/dist/components/homepage/Demo/Switcher.js +0 -25
- package/dist/components/homepage/Demo/Temperature.d.ts +0 -6
- package/dist/components/homepage/Demo/Temperature.js +0 -21
- package/dist/components/homepage/Demo/TemperatureNumber.d.ts +0 -5
- package/dist/components/homepage/Demo/TemperatureNumber.js +0 -36
- package/dist/components/homepage/Demo/ThemeNudge.d.ts +0 -3
- package/dist/components/homepage/Demo/ThemeNudge.js +0 -35
- package/dist/components/homepage/Demo/TimeDisplay.d.ts +0 -6
- package/dist/components/homepage/Demo/TimeDisplay.js +0 -27
- package/dist/components/homepage/Demo/TrendingRepos.d.ts +0 -6
- package/dist/components/homepage/Demo/TrendingRepos.js +0 -65
- package/dist/components/homepage/Demo/icons.d.ts +0 -10
- package/dist/components/homepage/Demo/icons.js +0 -22
- package/dist/components/homepage/Demo/index.d.ts +0 -2
- package/dist/components/homepage/Demo/index.js +0 -95
- package/dist/components/homepage/Demo/math.d.ts +0 -10
- package/dist/components/homepage/Demo/math.js +0 -29
- package/dist/components/homepage/Demo/types.d.ts +0 -6
- package/dist/components/homepage/Demo/types.js +0 -0
- package/dist/components/homepage/EditorStarterSection.d.ts +0 -3
- package/dist/components/homepage/EditorStarterSection.js +0 -8
- package/dist/components/homepage/EvaluateRemotion.d.ts +0 -3
- package/dist/components/homepage/EvaluateRemotion.js +0 -21
- package/dist/components/homepage/FreePricing.d.ts +0 -4
- package/dist/components/homepage/FreePricing.js +0 -133
- package/dist/components/homepage/GetStartedStrip.d.ts +0 -2
- package/dist/components/homepage/GetStartedStrip.js +0 -14
- package/dist/components/homepage/GitHubButton.d.ts +0 -2
- package/dist/components/homepage/GitHubButton.js +0 -7
- package/dist/components/homepage/IconForTemplate.d.ts +0 -6
- package/dist/components/homepage/IconForTemplate.js +0 -105
- package/dist/components/homepage/IfYouKnowReact.d.ts +0 -3
- package/dist/components/homepage/IfYouKnowReact.js +0 -23
- package/dist/components/homepage/MoreTemplatesButton.d.ts +0 -2
- package/dist/components/homepage/MoreTemplatesButton.js +0 -11
- package/dist/components/homepage/MuxVideo.d.ts +0 -7
- package/dist/components/homepage/MuxVideo.js +0 -45
- package/dist/components/homepage/NewsletterButton.d.ts +0 -2
- package/dist/components/homepage/NewsletterButton.js +0 -38
- package/dist/components/homepage/ParameterizeAndEdit.d.ts +0 -2
- package/dist/components/homepage/ParameterizeAndEdit.js +0 -22
- package/dist/components/homepage/Pricing.d.ts +0 -2
- package/dist/components/homepage/Pricing.js +0 -15
- package/dist/components/homepage/PricingBulletPoint.d.ts +0 -6
- package/dist/components/homepage/PricingBulletPoint.js +0 -19
- package/dist/components/homepage/RealMp4Videos.d.ts +0 -2
- package/dist/components/homepage/RealMp4Videos.js +0 -41
- package/dist/components/homepage/Spacer.d.ts +0 -2
- package/dist/components/homepage/Spacer.js +0 -4
- package/dist/components/homepage/TemplateIcon.d.ts +0 -5
- package/dist/components/homepage/TemplateIcon.js +0 -24
- package/dist/components/homepage/TextInput.d.ts +0 -7
- package/dist/components/homepage/TextInput.js +0 -34
- package/dist/components/homepage/TrustedByBanner.d.ts +0 -2
- package/dist/components/homepage/TrustedByBanner.js +0 -27
- package/dist/components/homepage/VideoApps.d.ts +0 -4
- package/dist/components/homepage/VideoApps.js +0 -72
- package/dist/components/homepage/VideoAppsShowcase.d.ts +0 -3
- package/dist/components/homepage/VideoAppsShowcase.js +0 -139
- package/dist/components/homepage/VideoAppsTitle.d.ts +0 -4
- package/dist/components/homepage/VideoAppsTitle.js +0 -4
- package/dist/components/homepage/VideoPlayerWithControls.d.ts +0 -20
- package/dist/components/homepage/VideoPlayerWithControls.js +0 -105
- package/dist/components/homepage/WriteInReact.d.ts +0 -2
- package/dist/components/homepage/WriteInReact.js +0 -10
- package/dist/components/homepage/YouAreHere.d.ts +0 -2
- package/dist/components/homepage/YouAreHere.js +0 -23
- package/dist/components/homepage/layout/Button.d.ts +0 -22
- package/dist/components/homepage/layout/Button.js +0 -30
- package/dist/components/homepage/layout/colors.d.ts +0 -13
- package/dist/components/homepage/layout/colors.js +0 -14
- package/dist/components/homepage/layout/use-color-mode.d.ts +0 -21
- package/dist/components/homepage/layout/use-color-mode.js +0 -22
- package/dist/components/homepage/layout/use-el-size.d.ts +0 -5
- package/dist/components/homepage/layout/use-el-size.js +0 -40
- package/dist/components/homepage/layout/use-mobile-layout.d.ts +0 -1
- package/dist/components/homepage/layout/use-mobile-layout.js +0 -6
- package/dist/components/icons/blank.d.ts +0 -3
- package/dist/components/icons/blank.js +0 -4
- package/dist/components/icons/brain.d.ts +0 -2
- package/dist/components/icons/brain.js +0 -4
- package/dist/components/icons/clone.d.ts +0 -2
- package/dist/components/icons/clone.js +0 -2
- package/dist/components/icons/code-hike.d.ts +0 -3
- package/dist/components/icons/code-hike.js +0 -4
- package/dist/components/icons/cubes.d.ts +0 -3
- package/dist/components/icons/cubes.js +0 -4
- package/dist/components/icons/editor.d.ts +0 -3
- package/dist/components/icons/editor.js +0 -4
- package/dist/components/icons/electron.d.ts +0 -4
- package/dist/components/icons/electron.js +0 -4
- package/dist/components/icons/js.d.ts +0 -3
- package/dist/components/icons/js.js +0 -4
- package/dist/components/icons/music.d.ts +0 -2
- package/dist/components/icons/music.js +0 -4
- package/dist/components/icons/next.d.ts +0 -4
- package/dist/components/icons/next.js +0 -4
- package/dist/components/icons/overlay.d.ts +0 -3
- package/dist/components/icons/overlay.js +0 -4
- package/dist/components/icons/prompt-to-video.d.ts +0 -2
- package/dist/components/icons/prompt-to-video.js +0 -4
- package/dist/components/icons/recorder.d.ts +0 -3
- package/dist/components/icons/recorder.js +0 -4
- package/dist/components/icons/remix.d.ts +0 -3
- package/dist/components/icons/remix.js +0 -4
- package/dist/components/icons/render-server.d.ts +0 -3
- package/dist/components/icons/render-server.js +0 -4
- package/dist/components/icons/skia.d.ts +0 -3
- package/dist/components/icons/skia.js +0 -4
- package/dist/components/icons/stargazer.d.ts +0 -3
- package/dist/components/icons/stargazer.js +0 -4
- package/dist/components/icons/still.d.ts +0 -3
- package/dist/components/icons/still.js +0 -4
- package/dist/components/icons/tailwind.d.ts +0 -3
- package/dist/components/icons/tailwind.js +0 -4
- package/dist/components/icons/tiktok.d.ts +0 -3
- package/dist/components/icons/tiktok.js +0 -4
- package/dist/components/icons/timeline.d.ts +0 -3
- package/dist/components/icons/timeline.js +0 -4
- package/dist/components/icons/ts.d.ts +0 -3
- package/dist/components/icons/ts.js +0 -4
- package/dist/components/icons/undo.d.ts +0 -3
- package/dist/components/icons/undo.js +0 -2
- package/dist/components/icons/vercel.d.ts +0 -4
- package/dist/components/icons/vercel.js +0 -4
- package/dist/components/icons/waveform.d.ts +0 -3
- package/dist/components/icons/waveform.js +0 -4
- package/dist/components/prompts/CardLikeButton.d.ts +0 -5
- package/dist/components/prompts/CardLikeButton.js +0 -49
- package/dist/components/prompts/ClipboardIcon.d.ts +0 -5
- package/dist/components/prompts/ClipboardIcon.js +0 -4
- package/dist/components/prompts/CopyPromptButton.d.ts +0 -4
- package/dist/components/prompts/CopyPromptButton.js +0 -13
- package/dist/components/prompts/LikeButton.d.ts +0 -5
- package/dist/components/prompts/LikeButton.js +0 -49
- package/dist/components/prompts/MuxPlayer.d.ts +0 -8
- package/dist/components/prompts/MuxPlayer.js +0 -21
- package/dist/components/prompts/NewBackButton.d.ts +0 -5
- package/dist/components/prompts/NewBackButton.js +0 -8
- package/dist/components/prompts/Page.d.ts +0 -8
- package/dist/components/prompts/Page.js +0 -7
- package/dist/components/prompts/PromptsGallery.d.ts +0 -7
- package/dist/components/prompts/PromptsGallery.js +0 -60
- package/dist/components/prompts/PromptsShow.d.ts +0 -5
- package/dist/components/prompts/PromptsShow.js +0 -17
- package/dist/components/prompts/PromptsSubmit.d.ts +0 -2
- package/dist/components/prompts/PromptsSubmit.js +0 -173
- package/dist/components/prompts/config.d.ts +0 -1
- package/dist/components/prompts/config.js +0 -1
- package/dist/components/prompts/prompt-helpers.d.ts +0 -8
- package/dist/components/prompts/prompt-helpers.js +0 -76
- package/dist/components/prompts/prompt-types.d.ts +0 -14
- package/dist/components/prompts/prompt-types.js +0 -0
- package/dist/components/prompts/use-heart-animation.d.ts +0 -5
- package/dist/components/prompts/use-heart-animation.js +0 -29
- package/dist/components/team/TeamCards.d.ts +0 -6
- package/dist/components/team/TeamCards.js +0 -19
- package/dist/components/team/TitleTeamCards.d.ts +0 -2
- package/dist/components/team/TitleTeamCards.js +0 -6
- package/dist/components/team/TrustSection.d.ts +0 -2
- package/dist/components/team/TrustSection.js +0 -59
- package/dist/components/team.d.ts +0 -3
- package/dist/components/team.js +0 -15
- package/dist/components/template-modal-content.d.ts +0 -5
- package/dist/components/template-modal-content.js +0 -73
- package/dist/components/templates.d.ts +0 -2
- package/dist/components/templates.js +0 -27
- package/dist/helpers/mobile-layout.d.ts +0 -1
- package/dist/helpers/mobile-layout.js +0 -6
- package/dist/helpers/use-el-size.d.ts +0 -5
- package/dist/helpers/use-el-size.js +0 -40
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -6
- package/dist/prompts-show.d.ts +0 -1
- package/dist/prompts-show.js +0 -20
- package/dist/prompts-submit.d.ts +0 -1
- package/dist/prompts-submit.js +0 -6
- package/dist/prompts.d.ts +0 -1
- package/dist/prompts.js +0 -6
- package/dist/team.d.ts +0 -1
package/dist/design.js
CHANGED
|
@@ -33,10 +33,10 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
// ../design/dist/esm/index.mjs
|
|
36
|
-
import * as
|
|
36
|
+
import * as React23 from "react";
|
|
37
37
|
import * as React3 from "react";
|
|
38
38
|
import { Fragment as Fragment2, jsx as jsx39 } from "react/jsx-runtime";
|
|
39
|
-
import React52, { useCallback as useCallback25, useRef as
|
|
39
|
+
import React52, { useCallback as useCallback25, useRef as useRef28, useState as useState22 } from "react";
|
|
40
40
|
|
|
41
41
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
42
42
|
function r(e) {
|
|
@@ -1378,7 +1378,7 @@ var getDefaultConfig = () => {
|
|
|
1378
1378
|
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
1379
1379
|
|
|
1380
1380
|
// ../design/dist/esm/index.mjs
|
|
1381
|
-
import
|
|
1381
|
+
import React35, { useEffect as useEffect22, useMemo as useMemo40, useState as useState21 } from "react";
|
|
1382
1382
|
|
|
1383
1383
|
// ../paths/dist/esm/index.mjs
|
|
1384
1384
|
var cutLInstruction = ({
|
|
@@ -5769,10 +5769,12 @@ import { jsx as jsx92 } from "react/jsx-runtime";
|
|
|
5769
5769
|
import { createContext as createContext14 } from "react";
|
|
5770
5770
|
import React11, { useCallback as useCallback5, useMemo as useMemo12, useRef as useRef4, useState as useState3 } from "react";
|
|
5771
5771
|
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
5772
|
-
import React12, {
|
|
5773
|
-
import { useContext as useContext15, useRef as useRef5 } from "react";
|
|
5774
|
-
import { createContext as createContext15 } from "react";
|
|
5772
|
+
import React12, { createContext as createContext15 } from "react";
|
|
5775
5773
|
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
5774
|
+
import React13, { forwardRef as forwardRef2, useContext as useContext16, useMemo as useMemo13, useState as useState4 } from "react";
|
|
5775
|
+
import { useContext as useContext15, useRef as useRef5 } from "react";
|
|
5776
|
+
import { createContext as createContext16 } from "react";
|
|
5777
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5776
5778
|
import {
|
|
5777
5779
|
forwardRef as forwardRef4,
|
|
5778
5780
|
useEffect as useEffect5,
|
|
@@ -5781,13 +5783,13 @@ import {
|
|
|
5781
5783
|
useRef as useRef9,
|
|
5782
5784
|
useState as useState6
|
|
5783
5785
|
} from "react";
|
|
5784
|
-
import
|
|
5786
|
+
import React15, { useCallback as useCallback6, useImperativeHandle, useMemo as useMemo16, useRef as useRef8 } from "react";
|
|
5785
5787
|
import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef7 } from "react";
|
|
5786
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5787
5788
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
5789
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
5788
5790
|
import { useContext as useContext18, useLayoutEffect as useLayoutEffect4, useState as useState8 } from "react";
|
|
5789
5791
|
import {
|
|
5790
|
-
createContext as
|
|
5792
|
+
createContext as createContext17,
|
|
5791
5793
|
useCallback as useCallback7,
|
|
5792
5794
|
useImperativeHandle as useImperativeHandle3,
|
|
5793
5795
|
useLayoutEffect as useLayoutEffect3,
|
|
@@ -5795,17 +5797,17 @@ import {
|
|
|
5795
5797
|
useRef as useRef10,
|
|
5796
5798
|
useState as useState7
|
|
5797
5799
|
} from "react";
|
|
5798
|
-
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
5799
|
-
import { forwardRef as forwardRef7, useCallback as useCallback13, useContext as useContext30 } from "react";
|
|
5800
|
-
import React15, { createContext as createContext17, useMemo as useMemo18 } from "react";
|
|
5801
5800
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
5802
|
-
import { useContext as
|
|
5803
|
-
import { createContext as createContext18,
|
|
5801
|
+
import { forwardRef as forwardRef7, useCallback as useCallback13, useContext as useContext30 } from "react";
|
|
5802
|
+
import React16, { createContext as createContext18, useMemo as useMemo18 } from "react";
|
|
5804
5803
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5805
|
-
import {
|
|
5804
|
+
import { useContext as useContext19 } from "react";
|
|
5805
|
+
import { createContext as createContext19, useEffect as useEffect6, useState as useState9 } from "react";
|
|
5806
5806
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5807
|
+
import { createContext as createContext20, useMemo as useMemo19, useReducer } from "react";
|
|
5808
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
5807
5809
|
import { useCallback as useCallback12 } from "react";
|
|
5808
|
-
import
|
|
5810
|
+
import React22, {
|
|
5809
5811
|
forwardRef as forwardRef5,
|
|
5810
5812
|
useContext as useContext28,
|
|
5811
5813
|
useEffect as useEffect14,
|
|
@@ -5815,8 +5817,8 @@ import React21, {
|
|
|
5815
5817
|
useState as useState14
|
|
5816
5818
|
} from "react";
|
|
5817
5819
|
import { useContext as useContext21, useLayoutEffect as useLayoutEffect5, useRef as useRef14 } from "react";
|
|
5818
|
-
import
|
|
5819
|
-
createContext as
|
|
5820
|
+
import React19, {
|
|
5821
|
+
createContext as createContext21,
|
|
5820
5822
|
createRef as createRef2,
|
|
5821
5823
|
useCallback as useCallback8,
|
|
5822
5824
|
useContext as useContext20,
|
|
@@ -5826,7 +5828,7 @@ import React18, {
|
|
|
5826
5828
|
useState as useState10
|
|
5827
5829
|
} from "react";
|
|
5828
5830
|
import { useMemo as useMemo20, useRef as useRef11 } from "react";
|
|
5829
|
-
import { jsx as
|
|
5831
|
+
import { jsx as jsx19, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5830
5832
|
import { useRef as useRef13 } from "react";
|
|
5831
5833
|
import { useContext as useContext23, useEffect as useEffect8, useMemo as useMemo22, useState as useState11 } from "react";
|
|
5832
5834
|
import { useContext as useContext22 } from "react";
|
|
@@ -5839,7 +5841,7 @@ import {
|
|
|
5839
5841
|
} from "react";
|
|
5840
5842
|
import { useCallback as useCallback10, useMemo as useMemo25, useRef as useRef16 } from "react";
|
|
5841
5843
|
import { useContext as useContext25, useMemo as useMemo24 } from "react";
|
|
5842
|
-
import
|
|
5844
|
+
import React20, {
|
|
5843
5845
|
useCallback as useCallback9,
|
|
5844
5846
|
useContext as useContext24,
|
|
5845
5847
|
useEffect as useEffect9,
|
|
@@ -5848,13 +5850,13 @@ import React19, {
|
|
|
5848
5850
|
useRef as useRef15,
|
|
5849
5851
|
useState as useState12
|
|
5850
5852
|
} from "react";
|
|
5851
|
-
import { jsx as
|
|
5852
|
-
import
|
|
5853
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
5854
|
+
import React21 from "react";
|
|
5853
5855
|
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
5854
5856
|
import { useEffect as useEffect11, useRef as useRef17 } from "react";
|
|
5855
5857
|
import { useEffect as useEffect13 } from "react";
|
|
5856
|
-
import { createContext as
|
|
5857
|
-
import { jsx as
|
|
5858
|
+
import { createContext as createContext22, useContext as useContext27, useMemo as useMemo26 } from "react";
|
|
5859
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
5858
5860
|
import {
|
|
5859
5861
|
forwardRef as forwardRef6,
|
|
5860
5862
|
useContext as useContext29,
|
|
@@ -5864,8 +5866,8 @@ import {
|
|
|
5864
5866
|
useMemo as useMemo28,
|
|
5865
5867
|
useRef as useRef20
|
|
5866
5868
|
} from "react";
|
|
5867
|
-
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
5868
5869
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
5870
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5869
5871
|
import {
|
|
5870
5872
|
forwardRef as forwardRef8,
|
|
5871
5873
|
useCallback as useCallback14,
|
|
@@ -5875,9 +5877,9 @@ import {
|
|
|
5875
5877
|
useRef as useRef21,
|
|
5876
5878
|
useState as useState15
|
|
5877
5879
|
} from "react";
|
|
5878
|
-
import { jsx as
|
|
5880
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
5879
5881
|
import {
|
|
5880
|
-
createContext as
|
|
5882
|
+
createContext as createContext23,
|
|
5881
5883
|
forwardRef as forwardRef9,
|
|
5882
5884
|
useCallback as useCallback15,
|
|
5883
5885
|
useContext as useContext31,
|
|
@@ -5885,83 +5887,82 @@ import {
|
|
|
5885
5887
|
useMemo as useMemo30,
|
|
5886
5888
|
useRef as useRef22
|
|
5887
5889
|
} from "react";
|
|
5888
|
-
import { jsx as
|
|
5890
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
5889
5891
|
import {
|
|
5890
5892
|
forwardRef as forwardRef10,
|
|
5891
5893
|
useCallback as useCallback16,
|
|
5892
5894
|
useContext as useContext32,
|
|
5893
5895
|
useEffect as useEffect17,
|
|
5896
|
+
useImperativeHandle as useImperativeHandle7,
|
|
5894
5897
|
useMemo as useMemo31,
|
|
5898
|
+
useRef as useRef23,
|
|
5895
5899
|
useState as useState16
|
|
5896
5900
|
} from "react";
|
|
5897
|
-
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
5898
|
-
import { forwardRef as forwardRef11, useCallback as useCallback17, useState as useState17 } from "react";
|
|
5899
5901
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
5900
|
-
import {
|
|
5901
|
-
useCallback as useCallback18,
|
|
5902
|
-
useContext as useContext33,
|
|
5903
|
-
useImperativeHandle as useImperativeHandle7,
|
|
5904
|
-
useLayoutEffect as useLayoutEffect10,
|
|
5905
|
-
useRef as useRef23
|
|
5906
|
-
} from "react";
|
|
5902
|
+
import { forwardRef as forwardRef11, useCallback as useCallback17, useState as useState17 } from "react";
|
|
5907
5903
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
5904
|
+
import { useCallback as useCallback18, useContext as useContext33, useLayoutEffect as useLayoutEffect10, useRef as useRef24 } from "react";
|
|
5905
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
5908
5906
|
import { createRef as createRef3 } from "react";
|
|
5909
|
-
import
|
|
5907
|
+
import React29 from "react";
|
|
5910
5908
|
import {
|
|
5911
5909
|
useCallback as useCallback19,
|
|
5912
5910
|
useImperativeHandle as useImperativeHandle8,
|
|
5913
5911
|
useMemo as useMemo322,
|
|
5914
|
-
useRef as
|
|
5912
|
+
useRef as useRef25,
|
|
5915
5913
|
useState as useState18
|
|
5916
5914
|
} from "react";
|
|
5917
|
-
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
5918
|
-
import React29 from "react";
|
|
5919
|
-
import { useMemo as useMemo34 } from "react";
|
|
5920
|
-
import { createContext as createContext23, useContext as useContext34, useMemo as useMemo33 } from "react";
|
|
5921
5915
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
5916
|
+
import React30 from "react";
|
|
5917
|
+
import { useMemo as useMemo34 } from "react";
|
|
5918
|
+
import { createContext as createContext24, useContext as useContext34, useMemo as useMemo33 } from "react";
|
|
5922
5919
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
5923
|
-
import
|
|
5924
|
-
import React32
|
|
5920
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
5921
|
+
import React32 from "react";
|
|
5922
|
+
import React33, { createContext as createContext25 } from "react";
|
|
5923
|
+
import React34, { useContext as useContext35 } from "react";
|
|
5925
5924
|
import { useCallback as useCallback22 } from "react";
|
|
5926
5925
|
import {
|
|
5927
5926
|
useCallback as useCallback20,
|
|
5928
|
-
useContext as
|
|
5927
|
+
useContext as useContext36,
|
|
5929
5928
|
useEffect as useEffect18,
|
|
5930
5929
|
useLayoutEffect as useLayoutEffect11,
|
|
5931
5930
|
useMemo as useMemo35,
|
|
5932
5931
|
useState as useState19
|
|
5933
5932
|
} from "react";
|
|
5934
|
-
import { jsx as
|
|
5935
|
-
import
|
|
5933
|
+
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
5934
|
+
import React36, {
|
|
5936
5935
|
forwardRef as forwardRef12,
|
|
5937
|
-
|
|
5936
|
+
useCallback as useCallback21,
|
|
5937
|
+
useContext as useContext37,
|
|
5938
5938
|
useEffect as useEffect20,
|
|
5939
5939
|
useImperativeHandle as useImperativeHandle9,
|
|
5940
5940
|
useMemo as useMemo36,
|
|
5941
|
-
useRef as
|
|
5942
|
-
useState as useState20
|
|
5943
|
-
useCallback as useCallback21
|
|
5941
|
+
useRef as useRef26,
|
|
5942
|
+
useState as useState20
|
|
5944
5943
|
} from "react";
|
|
5945
5944
|
import { useEffect as useEffect19 } from "react";
|
|
5946
|
-
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
5947
5945
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
5948
|
-
import React36, { useMemo as useMemo37 } from "react";
|
|
5949
5946
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
5950
|
-
import
|
|
5951
|
-
import React37 from "react";
|
|
5952
|
-
import React38, { createContext as createContext25 } from "react";
|
|
5947
|
+
import React38, { useMemo as useMemo37 } from "react";
|
|
5953
5948
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
5949
|
+
import {
|
|
5950
|
+
Children,
|
|
5951
|
+
forwardRef as forwardRef13,
|
|
5952
|
+
useMemo as useMemo38
|
|
5953
|
+
} from "react";
|
|
5954
|
+
import React39 from "react";
|
|
5954
5955
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
5955
|
-
import
|
|
5956
|
-
import { forwardRef as forwardRef15, useCallback as useCallback23, useContext as
|
|
5956
|
+
import React41 from "react";
|
|
5957
|
+
import { forwardRef as forwardRef15, useCallback as useCallback23, useContext as useContext39 } from "react";
|
|
5957
5958
|
import {
|
|
5958
5959
|
forwardRef as forwardRef14,
|
|
5959
|
-
useContext as
|
|
5960
|
+
useContext as useContext38,
|
|
5960
5961
|
useEffect as useEffect21,
|
|
5961
5962
|
useImperativeHandle as useImperativeHandle10,
|
|
5962
5963
|
useLayoutEffect as useLayoutEffect12,
|
|
5963
5964
|
useMemo as useMemo39,
|
|
5964
|
-
useRef as
|
|
5965
|
+
useRef as useRef27
|
|
5965
5966
|
} from "react";
|
|
5966
5967
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
5967
5968
|
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
@@ -6134,11 +6135,57 @@ function truthy2(value) {
|
|
|
6134
6135
|
return Boolean(value);
|
|
6135
6136
|
}
|
|
6136
6137
|
var getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
6138
|
+
var isFolderNameValid = (name) => name.match(getRegex());
|
|
6139
|
+
var validateFolderName = (name) => {
|
|
6140
|
+
if (name === undefined || name === null) {
|
|
6141
|
+
throw new TypeError("You must pass a name to a <Folder />.");
|
|
6142
|
+
}
|
|
6143
|
+
if (typeof name !== "string") {
|
|
6144
|
+
throw new TypeError(`The "name" you pass into <Folder /> must be a string. Got: ${typeof name}`);
|
|
6145
|
+
}
|
|
6146
|
+
if (!isFolderNameValid(name)) {
|
|
6147
|
+
throw new Error(`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${name}`);
|
|
6148
|
+
}
|
|
6149
|
+
};
|
|
6137
6150
|
var invalidFolderNameErrorMessage = `Folder name must match ${String(getRegex())}`;
|
|
6138
6151
|
var FolderContext = createContext6({
|
|
6139
6152
|
folderName: null,
|
|
6140
6153
|
parentName: null
|
|
6141
6154
|
});
|
|
6155
|
+
var Folder = (props) => {
|
|
6156
|
+
const { name, children } = props;
|
|
6157
|
+
const parent = useContext2(FolderContext);
|
|
6158
|
+
const { registerFolder, unregisterFolder } = useContext2(CompositionSetters);
|
|
6159
|
+
const nonce = useNonce();
|
|
6160
|
+
const stack = props.stack ?? null;
|
|
6161
|
+
validateFolderName(name);
|
|
6162
|
+
const parentNameArr = [parent.parentName, parent.folderName].filter(truthy2);
|
|
6163
|
+
const parentName = parentNameArr.length === 0 ? null : parentNameArr.join("/");
|
|
6164
|
+
const value = useMemo2(() => {
|
|
6165
|
+
return {
|
|
6166
|
+
folderName: name,
|
|
6167
|
+
parentName
|
|
6168
|
+
};
|
|
6169
|
+
}, [name, parentName]);
|
|
6170
|
+
useEffect(() => {
|
|
6171
|
+
registerFolder(name, parentName, nonce.get(), stack);
|
|
6172
|
+
return () => {
|
|
6173
|
+
unregisterFolder(name, parentName);
|
|
6174
|
+
};
|
|
6175
|
+
}, [
|
|
6176
|
+
name,
|
|
6177
|
+
parent.folderName,
|
|
6178
|
+
parentName,
|
|
6179
|
+
registerFolder,
|
|
6180
|
+
unregisterFolder,
|
|
6181
|
+
nonce,
|
|
6182
|
+
stack
|
|
6183
|
+
]);
|
|
6184
|
+
return /* @__PURE__ */ jsx22(FolderContext.Provider, {
|
|
6185
|
+
value,
|
|
6186
|
+
children
|
|
6187
|
+
});
|
|
6188
|
+
};
|
|
6142
6189
|
function getNodeEnvString() {
|
|
6143
6190
|
return ["NOD", "E_EN", "V"].join("");
|
|
6144
6191
|
}
|
|
@@ -7087,7 +7134,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
|
7087
7134
|
var addSequenceStackTraces = (component) => {
|
|
7088
7135
|
componentsToAddStacksTo.push(component);
|
|
7089
7136
|
};
|
|
7090
|
-
var VERSION = "4.0.
|
|
7137
|
+
var VERSION = "4.0.472";
|
|
7091
7138
|
var checkMultipleRemotionVersions = () => {
|
|
7092
7139
|
if (typeof globalThis === "undefined") {
|
|
7093
7140
|
return;
|
|
@@ -7457,7 +7504,7 @@ var sequenceVisualStyleSchema = {
|
|
|
7457
7504
|
description: "Offset"
|
|
7458
7505
|
},
|
|
7459
7506
|
"style.scale": {
|
|
7460
|
-
type: "
|
|
7507
|
+
type: "scale",
|
|
7461
7508
|
min: 0.05,
|
|
7462
7509
|
max: 100,
|
|
7463
7510
|
step: 0.01,
|
|
@@ -7465,7 +7512,7 @@ var sequenceVisualStyleSchema = {
|
|
|
7465
7512
|
description: "Scale"
|
|
7466
7513
|
},
|
|
7467
7514
|
"style.rotate": {
|
|
7468
|
-
type: "rotation",
|
|
7515
|
+
type: "rotation-css",
|
|
7469
7516
|
step: 1,
|
|
7470
7517
|
default: "0deg",
|
|
7471
7518
|
description: "Rotation"
|
|
@@ -7476,7 +7523,8 @@ var sequenceVisualStyleSchema = {
|
|
|
7476
7523
|
max: 1,
|
|
7477
7524
|
step: 0.01,
|
|
7478
7525
|
default: 1,
|
|
7479
|
-
description: "Opacity"
|
|
7526
|
+
description: "Opacity",
|
|
7527
|
+
hiddenFromList: false
|
|
7480
7528
|
}
|
|
7481
7529
|
};
|
|
7482
7530
|
var sequencePremountSchema = {
|
|
@@ -7485,10 +7533,15 @@ var sequencePremountSchema = {
|
|
|
7485
7533
|
default: 0,
|
|
7486
7534
|
description: "Premount For",
|
|
7487
7535
|
min: 0,
|
|
7488
|
-
step: 1
|
|
7536
|
+
step: 1,
|
|
7537
|
+
hiddenFromList: false
|
|
7489
7538
|
},
|
|
7490
7539
|
postmountFor: {
|
|
7491
|
-
type: "
|
|
7540
|
+
type: "number",
|
|
7541
|
+
default: 0,
|
|
7542
|
+
min: 0,
|
|
7543
|
+
step: 1,
|
|
7544
|
+
hiddenFromList: true
|
|
7492
7545
|
},
|
|
7493
7546
|
styleWhilePremounted: {
|
|
7494
7547
|
type: "hidden"
|
|
@@ -7506,8 +7559,23 @@ var hiddenField = {
|
|
|
7506
7559
|
default: false,
|
|
7507
7560
|
description: "Hidden"
|
|
7508
7561
|
};
|
|
7562
|
+
var durationInFramesField = {
|
|
7563
|
+
type: "number",
|
|
7564
|
+
default: undefined,
|
|
7565
|
+
min: 1,
|
|
7566
|
+
step: 1,
|
|
7567
|
+
hiddenFromList: true
|
|
7568
|
+
};
|
|
7569
|
+
var fromField = {
|
|
7570
|
+
type: "number",
|
|
7571
|
+
default: 0,
|
|
7572
|
+
step: 1,
|
|
7573
|
+
hiddenFromList: true
|
|
7574
|
+
};
|
|
7509
7575
|
var sequenceSchema = {
|
|
7510
7576
|
hidden: hiddenField,
|
|
7577
|
+
from: fromField,
|
|
7578
|
+
durationInFrames: durationInFramesField,
|
|
7511
7579
|
layout: {
|
|
7512
7580
|
type: "enum",
|
|
7513
7581
|
default: "absolute-fill",
|
|
@@ -7688,6 +7756,25 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
7688
7756
|
})
|
|
7689
7757
|
});
|
|
7690
7758
|
};
|
|
7759
|
+
var IsInsideSeriesContext = createContext15(false);
|
|
7760
|
+
var IsInsideSeriesContainer = ({ children }) => {
|
|
7761
|
+
return /* @__PURE__ */ jsx112(IsInsideSeriesContext.Provider, {
|
|
7762
|
+
value: true,
|
|
7763
|
+
children
|
|
7764
|
+
});
|
|
7765
|
+
};
|
|
7766
|
+
var IsNotInsideSeriesProvider = ({ children }) => {
|
|
7767
|
+
return /* @__PURE__ */ jsx112(IsInsideSeriesContext.Provider, {
|
|
7768
|
+
value: false,
|
|
7769
|
+
children
|
|
7770
|
+
});
|
|
7771
|
+
};
|
|
7772
|
+
var useRequireToBeInsideSeries = () => {
|
|
7773
|
+
const isInsideSeries = React12.useContext(IsInsideSeriesContext);
|
|
7774
|
+
if (!isInsideSeries) {
|
|
7775
|
+
throw new Error("This component must be inside a <Series /> component.");
|
|
7776
|
+
}
|
|
7777
|
+
};
|
|
7691
7778
|
var ENABLE_V5_BREAKING_CHANGES = false;
|
|
7692
7779
|
var deleteNestedKey = (obj, keysToRemove) => {
|
|
7693
7780
|
for (const key of keysToRemove) {
|
|
@@ -7720,454 +7807,438 @@ var deleteNestedKey = (obj, keysToRemove) => {
|
|
|
7720
7807
|
}
|
|
7721
7808
|
return obj;
|
|
7722
7809
|
};
|
|
7723
|
-
var
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
var
|
|
7727
|
-
|
|
7728
|
-
|
|
7810
|
+
var NEWTON_ITERATIONS = 4;
|
|
7811
|
+
var NEWTON_MIN_SLOPE = 0.001;
|
|
7812
|
+
var SUBDIVISION_PRECISION = 0.0000001;
|
|
7813
|
+
var SUBDIVISION_MAX_ITERATIONS = 10;
|
|
7814
|
+
var kSplineTableSize = 11;
|
|
7815
|
+
var kSampleStepSize = 1 / (kSplineTableSize - 1);
|
|
7816
|
+
var float32ArraySupported = typeof Float32Array === "function";
|
|
7817
|
+
function a(aA1, aA2) {
|
|
7818
|
+
return 1 - 3 * aA2 + 3 * aA1;
|
|
7819
|
+
}
|
|
7820
|
+
function b(aA1, aA2) {
|
|
7821
|
+
return 3 * aA2 - 6 * aA1;
|
|
7822
|
+
}
|
|
7823
|
+
function c(aA1) {
|
|
7824
|
+
return 3 * aA1;
|
|
7825
|
+
}
|
|
7826
|
+
function calcBezier(aT, aA1, aA2) {
|
|
7827
|
+
return ((a(aA1, aA2) * aT + b(aA1, aA2)) * aT + c(aA1)) * aT;
|
|
7828
|
+
}
|
|
7829
|
+
function getSlope(aT, aA1, aA2) {
|
|
7830
|
+
return 3 * a(aA1, aA2) * aT * aT + 2 * b(aA1, aA2) * aT + c(aA1);
|
|
7831
|
+
}
|
|
7832
|
+
function binarySubdivide({
|
|
7833
|
+
aX,
|
|
7834
|
+
_aA,
|
|
7835
|
+
_aB,
|
|
7836
|
+
mX1,
|
|
7837
|
+
mX2
|
|
7838
|
+
}) {
|
|
7839
|
+
let currentX;
|
|
7840
|
+
let currentT;
|
|
7841
|
+
let i = 0;
|
|
7842
|
+
let aA = _aA;
|
|
7843
|
+
let aB = _aB;
|
|
7844
|
+
do {
|
|
7845
|
+
currentT = aA + (aB - aA) / 2;
|
|
7846
|
+
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
|
7847
|
+
if (currentX > 0) {
|
|
7848
|
+
aB = currentT;
|
|
7849
|
+
} else {
|
|
7850
|
+
aA = currentT;
|
|
7851
|
+
}
|
|
7852
|
+
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
|
7853
|
+
return currentT;
|
|
7854
|
+
}
|
|
7855
|
+
function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) {
|
|
7856
|
+
let aGuessT = _aGuessT;
|
|
7857
|
+
for (let i = 0;i < NEWTON_ITERATIONS; ++i) {
|
|
7858
|
+
const currentSlope = getSlope(aGuessT, mX1, mX2);
|
|
7859
|
+
if (currentSlope === 0) {
|
|
7860
|
+
return aGuessT;
|
|
7861
|
+
}
|
|
7862
|
+
const currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
|
7863
|
+
aGuessT -= currentX / currentSlope;
|
|
7729
7864
|
}
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
}) => {
|
|
7736
|
-
if (!codeOverrides && !dragOverrides) {
|
|
7737
|
-
return { params: descriptor.params, effectKey: descriptor.effectKey };
|
|
7865
|
+
return aGuessT;
|
|
7866
|
+
}
|
|
7867
|
+
function bezier(mX1, mY1, mX2, mY2) {
|
|
7868
|
+
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
|
|
7869
|
+
throw new Error("bezier x values must be in [0, 1] range");
|
|
7738
7870
|
}
|
|
7739
|
-
const
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
for (const [key, value] of Object.entries(codeOverrides)) {
|
|
7744
|
-
if (value !== undefined) {
|
|
7745
|
-
merged[key] = value;
|
|
7746
|
-
}
|
|
7871
|
+
const sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
|
7872
|
+
if (mX1 !== mY1 || mX2 !== mY2) {
|
|
7873
|
+
for (let i = 0;i < kSplineTableSize; ++i) {
|
|
7874
|
+
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
|
7747
7875
|
}
|
|
7748
7876
|
}
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7877
|
+
function getTForX(aX) {
|
|
7878
|
+
let intervalStart = 0;
|
|
7879
|
+
let currentSample = 1;
|
|
7880
|
+
const lastSample = kSplineTableSize - 1;
|
|
7881
|
+
for (;currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
|
7882
|
+
intervalStart += kSampleStepSize;
|
|
7752
7883
|
}
|
|
7884
|
+
--currentSample;
|
|
7885
|
+
const dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
|
7886
|
+
const guessForT = intervalStart + dist * kSampleStepSize;
|
|
7887
|
+
const initialSlope = getSlope(guessForT, mX1, mX2);
|
|
7888
|
+
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
|
7889
|
+
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
|
7890
|
+
}
|
|
7891
|
+
if (initialSlope === 0) {
|
|
7892
|
+
return guessForT;
|
|
7893
|
+
}
|
|
7894
|
+
return binarySubdivide({
|
|
7895
|
+
aX,
|
|
7896
|
+
_aA: intervalStart,
|
|
7897
|
+
_aB: intervalStart + kSampleStepSize,
|
|
7898
|
+
mX1,
|
|
7899
|
+
mX2
|
|
7900
|
+
});
|
|
7753
7901
|
}
|
|
7754
|
-
return {
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
}
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
let hasAny = false;
|
|
7765
|
-
for (const [key, status] of Object.entries(propStatus)) {
|
|
7766
|
-
if (status.canUpdate) {
|
|
7767
|
-
out[key] = status.codeValue;
|
|
7768
|
-
hasAny = true;
|
|
7902
|
+
return function(x) {
|
|
7903
|
+
const clampedX = Math.min(1, Math.max(0, x));
|
|
7904
|
+
if (mX1 === mY1 && mX2 === mY2) {
|
|
7905
|
+
return clampedX;
|
|
7906
|
+
}
|
|
7907
|
+
if (clampedX === 0) {
|
|
7908
|
+
return 0;
|
|
7909
|
+
}
|
|
7910
|
+
if (clampedX === 1) {
|
|
7911
|
+
return 1;
|
|
7769
7912
|
}
|
|
7913
|
+
return calcBezier(getTForX(clampedX), mY1, mY2);
|
|
7914
|
+
};
|
|
7915
|
+
}
|
|
7916
|
+
var clampUnit = (t) => Math.min(1, Math.max(0, t));
|
|
7917
|
+
|
|
7918
|
+
class Easing {
|
|
7919
|
+
static step0(n) {
|
|
7920
|
+
return n > 0 ? 1 : 0;
|
|
7770
7921
|
}
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
var useMemoizedEffectDefinitions = (effects) => {
|
|
7774
|
-
const previousRef = useRef5(null);
|
|
7775
|
-
const definitions = effects.map((descriptor) => descriptor.definition);
|
|
7776
|
-
const previous = previousRef.current;
|
|
7777
|
-
const isSame = previous !== null && previous.length === definitions.length && previous.every((def, i) => def === definitions[i]);
|
|
7778
|
-
if (isSame) {
|
|
7779
|
-
return previous;
|
|
7922
|
+
static step1(n) {
|
|
7923
|
+
return n >= 1 ? 1 : 0;
|
|
7780
7924
|
}
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
};
|
|
7784
|
-
var getEffectCodeValuesCtx = ({
|
|
7785
|
-
codeValues,
|
|
7786
|
-
nodePath,
|
|
7787
|
-
effectIndex
|
|
7788
|
-
}) => {
|
|
7789
|
-
const status = codeValues[makeSequencePropsSubscriptionKey(nodePath)];
|
|
7790
|
-
if (!status) {
|
|
7791
|
-
return { type: "cannot-update-sequence", reason: "not-found" };
|
|
7925
|
+
static linear(t) {
|
|
7926
|
+
return t;
|
|
7792
7927
|
}
|
|
7793
|
-
|
|
7794
|
-
return
|
|
7928
|
+
static ease(t) {
|
|
7929
|
+
return Easing.bezier(0.42, 0, 1, 1)(t);
|
|
7795
7930
|
}
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
return { type: "cannot-update-effect", reason: "not-found" };
|
|
7931
|
+
static quad(t) {
|
|
7932
|
+
return t * t;
|
|
7799
7933
|
}
|
|
7800
|
-
|
|
7801
|
-
return
|
|
7934
|
+
static cubic(t) {
|
|
7935
|
+
return t * t * t;
|
|
7802
7936
|
}
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
var getCodeValuesCtx = (codeValues, nodePath) => {
|
|
7806
|
-
const status = codeValues[makeSequencePropsSubscriptionKey(nodePath)];
|
|
7807
|
-
if (!status) {
|
|
7808
|
-
return;
|
|
7937
|
+
static poly(n) {
|
|
7938
|
+
return (t) => t ** n;
|
|
7809
7939
|
}
|
|
7810
|
-
|
|
7811
|
-
return;
|
|
7940
|
+
static sin(t) {
|
|
7941
|
+
return 1 - Math.cos(t * Math.PI / 2);
|
|
7812
7942
|
}
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
};
|
|
7943
|
+
static circle(t) {
|
|
7944
|
+
const u = clampUnit(t);
|
|
7945
|
+
return 1 - Math.sqrt(1 - u * u);
|
|
7946
|
+
}
|
|
7947
|
+
static exp(t) {
|
|
7948
|
+
return 2 ** (10 * (t - 1));
|
|
7949
|
+
}
|
|
7950
|
+
static elastic(bounciness = 1) {
|
|
7951
|
+
const p = bounciness * Math.PI;
|
|
7952
|
+
return (t) => 1 - Math.cos(t * Math.PI / 2) ** 3 * Math.cos(t * p);
|
|
7953
|
+
}
|
|
7954
|
+
static back(s = 1.70158) {
|
|
7955
|
+
return (t) => t * t * ((s + 1) * t - s);
|
|
7956
|
+
}
|
|
7957
|
+
static bounce(t) {
|
|
7958
|
+
const u = clampUnit(t);
|
|
7959
|
+
if (u < 1 / 2.75) {
|
|
7960
|
+
return 7.5625 * u * u;
|
|
7832
7961
|
}
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
const
|
|
7842
|
-
|
|
7843
|
-
codeOverrides,
|
|
7844
|
-
dragOverrides
|
|
7845
|
-
});
|
|
7846
|
-
return { descriptor, params, effectKey };
|
|
7847
|
-
});
|
|
7848
|
-
const isSame = previous !== null && previous.length === resolved.length && previous.every((p, i) => p.definition === resolved[i].descriptor.definition && p.effectKey === resolved[i].effectKey);
|
|
7849
|
-
if (isSame) {
|
|
7850
|
-
return previous;
|
|
7962
|
+
if (u < 2 / 2.75) {
|
|
7963
|
+
const t2_ = u - 1.5 / 2.75;
|
|
7964
|
+
return 7.5625 * t2_ * t2_ + 0.75;
|
|
7965
|
+
}
|
|
7966
|
+
if (u < 2.5 / 2.75) {
|
|
7967
|
+
const t2_ = u - 2.25 / 2.75;
|
|
7968
|
+
return 7.5625 * t2_ * t2_ + 0.9375;
|
|
7969
|
+
}
|
|
7970
|
+
const t2 = u - 2.625 / 2.75;
|
|
7971
|
+
return 7.5625 * t2 * t2 + 0.984375;
|
|
7851
7972
|
}
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
}
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
}
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
if (field.type === "hidden") {
|
|
7866
|
-
continue;
|
|
7867
|
-
} else if (field.type === "enum") {
|
|
7868
|
-
out[key] = field;
|
|
7869
|
-
const current = resolve(key) ?? field.default;
|
|
7870
|
-
const variant = field.variants[current];
|
|
7871
|
-
if (variant) {
|
|
7872
|
-
Object.assign(out, flattenActiveSchema(variant, resolve));
|
|
7973
|
+
static bezier(x1, y1, x2, y2) {
|
|
7974
|
+
return bezier(x1, y1, x2, y2);
|
|
7975
|
+
}
|
|
7976
|
+
static in(easing) {
|
|
7977
|
+
return easing;
|
|
7978
|
+
}
|
|
7979
|
+
static out(easing) {
|
|
7980
|
+
return (t) => 1 - easing(1 - t);
|
|
7981
|
+
}
|
|
7982
|
+
static inOut(easing) {
|
|
7983
|
+
return (t) => {
|
|
7984
|
+
if (t < 0.5) {
|
|
7985
|
+
return easing(t * 2) / 2;
|
|
7873
7986
|
}
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
}
|
|
7987
|
+
return 1 - easing((1 - t) * 2) / 2;
|
|
7988
|
+
};
|
|
7877
7989
|
}
|
|
7878
|
-
|
|
7990
|
+
}
|
|
7991
|
+
var normalizeNumber = (value) => {
|
|
7992
|
+
return Math.round(value * 1e6) / 1e6;
|
|
7993
|
+
};
|
|
7994
|
+
var angleUnits = new Set(["deg", "rad", "grad", "turn"]);
|
|
7995
|
+
var lengthUnits = new Set([
|
|
7996
|
+
"%",
|
|
7997
|
+
"cap",
|
|
7998
|
+
"ch",
|
|
7999
|
+
"cm",
|
|
8000
|
+
"cqb",
|
|
8001
|
+
"cqh",
|
|
8002
|
+
"cqi",
|
|
8003
|
+
"cqmax",
|
|
8004
|
+
"cqmin",
|
|
8005
|
+
"cqw",
|
|
8006
|
+
"dvh",
|
|
8007
|
+
"dvw",
|
|
8008
|
+
"em",
|
|
8009
|
+
"ex",
|
|
8010
|
+
"ic",
|
|
8011
|
+
"in",
|
|
8012
|
+
"lh",
|
|
8013
|
+
"lvh",
|
|
8014
|
+
"lvw",
|
|
8015
|
+
"mm",
|
|
8016
|
+
"pc",
|
|
8017
|
+
"pt",
|
|
8018
|
+
"px",
|
|
8019
|
+
"q",
|
|
8020
|
+
"rem",
|
|
8021
|
+
"rlh",
|
|
8022
|
+
"svh",
|
|
8023
|
+
"svw",
|
|
8024
|
+
"vb",
|
|
8025
|
+
"vh",
|
|
8026
|
+
"vi",
|
|
8027
|
+
"vmax",
|
|
8028
|
+
"vmin",
|
|
8029
|
+
"vw"
|
|
8030
|
+
]);
|
|
8031
|
+
var cssNumberRegex = /^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/;
|
|
8032
|
+
var stringifyNumber = (value) => {
|
|
8033
|
+
return String(normalizeNumber(value));
|
|
7879
8034
|
};
|
|
7880
|
-
var
|
|
7881
|
-
const
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
8035
|
+
var parseStringInterpolationComponent = (component, value) => {
|
|
8036
|
+
const match = cssNumberRegex.exec(component);
|
|
8037
|
+
if (match === null) {
|
|
8038
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not a supported scale, translate, or rotate value`);
|
|
8039
|
+
}
|
|
8040
|
+
const unit = match[2] ?? null;
|
|
8041
|
+
const numberValue = Number(match[1]);
|
|
8042
|
+
if (!Number.isFinite(numberValue)) {
|
|
8043
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not finite`);
|
|
8044
|
+
}
|
|
8045
|
+
if (unit === null) {
|
|
8046
|
+
return { kind: "scale", value: numberValue, unit: null };
|
|
8047
|
+
}
|
|
8048
|
+
if (angleUnits.has(unit)) {
|
|
8049
|
+
return { kind: "rotate", value: numberValue, unit };
|
|
8050
|
+
}
|
|
8051
|
+
if (lengthUnits.has(unit)) {
|
|
8052
|
+
return { kind: "translate", value: numberValue, unit };
|
|
8053
|
+
}
|
|
8054
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${unit}" is not a supported translate or rotate unit`);
|
|
8055
|
+
};
|
|
8056
|
+
var parseStringInterpolationValue = (output) => {
|
|
8057
|
+
if (typeof output === "number") {
|
|
8058
|
+
if (!Number.isFinite(output)) {
|
|
8059
|
+
throw new Error(`outputRange must contain only finite numbers, but got [${output}]`);
|
|
7885
8060
|
}
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
8061
|
+
return {
|
|
8062
|
+
kind: "scale",
|
|
8063
|
+
values: [output, output, 1],
|
|
8064
|
+
units: [null, null, null],
|
|
8065
|
+
dimensions: 1
|
|
8066
|
+
};
|
|
8067
|
+
}
|
|
8068
|
+
const parts = output.trim().split(/\s+/);
|
|
8069
|
+
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
8070
|
+
throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${output}"`);
|
|
8071
|
+
}
|
|
8072
|
+
const parsed = parts.map((part) => parseStringInterpolationComponent(part, output));
|
|
8073
|
+
const [{ kind }] = parsed;
|
|
8074
|
+
for (const part of parsed) {
|
|
8075
|
+
if (part.kind !== kind) {
|
|
8076
|
+
throw new TypeError(`Cannot interpolate "${output}" because it mixes ${kind} and ${part.kind} values`);
|
|
7898
8077
|
}
|
|
7899
8078
|
}
|
|
7900
|
-
|
|
8079
|
+
if (kind === "scale") {
|
|
8080
|
+
const x = parsed[0].value;
|
|
8081
|
+
const y = parsed[1]?.value ?? x;
|
|
8082
|
+
const z = parsed[2]?.value ?? 1;
|
|
8083
|
+
return {
|
|
8084
|
+
kind,
|
|
8085
|
+
values: [x, y, z],
|
|
8086
|
+
units: [null, null, null],
|
|
8087
|
+
dimensions: parsed.length
|
|
8088
|
+
};
|
|
8089
|
+
}
|
|
8090
|
+
return {
|
|
8091
|
+
kind,
|
|
8092
|
+
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0],
|
|
8093
|
+
units: [parsed[0].unit, parsed[1]?.unit ?? null, parsed[2]?.unit ?? null],
|
|
8094
|
+
dimensions: parsed.length
|
|
8095
|
+
};
|
|
7901
8096
|
};
|
|
7902
|
-
var
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
8097
|
+
var serializeStringInterpolationValue = ({
|
|
8098
|
+
kind,
|
|
8099
|
+
values,
|
|
8100
|
+
units,
|
|
8101
|
+
dimensions
|
|
7906
8102
|
}) => {
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
throw new Error("Key " + JSON.stringify(key) + " not found in schema");
|
|
8103
|
+
if (kind === "scale") {
|
|
8104
|
+
return values.slice(0, dimensions).map((value) => stringifyNumber(value)).join(" ");
|
|
7910
8105
|
}
|
|
7911
|
-
|
|
7912
|
-
|
|
8106
|
+
return values.slice(0, dimensions).map((value, index) => `${stringifyNumber(value)}${units[index]}`).join(" ");
|
|
8107
|
+
};
|
|
8108
|
+
function interpolateFunction(input, inputRange, outputRange, options) {
|
|
8109
|
+
const { extrapolateLeft, extrapolateRight, easing } = options;
|
|
8110
|
+
let result = input;
|
|
8111
|
+
const [inputMin, inputMax] = inputRange;
|
|
8112
|
+
const [outputMin, outputMax] = outputRange;
|
|
8113
|
+
if (result < inputMin) {
|
|
8114
|
+
if (extrapolateLeft === "identity") {
|
|
8115
|
+
return result;
|
|
8116
|
+
}
|
|
8117
|
+
if (extrapolateLeft === "clamp") {
|
|
8118
|
+
result = inputMin;
|
|
8119
|
+
} else if (extrapolateLeft === "wrap") {
|
|
8120
|
+
const range = inputMax - inputMin;
|
|
8121
|
+
result = ((result - inputMin) % range + range) % range + inputMin;
|
|
8122
|
+
} else if (extrapolateLeft === "extend") {}
|
|
7913
8123
|
}
|
|
7914
|
-
if (
|
|
7915
|
-
|
|
8124
|
+
if (result > inputMax) {
|
|
8125
|
+
if (extrapolateRight === "identity") {
|
|
8126
|
+
return result;
|
|
8127
|
+
}
|
|
8128
|
+
if (extrapolateRight === "clamp") {
|
|
8129
|
+
result = inputMax;
|
|
8130
|
+
} else if (extrapolateRight === "wrap") {
|
|
8131
|
+
const range = inputMax - inputMin;
|
|
8132
|
+
result = ((result - inputMin) % range + range) % range + inputMin;
|
|
8133
|
+
} else if (extrapolateRight === "extend") {}
|
|
7916
8134
|
}
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
throw new Error("Value for " + JSON.stringify(key) + " must be one of " + Object.keys(fieldSchema.variants).map((v) => JSON.stringify(v)).join(", ") + ", got " + JSON.stringify(value));
|
|
8135
|
+
if (outputMin === outputMax) {
|
|
8136
|
+
return outputMin;
|
|
7920
8137
|
}
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
8138
|
+
result = (result - inputMin) / (inputMax - inputMin);
|
|
8139
|
+
result = easing(result);
|
|
8140
|
+
result = result * (outputMax - outputMin) + outputMin;
|
|
8141
|
+
return result;
|
|
8142
|
+
}
|
|
8143
|
+
function findRange(input, inputRange) {
|
|
8144
|
+
let i;
|
|
8145
|
+
for (i = 1;i < inputRange.length - 1; ++i) {
|
|
8146
|
+
if (inputRange[i] >= input) {
|
|
8147
|
+
break;
|
|
7928
8148
|
}
|
|
7929
8149
|
}
|
|
7930
|
-
return
|
|
7931
|
-
}
|
|
7932
|
-
var
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
8150
|
+
return i - 1;
|
|
8151
|
+
}
|
|
8152
|
+
var defaultEasing = (num) => num;
|
|
8153
|
+
var interpolateNumber = ({
|
|
8154
|
+
input,
|
|
8155
|
+
inputRange,
|
|
8156
|
+
outputRange,
|
|
8157
|
+
options
|
|
7937
8158
|
}) => {
|
|
7938
|
-
if (
|
|
7939
|
-
return
|
|
8159
|
+
if (inputRange.length === 1) {
|
|
8160
|
+
return outputRange[0];
|
|
7940
8161
|
}
|
|
7941
|
-
|
|
7942
|
-
|
|
8162
|
+
const easingOption = options?.easing;
|
|
8163
|
+
const resolveEasingForSegment = (segmentIndex) => {
|
|
8164
|
+
if (easingOption === undefined) {
|
|
8165
|
+
return defaultEasing;
|
|
8166
|
+
}
|
|
8167
|
+
if (typeof easingOption === "function") {
|
|
8168
|
+
return easingOption;
|
|
8169
|
+
}
|
|
8170
|
+
return easingOption[segmentIndex];
|
|
8171
|
+
};
|
|
8172
|
+
let extrapolateLeft = "extend";
|
|
8173
|
+
if (options?.extrapolateLeft !== undefined) {
|
|
8174
|
+
extrapolateLeft = options.extrapolateLeft;
|
|
7943
8175
|
}
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
var NEWTON_MIN_SLOPE = 0.001;
|
|
7948
|
-
var SUBDIVISION_PRECISION = 0.0000001;
|
|
7949
|
-
var SUBDIVISION_MAX_ITERATIONS = 10;
|
|
7950
|
-
var kSplineTableSize = 11;
|
|
7951
|
-
var kSampleStepSize = 1 / (kSplineTableSize - 1);
|
|
7952
|
-
var float32ArraySupported = typeof Float32Array === "function";
|
|
7953
|
-
function a(aA1, aA2) {
|
|
7954
|
-
return 1 - 3 * aA2 + 3 * aA1;
|
|
7955
|
-
}
|
|
7956
|
-
function b(aA1, aA2) {
|
|
7957
|
-
return 3 * aA2 - 6 * aA1;
|
|
7958
|
-
}
|
|
7959
|
-
function c(aA1) {
|
|
7960
|
-
return 3 * aA1;
|
|
7961
|
-
}
|
|
7962
|
-
function calcBezier(aT, aA1, aA2) {
|
|
7963
|
-
return ((a(aA1, aA2) * aT + b(aA1, aA2)) * aT + c(aA1)) * aT;
|
|
7964
|
-
}
|
|
7965
|
-
function getSlope(aT, aA1, aA2) {
|
|
7966
|
-
return 3 * a(aA1, aA2) * aT * aT + 2 * b(aA1, aA2) * aT + c(aA1);
|
|
7967
|
-
}
|
|
7968
|
-
function binarySubdivide({
|
|
7969
|
-
aX,
|
|
7970
|
-
_aA,
|
|
7971
|
-
_aB,
|
|
7972
|
-
mX1,
|
|
7973
|
-
mX2
|
|
7974
|
-
}) {
|
|
7975
|
-
let currentX;
|
|
7976
|
-
let currentT;
|
|
7977
|
-
let i = 0;
|
|
7978
|
-
let aA = _aA;
|
|
7979
|
-
let aB = _aB;
|
|
7980
|
-
do {
|
|
7981
|
-
currentT = aA + (aB - aA) / 2;
|
|
7982
|
-
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
|
7983
|
-
if (currentX > 0) {
|
|
7984
|
-
aB = currentT;
|
|
7985
|
-
} else {
|
|
7986
|
-
aA = currentT;
|
|
7987
|
-
}
|
|
7988
|
-
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
|
7989
|
-
return currentT;
|
|
7990
|
-
}
|
|
7991
|
-
function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) {
|
|
7992
|
-
let aGuessT = _aGuessT;
|
|
7993
|
-
for (let i = 0;i < NEWTON_ITERATIONS; ++i) {
|
|
7994
|
-
const currentSlope = getSlope(aGuessT, mX1, mX2);
|
|
7995
|
-
if (currentSlope === 0) {
|
|
7996
|
-
return aGuessT;
|
|
7997
|
-
}
|
|
7998
|
-
const currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
|
7999
|
-
aGuessT -= currentX / currentSlope;
|
|
8000
|
-
}
|
|
8001
|
-
return aGuessT;
|
|
8002
|
-
}
|
|
8003
|
-
function bezier(mX1, mY1, mX2, mY2) {
|
|
8004
|
-
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
|
|
8005
|
-
throw new Error("bezier x values must be in [0, 1] range");
|
|
8006
|
-
}
|
|
8007
|
-
const sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
|
8008
|
-
if (mX1 !== mY1 || mX2 !== mY2) {
|
|
8009
|
-
for (let i = 0;i < kSplineTableSize; ++i) {
|
|
8010
|
-
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
|
8011
|
-
}
|
|
8012
|
-
}
|
|
8013
|
-
function getTForX(aX) {
|
|
8014
|
-
let intervalStart = 0;
|
|
8015
|
-
let currentSample = 1;
|
|
8016
|
-
const lastSample = kSplineTableSize - 1;
|
|
8017
|
-
for (;currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
|
8018
|
-
intervalStart += kSampleStepSize;
|
|
8019
|
-
}
|
|
8020
|
-
--currentSample;
|
|
8021
|
-
const dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
|
8022
|
-
const guessForT = intervalStart + dist * kSampleStepSize;
|
|
8023
|
-
const initialSlope = getSlope(guessForT, mX1, mX2);
|
|
8024
|
-
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
|
8025
|
-
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
|
8026
|
-
}
|
|
8027
|
-
if (initialSlope === 0) {
|
|
8028
|
-
return guessForT;
|
|
8029
|
-
}
|
|
8030
|
-
return binarySubdivide({
|
|
8031
|
-
aX,
|
|
8032
|
-
_aA: intervalStart,
|
|
8033
|
-
_aB: intervalStart + kSampleStepSize,
|
|
8034
|
-
mX1,
|
|
8035
|
-
mX2
|
|
8036
|
-
});
|
|
8037
|
-
}
|
|
8038
|
-
return function(x) {
|
|
8039
|
-
const clampedX = Math.min(1, Math.max(0, x));
|
|
8040
|
-
if (mX1 === mY1 && mX2 === mY2) {
|
|
8041
|
-
return clampedX;
|
|
8042
|
-
}
|
|
8043
|
-
if (clampedX === 0) {
|
|
8044
|
-
return 0;
|
|
8045
|
-
}
|
|
8046
|
-
if (clampedX === 1) {
|
|
8047
|
-
return 1;
|
|
8048
|
-
}
|
|
8049
|
-
return calcBezier(getTForX(clampedX), mY1, mY2);
|
|
8050
|
-
};
|
|
8051
|
-
}
|
|
8052
|
-
var clampUnit = (t) => Math.min(1, Math.max(0, t));
|
|
8053
|
-
|
|
8054
|
-
class Easing {
|
|
8055
|
-
static step0(n) {
|
|
8056
|
-
return n > 0 ? 1 : 0;
|
|
8057
|
-
}
|
|
8058
|
-
static step1(n) {
|
|
8059
|
-
return n >= 1 ? 1 : 0;
|
|
8060
|
-
}
|
|
8061
|
-
static linear(t) {
|
|
8062
|
-
return t;
|
|
8063
|
-
}
|
|
8064
|
-
static ease(t) {
|
|
8065
|
-
return Easing.bezier(0.42, 0, 1, 1)(t);
|
|
8066
|
-
}
|
|
8067
|
-
static quad(t) {
|
|
8068
|
-
return t * t;
|
|
8069
|
-
}
|
|
8070
|
-
static cubic(t) {
|
|
8071
|
-
return t * t * t;
|
|
8072
|
-
}
|
|
8073
|
-
static poly(n) {
|
|
8074
|
-
return (t) => t ** n;
|
|
8075
|
-
}
|
|
8076
|
-
static sin(t) {
|
|
8077
|
-
return 1 - Math.cos(t * Math.PI / 2);
|
|
8078
|
-
}
|
|
8079
|
-
static circle(t) {
|
|
8080
|
-
const u = clampUnit(t);
|
|
8081
|
-
return 1 - Math.sqrt(1 - u * u);
|
|
8082
|
-
}
|
|
8083
|
-
static exp(t) {
|
|
8084
|
-
return 2 ** (10 * (t - 1));
|
|
8085
|
-
}
|
|
8086
|
-
static elastic(bounciness = 1) {
|
|
8087
|
-
const p = bounciness * Math.PI;
|
|
8088
|
-
return (t) => 1 - Math.cos(t * Math.PI / 2) ** 3 * Math.cos(t * p);
|
|
8176
|
+
let extrapolateRight = "extend";
|
|
8177
|
+
if (options?.extrapolateRight !== undefined) {
|
|
8178
|
+
extrapolateRight = options.extrapolateRight;
|
|
8089
8179
|
}
|
|
8090
|
-
|
|
8091
|
-
|
|
8180
|
+
const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
|
|
8181
|
+
const range = findRange(posterizedInput, inputRange);
|
|
8182
|
+
return interpolateFunction(posterizedInput, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
|
|
8183
|
+
easing: resolveEasingForSegment(range),
|
|
8184
|
+
extrapolateLeft,
|
|
8185
|
+
extrapolateRight
|
|
8186
|
+
});
|
|
8187
|
+
};
|
|
8188
|
+
var interpolateString = ({
|
|
8189
|
+
input,
|
|
8190
|
+
inputRange,
|
|
8191
|
+
outputRange,
|
|
8192
|
+
options
|
|
8193
|
+
}) => {
|
|
8194
|
+
const parsedOutputRange = outputRange.map(parseStringInterpolationValue);
|
|
8195
|
+
const kind = parsedOutputRange[0]?.kind;
|
|
8196
|
+
if (kind === undefined) {
|
|
8197
|
+
throw new Error("outputRange must have at least 1 element");
|
|
8092
8198
|
}
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
return 7.5625 * u * u;
|
|
8097
|
-
}
|
|
8098
|
-
if (u < 2 / 2.75) {
|
|
8099
|
-
const t2_ = u - 1.5 / 2.75;
|
|
8100
|
-
return 7.5625 * t2_ * t2_ + 0.75;
|
|
8101
|
-
}
|
|
8102
|
-
if (u < 2.5 / 2.75) {
|
|
8103
|
-
const t2_ = u - 2.25 / 2.75;
|
|
8104
|
-
return 7.5625 * t2_ * t2_ + 0.9375;
|
|
8199
|
+
for (const parsed of parsedOutputRange) {
|
|
8200
|
+
if (parsed.kind !== kind) {
|
|
8201
|
+
throw new TypeError(`Cannot interpolate ${kind} values with ${parsed.kind} values`);
|
|
8105
8202
|
}
|
|
8106
|
-
const t2 = u - 2.625 / 2.75;
|
|
8107
|
-
return 7.5625 * t2 * t2 + 0.984375;
|
|
8108
|
-
}
|
|
8109
|
-
static bezier(x1, y1, x2, y2) {
|
|
8110
|
-
return bezier(x1, y1, x2, y2);
|
|
8111
|
-
}
|
|
8112
|
-
static in(easing) {
|
|
8113
|
-
return easing;
|
|
8114
|
-
}
|
|
8115
|
-
static out(easing) {
|
|
8116
|
-
return (t) => 1 - easing(1 - t);
|
|
8117
8203
|
}
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8204
|
+
const dimensions = Math.max(...parsedOutputRange.map((parsed) => parsed.dimensions));
|
|
8205
|
+
const units = [
|
|
8206
|
+
null,
|
|
8207
|
+
null,
|
|
8208
|
+
null
|
|
8209
|
+
];
|
|
8210
|
+
if (kind !== "scale") {
|
|
8211
|
+
for (let axis = 0;axis < dimensions; axis++) {
|
|
8212
|
+
for (const parsed of parsedOutputRange) {
|
|
8213
|
+
const unit = parsed.units[axis];
|
|
8214
|
+
if (unit === null) {
|
|
8215
|
+
continue;
|
|
8216
|
+
}
|
|
8217
|
+
if (units[axis] === null) {
|
|
8218
|
+
units[axis] = unit;
|
|
8219
|
+
continue;
|
|
8220
|
+
}
|
|
8221
|
+
if (units[axis] !== unit) {
|
|
8222
|
+
throw new TypeError(`Cannot interpolate ${kind} values with different units on axis ${axis + 1}: ${units[axis]} and ${unit}`);
|
|
8223
|
+
}
|
|
8224
|
+
}
|
|
8225
|
+
if (units[axis] === null) {
|
|
8226
|
+
throw new TypeError(`Cannot interpolate ${kind} values because axis ${axis + 1} has no unit`);
|
|
8122
8227
|
}
|
|
8123
|
-
return 1 - easing((1 - t) * 2) / 2;
|
|
8124
|
-
};
|
|
8125
|
-
}
|
|
8126
|
-
}
|
|
8127
|
-
function interpolateFunction(input, inputRange, outputRange, options) {
|
|
8128
|
-
const { extrapolateLeft, extrapolateRight, easing } = options;
|
|
8129
|
-
let result = input;
|
|
8130
|
-
const [inputMin, inputMax] = inputRange;
|
|
8131
|
-
const [outputMin, outputMax] = outputRange;
|
|
8132
|
-
if (result < inputMin) {
|
|
8133
|
-
if (extrapolateLeft === "identity") {
|
|
8134
|
-
return result;
|
|
8135
|
-
}
|
|
8136
|
-
if (extrapolateLeft === "clamp") {
|
|
8137
|
-
result = inputMin;
|
|
8138
|
-
} else if (extrapolateLeft === "wrap") {
|
|
8139
|
-
const range = inputMax - inputMin;
|
|
8140
|
-
result = ((result - inputMin) % range + range) % range + inputMin;
|
|
8141
|
-
} else if (extrapolateLeft === "extend") {}
|
|
8142
|
-
}
|
|
8143
|
-
if (result > inputMax) {
|
|
8144
|
-
if (extrapolateRight === "identity") {
|
|
8145
|
-
return result;
|
|
8146
|
-
}
|
|
8147
|
-
if (extrapolateRight === "clamp") {
|
|
8148
|
-
result = inputMax;
|
|
8149
|
-
} else if (extrapolateRight === "wrap") {
|
|
8150
|
-
const range = inputMax - inputMin;
|
|
8151
|
-
result = ((result - inputMin) % range + range) % range + inputMin;
|
|
8152
|
-
} else if (extrapolateRight === "extend") {}
|
|
8153
|
-
}
|
|
8154
|
-
if (outputMin === outputMax) {
|
|
8155
|
-
return outputMin;
|
|
8156
|
-
}
|
|
8157
|
-
result = (result - inputMin) / (inputMax - inputMin);
|
|
8158
|
-
result = easing(result);
|
|
8159
|
-
result = result * (outputMax - outputMin) + outputMin;
|
|
8160
|
-
return result;
|
|
8161
|
-
}
|
|
8162
|
-
function findRange(input, inputRange) {
|
|
8163
|
-
let i;
|
|
8164
|
-
for (i = 1;i < inputRange.length - 1; ++i) {
|
|
8165
|
-
if (inputRange[i] >= input) {
|
|
8166
|
-
break;
|
|
8167
8228
|
}
|
|
8168
8229
|
}
|
|
8169
|
-
return
|
|
8170
|
-
|
|
8230
|
+
return serializeStringInterpolationValue({
|
|
8231
|
+
kind,
|
|
8232
|
+
values: [0, 0, 0].map((_, axis) => interpolateNumber({
|
|
8233
|
+
input,
|
|
8234
|
+
inputRange,
|
|
8235
|
+
outputRange: parsedOutputRange.map((parsed) => parsed.values[axis]),
|
|
8236
|
+
options
|
|
8237
|
+
})),
|
|
8238
|
+
units,
|
|
8239
|
+
dimensions
|
|
8240
|
+
});
|
|
8241
|
+
};
|
|
8171
8242
|
function checkValidInputRange(arr) {
|
|
8172
8243
|
for (let i = 1;i < arr.length; ++i) {
|
|
8173
8244
|
if (!(arr[i] > arr[i - 1])) {
|
|
@@ -8227,42 +8298,27 @@ function interpolate2(input, inputRange, outputRange, options) {
|
|
|
8227
8298
|
throw new Error("inputRange (" + inputRange.length + ") and outputRange (" + outputRange.length + ") must have the same length");
|
|
8228
8299
|
}
|
|
8229
8300
|
checkInfiniteRange("inputRange", inputRange);
|
|
8230
|
-
checkInfiniteRange("outputRange", outputRange);
|
|
8231
8301
|
checkValidInputRange(inputRange);
|
|
8232
8302
|
assertValidInterpolateEasingOption(options?.easing, inputRange.length);
|
|
8233
8303
|
assertValidInterpolatePosterizeOption(options?.posterize);
|
|
8234
|
-
const easingOption = options?.easing;
|
|
8235
|
-
const defaultEasing = (num) => num;
|
|
8236
|
-
const resolveEasingForSegment = (segmentIndex) => {
|
|
8237
|
-
if (easingOption === undefined) {
|
|
8238
|
-
return defaultEasing;
|
|
8239
|
-
}
|
|
8240
|
-
if (typeof easingOption === "function") {
|
|
8241
|
-
return easingOption;
|
|
8242
|
-
}
|
|
8243
|
-
return easingOption[segmentIndex];
|
|
8244
|
-
};
|
|
8245
|
-
let extrapolateLeft = "extend";
|
|
8246
|
-
if (options?.extrapolateLeft !== undefined) {
|
|
8247
|
-
extrapolateLeft = options.extrapolateLeft;
|
|
8248
|
-
}
|
|
8249
|
-
let extrapolateRight = "extend";
|
|
8250
|
-
if (options?.extrapolateRight !== undefined) {
|
|
8251
|
-
extrapolateRight = options.extrapolateRight;
|
|
8252
|
-
}
|
|
8253
8304
|
if (typeof input !== "number") {
|
|
8254
8305
|
throw new TypeError("Cannot interpolate an input which is not a number");
|
|
8255
8306
|
}
|
|
8256
|
-
if (
|
|
8257
|
-
|
|
8307
|
+
if (!Array.isArray(outputRange)) {
|
|
8308
|
+
throw new Error("outputRange must contain only numbers");
|
|
8258
8309
|
}
|
|
8259
|
-
const
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
}
|
|
8310
|
+
const hasStringOutput = outputRange.some((output) => typeof output === "string");
|
|
8311
|
+
if (hasStringOutput) {
|
|
8312
|
+
if (!outputRange.every((output) => typeof output === "string" || typeof output === "number")) {
|
|
8313
|
+
throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");
|
|
8314
|
+
}
|
|
8315
|
+
return interpolateString({ input, inputRange, outputRange, options });
|
|
8316
|
+
}
|
|
8317
|
+
if (!outputRange.every((output) => typeof output === "number")) {
|
|
8318
|
+
throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");
|
|
8319
|
+
}
|
|
8320
|
+
checkInfiniteRange("outputRange", outputRange);
|
|
8321
|
+
return interpolateNumber({ input, inputRange, outputRange, options });
|
|
8266
8322
|
}
|
|
8267
8323
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
8268
8324
|
var PERCENTAGE = NUMBER + "%";
|
|
@@ -8738,76 +8794,370 @@ var interpolateColorsRGB = (value, inputRange, colors, options) => {
|
|
|
8738
8794
|
if (f === opacity) {
|
|
8739
8795
|
return Number(unrounded.toFixed(3));
|
|
8740
8796
|
}
|
|
8741
|
-
return Math.round(unrounded);
|
|
8742
|
-
});
|
|
8743
|
-
return rgbaColor(r2, g, b2, a2);
|
|
8797
|
+
return Math.round(unrounded);
|
|
8798
|
+
});
|
|
8799
|
+
return rgbaColor(r2, g, b2, a2);
|
|
8800
|
+
};
|
|
8801
|
+
var interpolateColors = (input, inputRange, outputRange, options) => {
|
|
8802
|
+
if (typeof input === "undefined") {
|
|
8803
|
+
throw new TypeError("input can not be undefined");
|
|
8804
|
+
}
|
|
8805
|
+
if (typeof inputRange === "undefined") {
|
|
8806
|
+
throw new TypeError("inputRange can not be undefined");
|
|
8807
|
+
}
|
|
8808
|
+
if (typeof outputRange === "undefined") {
|
|
8809
|
+
throw new TypeError("outputRange can not be undefined");
|
|
8810
|
+
}
|
|
8811
|
+
if (inputRange.length !== outputRange.length) {
|
|
8812
|
+
throw new TypeError("inputRange (" + inputRange.length + " values provided) and outputRange (" + outputRange.length + " values provided) must have the same length");
|
|
8813
|
+
}
|
|
8814
|
+
const processedOutputRange = outputRange.map((c2) => processColor(c2));
|
|
8815
|
+
return interpolateColorsRGB(input, inputRange, processedOutputRange, options);
|
|
8816
|
+
};
|
|
8817
|
+
var easingToFn = (e) => {
|
|
8818
|
+
if (e === "linear") {
|
|
8819
|
+
return Easing.linear;
|
|
8820
|
+
}
|
|
8821
|
+
return bezier(e[0], e[1], e[2], e[3]);
|
|
8822
|
+
};
|
|
8823
|
+
var interpolateKeyframedStatus = ({
|
|
8824
|
+
frame,
|
|
8825
|
+
status
|
|
8826
|
+
}) => {
|
|
8827
|
+
const { keyframes, easing, clamping, interpolationFunction } = status;
|
|
8828
|
+
if (keyframes.length === 0) {
|
|
8829
|
+
return null;
|
|
8830
|
+
}
|
|
8831
|
+
const inputRange = keyframes.map((k) => k.frame);
|
|
8832
|
+
const outputs = keyframes.map((k) => k.value);
|
|
8833
|
+
if (interpolationFunction === "interpolateColors") {
|
|
8834
|
+
if (!outputs.every((v) => typeof v === "string")) {
|
|
8835
|
+
return null;
|
|
8836
|
+
}
|
|
8837
|
+
if (keyframes.length === 1) {
|
|
8838
|
+
return outputs[0];
|
|
8839
|
+
}
|
|
8840
|
+
try {
|
|
8841
|
+
return interpolateColors(frame, inputRange, outputs, {
|
|
8842
|
+
posterize: status.posterize
|
|
8843
|
+
});
|
|
8844
|
+
} catch {
|
|
8845
|
+
return null;
|
|
8846
|
+
}
|
|
8847
|
+
}
|
|
8848
|
+
if (interpolationFunction !== "interpolate") {
|
|
8849
|
+
return null;
|
|
8850
|
+
}
|
|
8851
|
+
try {
|
|
8852
|
+
return interpolate2(frame, inputRange, outputs, {
|
|
8853
|
+
easing: easing.map(easingToFn),
|
|
8854
|
+
extrapolateLeft: clamping.left,
|
|
8855
|
+
extrapolateRight: clamping.right,
|
|
8856
|
+
posterize: status.posterize
|
|
8857
|
+
});
|
|
8858
|
+
} catch {
|
|
8859
|
+
return null;
|
|
8860
|
+
}
|
|
8861
|
+
};
|
|
8862
|
+
var resolveDragOverrideValue = ({
|
|
8863
|
+
dragOverrideValue,
|
|
8864
|
+
frame
|
|
8865
|
+
}) => {
|
|
8866
|
+
if (dragOverrideValue === undefined) {
|
|
8867
|
+
return { type: "none" };
|
|
8868
|
+
}
|
|
8869
|
+
if (dragOverrideValue.type === "static") {
|
|
8870
|
+
return { type: "resolved", value: dragOverrideValue.value };
|
|
8871
|
+
}
|
|
8872
|
+
if (frame === null) {
|
|
8873
|
+
return { type: "none" };
|
|
8874
|
+
}
|
|
8875
|
+
const interpolated = interpolateKeyframedStatus({
|
|
8876
|
+
frame,
|
|
8877
|
+
status: dragOverrideValue.status
|
|
8878
|
+
});
|
|
8879
|
+
if (interpolated === null) {
|
|
8880
|
+
return { type: "none" };
|
|
8881
|
+
}
|
|
8882
|
+
return { type: "resolved", value: interpolated };
|
|
8883
|
+
};
|
|
8884
|
+
var getEffectiveVisualModeValue = ({
|
|
8885
|
+
codeValue,
|
|
8886
|
+
dragOverrideValue,
|
|
8887
|
+
defaultValue,
|
|
8888
|
+
frame = null,
|
|
8889
|
+
shouldResortToDefaultValueIfUndefined = false
|
|
8890
|
+
}) => {
|
|
8891
|
+
const dragOverride = resolveDragOverrideValue({
|
|
8892
|
+
dragOverrideValue,
|
|
8893
|
+
frame
|
|
8894
|
+
});
|
|
8895
|
+
if (dragOverride.type === "resolved" && dragOverride.value !== undefined) {
|
|
8896
|
+
return dragOverride.value;
|
|
8897
|
+
}
|
|
8898
|
+
if (codeValue.status === "keyframed" && frame !== null) {
|
|
8899
|
+
return interpolateKeyframedStatus({
|
|
8900
|
+
frame,
|
|
8901
|
+
status: codeValue
|
|
8902
|
+
});
|
|
8903
|
+
}
|
|
8904
|
+
if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
|
|
8905
|
+
return defaultValue;
|
|
8906
|
+
}
|
|
8907
|
+
return codeValue.codeValue;
|
|
8908
|
+
};
|
|
8909
|
+
var OverrideIdsToNodePathsGettersContext = createContext16({
|
|
8910
|
+
overrideIdToNodePathMappings: {}
|
|
8911
|
+
});
|
|
8912
|
+
var OverrideIdsToNodePathsSettersContext = createContext16({
|
|
8913
|
+
setOverrideIdToNodePath: () => {
|
|
8914
|
+
throw new Error("OverrideIdsToNodePathsSettersContext not initialized");
|
|
8915
|
+
}
|
|
8916
|
+
});
|
|
8917
|
+
var mergeOverrides = ({
|
|
8918
|
+
descriptor,
|
|
8919
|
+
codeOverrides,
|
|
8920
|
+
dragOverrides,
|
|
8921
|
+
frame
|
|
8922
|
+
}) => {
|
|
8923
|
+
if (!codeOverrides && !dragOverrides) {
|
|
8924
|
+
return { params: descriptor.params, effectKey: descriptor.effectKey };
|
|
8925
|
+
}
|
|
8926
|
+
const merged = {
|
|
8927
|
+
...descriptor.params
|
|
8928
|
+
};
|
|
8929
|
+
if (codeOverrides) {
|
|
8930
|
+
for (const [key, value] of Object.entries(codeOverrides)) {
|
|
8931
|
+
if (value !== undefined) {
|
|
8932
|
+
merged[key] = value;
|
|
8933
|
+
}
|
|
8934
|
+
}
|
|
8935
|
+
}
|
|
8936
|
+
if (dragOverrides) {
|
|
8937
|
+
for (const [key, value] of Object.entries(dragOverrides)) {
|
|
8938
|
+
const resolved = resolveDragOverrideValue({
|
|
8939
|
+
dragOverrideValue: value,
|
|
8940
|
+
frame
|
|
8941
|
+
});
|
|
8942
|
+
if (resolved.type === "resolved") {
|
|
8943
|
+
merged[key] = resolved.value;
|
|
8944
|
+
}
|
|
8945
|
+
}
|
|
8946
|
+
}
|
|
8947
|
+
return {
|
|
8948
|
+
params: merged,
|
|
8949
|
+
effectKey: descriptor.definition.calculateKey(merged)
|
|
8950
|
+
};
|
|
8951
|
+
};
|
|
8952
|
+
var extractCodeOverrides = (propStatus) => {
|
|
8953
|
+
if (!propStatus) {
|
|
8954
|
+
return null;
|
|
8955
|
+
}
|
|
8956
|
+
const out = {};
|
|
8957
|
+
let hasAny = false;
|
|
8958
|
+
for (const [key, status] of Object.entries(propStatus)) {
|
|
8959
|
+
if (status.status !== "computed") {
|
|
8960
|
+
out[key] = status.codeValue;
|
|
8961
|
+
hasAny = true;
|
|
8962
|
+
}
|
|
8963
|
+
}
|
|
8964
|
+
return hasAny ? out : null;
|
|
8965
|
+
};
|
|
8966
|
+
var useMemoizedEffectDefinitions = (effects) => {
|
|
8967
|
+
const previousRef = useRef5(null);
|
|
8968
|
+
const definitions = effects.map((descriptor) => descriptor.definition);
|
|
8969
|
+
const previous = previousRef.current;
|
|
8970
|
+
const isSame = previous !== null && previous.length === definitions.length && previous.every((def, i) => def === definitions[i]);
|
|
8971
|
+
if (isSame) {
|
|
8972
|
+
return previous;
|
|
8973
|
+
}
|
|
8974
|
+
previousRef.current = definitions;
|
|
8975
|
+
return definitions;
|
|
8976
|
+
};
|
|
8977
|
+
var getEffectCodeValuesCtx = ({
|
|
8978
|
+
codeValues,
|
|
8979
|
+
nodePath,
|
|
8980
|
+
effectIndex
|
|
8981
|
+
}) => {
|
|
8982
|
+
const status = codeValues[makeSequencePropsSubscriptionKey(nodePath)];
|
|
8983
|
+
if (!status) {
|
|
8984
|
+
return { type: "cannot-update-sequence", reason: "not-found" };
|
|
8985
|
+
}
|
|
8986
|
+
if (!status.canUpdate) {
|
|
8987
|
+
return { type: "cannot-update-sequence", reason: status.reason };
|
|
8988
|
+
}
|
|
8989
|
+
const effect = status.effects.find((e) => e.effectIndex === effectIndex);
|
|
8990
|
+
if (!effect) {
|
|
8991
|
+
return { type: "cannot-update-effect", reason: "not-found" };
|
|
8992
|
+
}
|
|
8993
|
+
if (!effect.canUpdate) {
|
|
8994
|
+
return { type: "cannot-update-effect", reason: effect.reason };
|
|
8995
|
+
}
|
|
8996
|
+
return { type: "can-update-effect", props: effect.props };
|
|
8997
|
+
};
|
|
8998
|
+
var getCodeValuesCtx = (codeValues, nodePath) => {
|
|
8999
|
+
const status = codeValues[makeSequencePropsSubscriptionKey(nodePath)];
|
|
9000
|
+
if (!status) {
|
|
9001
|
+
return;
|
|
9002
|
+
}
|
|
9003
|
+
if (!status.canUpdate) {
|
|
9004
|
+
return;
|
|
9005
|
+
}
|
|
9006
|
+
return status.props;
|
|
9007
|
+
};
|
|
9008
|
+
var useMemoizedEffects = ({
|
|
9009
|
+
effects,
|
|
9010
|
+
overrideId
|
|
9011
|
+
}) => {
|
|
9012
|
+
const previousRef = useRef5(null);
|
|
9013
|
+
const { codeValues } = useContext15(VisualModeCodeValuesContext);
|
|
9014
|
+
const { getEffectDragOverrides } = useContext15(VisualModeDragOverridesContext);
|
|
9015
|
+
const frame = useCurrentFrame();
|
|
9016
|
+
const { overrideIdToNodePathMappings } = useContext15(OverrideIdsToNodePathsGettersContext);
|
|
9017
|
+
const previous = previousRef.current;
|
|
9018
|
+
const nodePath = overrideId ? overrideIdToNodePathMappings[overrideId] ?? null : null;
|
|
9019
|
+
const resolved = effects.map((descriptor, index) => {
|
|
9020
|
+
if (nodePath === null) {
|
|
9021
|
+
return {
|
|
9022
|
+
descriptor,
|
|
9023
|
+
params: descriptor.params,
|
|
9024
|
+
effectKey: descriptor.effectKey
|
|
9025
|
+
};
|
|
9026
|
+
}
|
|
9027
|
+
const effectStatus = getEffectCodeValuesCtx({
|
|
9028
|
+
codeValues,
|
|
9029
|
+
nodePath,
|
|
9030
|
+
effectIndex: index
|
|
9031
|
+
});
|
|
9032
|
+
const codeOverrides = effectStatus.type === "can-update-effect" ? extractCodeOverrides(effectStatus.props) : null;
|
|
9033
|
+
const dragOverridesMap = getEffectDragOverrides(nodePath, index);
|
|
9034
|
+
const dragOverrides = Object.keys(dragOverridesMap).length === 0 ? null : dragOverridesMap;
|
|
9035
|
+
const { params, effectKey } = mergeOverrides({
|
|
9036
|
+
descriptor,
|
|
9037
|
+
codeOverrides,
|
|
9038
|
+
dragOverrides,
|
|
9039
|
+
frame
|
|
9040
|
+
});
|
|
9041
|
+
return { descriptor, params, effectKey };
|
|
9042
|
+
});
|
|
9043
|
+
const isSame = previous !== null && previous.length === resolved.length && previous.every((p, i) => p.definition === resolved[i].descriptor.definition && p.effectKey === resolved[i].effectKey);
|
|
9044
|
+
if (isSame) {
|
|
9045
|
+
return previous;
|
|
9046
|
+
}
|
|
9047
|
+
const next = resolved.map(({ descriptor, params, effectKey }) => ({
|
|
9048
|
+
definition: descriptor.definition,
|
|
9049
|
+
effectKey,
|
|
9050
|
+
params,
|
|
9051
|
+
memoized: true
|
|
9052
|
+
}));
|
|
9053
|
+
previousRef.current = next;
|
|
9054
|
+
return next;
|
|
9055
|
+
};
|
|
9056
|
+
var flattenActiveSchema = (schema, resolve) => {
|
|
9057
|
+
const out = {};
|
|
9058
|
+
for (const key of Object.keys(schema)) {
|
|
9059
|
+
const field = schema[key];
|
|
9060
|
+
if (field.type === "hidden") {
|
|
9061
|
+
continue;
|
|
9062
|
+
} else if (field.type === "enum") {
|
|
9063
|
+
out[key] = field;
|
|
9064
|
+
const current = resolve(key) ?? field.default;
|
|
9065
|
+
const variant = field.variants[current];
|
|
9066
|
+
if (variant) {
|
|
9067
|
+
Object.assign(out, flattenActiveSchema(variant, resolve));
|
|
9068
|
+
}
|
|
9069
|
+
} else {
|
|
9070
|
+
out[key] = field;
|
|
9071
|
+
}
|
|
9072
|
+
}
|
|
9073
|
+
return out;
|
|
9074
|
+
};
|
|
9075
|
+
var getFlatSchemaWithAllKeys = (schema) => {
|
|
9076
|
+
const out = {};
|
|
9077
|
+
const addKey = (key, field) => {
|
|
9078
|
+
if (key in out) {
|
|
9079
|
+
throw new Error(`Duplicate key "${key}" in schema: discriminated union variants must not share keys`);
|
|
9080
|
+
}
|
|
9081
|
+
out[key] = field;
|
|
9082
|
+
};
|
|
9083
|
+
for (const key of Object.keys(schema)) {
|
|
9084
|
+
const field = schema[key];
|
|
9085
|
+
addKey(key, field);
|
|
9086
|
+
if (field.type === "enum") {
|
|
9087
|
+
for (const variant of Object.values(field.variants)) {
|
|
9088
|
+
const flatVariant = getFlatSchemaWithAllKeys(variant);
|
|
9089
|
+
for (const variantKey of Object.keys(flatVariant)) {
|
|
9090
|
+
addKey(variantKey, flatVariant[variantKey]);
|
|
9091
|
+
}
|
|
9092
|
+
}
|
|
9093
|
+
}
|
|
9094
|
+
}
|
|
9095
|
+
return out;
|
|
8744
9096
|
};
|
|
8745
|
-
var
|
|
8746
|
-
|
|
8747
|
-
|
|
9097
|
+
var findPropsToDelete = ({
|
|
9098
|
+
schema,
|
|
9099
|
+
key,
|
|
9100
|
+
value
|
|
9101
|
+
}) => {
|
|
9102
|
+
const fieldSchema = schema[key];
|
|
9103
|
+
if (!fieldSchema) {
|
|
9104
|
+
throw new Error("Key " + JSON.stringify(key) + " not found in schema");
|
|
8748
9105
|
}
|
|
8749
|
-
if (typeof
|
|
8750
|
-
throw new
|
|
9106
|
+
if (typeof value !== "string") {
|
|
9107
|
+
throw new Error("Value must be a string, but is " + JSON.stringify(value));
|
|
8751
9108
|
}
|
|
8752
|
-
if (
|
|
8753
|
-
throw new
|
|
9109
|
+
if (fieldSchema.type !== "enum") {
|
|
9110
|
+
throw new Error("Key " + JSON.stringify(key) + " is not an enum");
|
|
8754
9111
|
}
|
|
8755
|
-
|
|
8756
|
-
|
|
9112
|
+
const currentVariant = fieldSchema.variants[value];
|
|
9113
|
+
if (!currentVariant) {
|
|
9114
|
+
throw new Error("Value for " + JSON.stringify(key) + " must be one of " + Object.keys(fieldSchema.variants).map((v) => JSON.stringify(v)).join(", ") + ", got " + JSON.stringify(value));
|
|
8757
9115
|
}
|
|
8758
|
-
const
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
9116
|
+
const otherVariants = Object.keys(fieldSchema.variants).filter((v) => v !== value);
|
|
9117
|
+
const otherKeys = new Set;
|
|
9118
|
+
for (const variant of otherVariants) {
|
|
9119
|
+
const otherVariant = fieldSchema.variants[variant];
|
|
9120
|
+
const keys = Object.keys(otherVariant);
|
|
9121
|
+
for (const k of keys) {
|
|
9122
|
+
otherKeys.add(k);
|
|
9123
|
+
}
|
|
8764
9124
|
}
|
|
8765
|
-
return
|
|
9125
|
+
return [...otherKeys];
|
|
8766
9126
|
};
|
|
8767
|
-
var
|
|
9127
|
+
var makeStaticDragOverride = (value) => {
|
|
9128
|
+
return { type: "static", value };
|
|
9129
|
+
};
|
|
9130
|
+
var makeKeyframedDragOverride = ({
|
|
9131
|
+
status,
|
|
8768
9132
|
frame,
|
|
8769
|
-
|
|
9133
|
+
value
|
|
8770
9134
|
}) => {
|
|
8771
|
-
const
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
const outputs = keyframes.map((k) => k.value);
|
|
8777
|
-
if (interpolationFunction === "interpolateColors") {
|
|
8778
|
-
if (!outputs.every((v) => typeof v === "string")) {
|
|
8779
|
-
return null;
|
|
8780
|
-
}
|
|
8781
|
-
if (keyframes.length === 1) {
|
|
8782
|
-
return outputs[0];
|
|
8783
|
-
}
|
|
8784
|
-
try {
|
|
8785
|
-
return interpolateColors(frame, inputRange, outputs, {
|
|
8786
|
-
posterize: status.posterize
|
|
8787
|
-
});
|
|
8788
|
-
} catch {
|
|
8789
|
-
return null;
|
|
8790
|
-
}
|
|
8791
|
-
}
|
|
8792
|
-
if (interpolationFunction !== "interpolate") {
|
|
8793
|
-
return null;
|
|
8794
|
-
}
|
|
8795
|
-
if (!outputs.every((v) => typeof v === "number")) {
|
|
8796
|
-
return null;
|
|
9135
|
+
const existingIndex = status.keyframes.findIndex((keyframe) => keyframe.frame === frame);
|
|
9136
|
+
const keyframes = existingIndex === -1 ? [...status.keyframes, { frame, value }].sort((first, second) => first.frame - second.frame) : status.keyframes.map((keyframe, index) => index === existingIndex ? { frame, value } : keyframe);
|
|
9137
|
+
const easing = [...status.easing];
|
|
9138
|
+
while (easing.length < keyframes.length - 1) {
|
|
9139
|
+
easing.push("linear");
|
|
8797
9140
|
}
|
|
8798
|
-
if (keyframes.length
|
|
8799
|
-
|
|
9141
|
+
if (easing.length > keyframes.length - 1) {
|
|
9142
|
+
easing.length = keyframes.length - 1;
|
|
8800
9143
|
}
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
}
|
|
8808
|
-
}
|
|
8809
|
-
|
|
9144
|
+
return {
|
|
9145
|
+
type: "keyframed",
|
|
9146
|
+
status: {
|
|
9147
|
+
...status,
|
|
9148
|
+
keyframes,
|
|
9149
|
+
easing
|
|
9150
|
+
}
|
|
9151
|
+
};
|
|
9152
|
+
};
|
|
9153
|
+
var getStaticDragOverrideValue = (dragOverrideValue) => {
|
|
9154
|
+
if (dragOverrideValue?.type !== "static") {
|
|
9155
|
+
return;
|
|
8810
9156
|
}
|
|
9157
|
+
return dragOverrideValue.value;
|
|
9158
|
+
};
|
|
9159
|
+
var isKeyframedStatus = (status) => {
|
|
9160
|
+
return status !== null && status.status === "keyframed";
|
|
8811
9161
|
};
|
|
8812
9162
|
var findFieldInSchema = (schema, key) => {
|
|
8813
9163
|
if (key in schema) {
|
|
@@ -8844,21 +9194,34 @@ var computeEffectiveSchemaValuesDotNotation = ({
|
|
|
8844
9194
|
let value;
|
|
8845
9195
|
if (codeValueStatus === null) {
|
|
8846
9196
|
value = currentValue[key];
|
|
8847
|
-
} else if (codeValueStatus
|
|
8848
|
-
if (
|
|
8849
|
-
const interpolated = interpolateKeyframedStatus({
|
|
8850
|
-
frame,
|
|
8851
|
-
status: codeValueStatus
|
|
8852
|
-
});
|
|
8853
|
-
value = interpolated ?? currentValue[key];
|
|
8854
|
-
} else {
|
|
9197
|
+
} else if (isKeyframedStatus(codeValueStatus)) {
|
|
9198
|
+
if (field?.type === "array" || field?.keyframable === false) {
|
|
8855
9199
|
value = currentValue[key];
|
|
9200
|
+
} else {
|
|
9201
|
+
const dragOverride = resolveDragOverrideValue({
|
|
9202
|
+
dragOverrideValue: overrideValues[key],
|
|
9203
|
+
frame
|
|
9204
|
+
});
|
|
9205
|
+
if (dragOverride.type === "resolved") {
|
|
9206
|
+
value = dragOverride.value;
|
|
9207
|
+
} else if (frame !== null) {
|
|
9208
|
+
const interpolated = interpolateKeyframedStatus({
|
|
9209
|
+
frame,
|
|
9210
|
+
status: codeValueStatus
|
|
9211
|
+
});
|
|
9212
|
+
value = interpolated ?? currentValue[key];
|
|
9213
|
+
} else {
|
|
9214
|
+
value = currentValue[key];
|
|
9215
|
+
}
|
|
8856
9216
|
}
|
|
9217
|
+
} else if (codeValueStatus.status === "computed") {
|
|
9218
|
+
value = currentValue[key];
|
|
8857
9219
|
} else {
|
|
8858
9220
|
value = getEffectiveVisualModeValue({
|
|
8859
9221
|
codeValue: codeValueStatus,
|
|
8860
9222
|
dragOverrideValue: overrideValues[key],
|
|
8861
9223
|
defaultValue: field?.default,
|
|
9224
|
+
frame,
|
|
8862
9225
|
shouldResortToDefaultValueIfUndefined: false
|
|
8863
9226
|
});
|
|
8864
9227
|
}
|
|
@@ -8931,13 +9294,17 @@ var mergeValues = ({
|
|
|
8931
9294
|
return merged;
|
|
8932
9295
|
};
|
|
8933
9296
|
var stackToOverrideMap = {};
|
|
8934
|
-
var wrapInSchema = (
|
|
9297
|
+
var wrapInSchema = ({
|
|
9298
|
+
Component,
|
|
9299
|
+
schema,
|
|
9300
|
+
supportsEffects
|
|
9301
|
+
}) => {
|
|
8935
9302
|
const flatSchema = getFlatSchemaWithAllKeys(schema);
|
|
8936
9303
|
const flatKeys = Object.keys(flatSchema);
|
|
8937
9304
|
const Wrapped = forwardRef2((props, ref) => {
|
|
8938
9305
|
const env = useRemotionEnvironment();
|
|
8939
9306
|
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
|
|
8940
|
-
return
|
|
9307
|
+
return React13.createElement(Component, {
|
|
8941
9308
|
...props,
|
|
8942
9309
|
_experimentalControls: null,
|
|
8943
9310
|
ref
|
|
@@ -8948,7 +9315,7 @@ var wrapInSchema = (Component, schema) => {
|
|
|
8948
9315
|
const nodePathMapping = useContext16(OverrideIdsToNodePathsGettersContext);
|
|
8949
9316
|
const frame = useCurrentFrame();
|
|
8950
9317
|
if (props._experimentalControls) {
|
|
8951
|
-
return
|
|
9318
|
+
return React13.createElement(Component, {
|
|
8952
9319
|
...props,
|
|
8953
9320
|
ref
|
|
8954
9321
|
});
|
|
@@ -8973,7 +9340,8 @@ var wrapInSchema = (Component, schema) => {
|
|
|
8973
9340
|
return {
|
|
8974
9341
|
schema,
|
|
8975
9342
|
currentRuntimeValueDotNotation,
|
|
8976
|
-
overrideId
|
|
9343
|
+
overrideId,
|
|
9344
|
+
supportsEffects
|
|
8977
9345
|
};
|
|
8978
9346
|
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
8979
9347
|
const { merged: valuesDotNotation, propsToDelete } = useMemo13(() => {
|
|
@@ -8998,7 +9366,7 @@ var wrapInSchema = (Component, schema) => {
|
|
|
8998
9366
|
schemaKeys: activeKeys,
|
|
8999
9367
|
propsToDelete
|
|
9000
9368
|
});
|
|
9001
|
-
return
|
|
9369
|
+
return React13.createElement(Component, {
|
|
9002
9370
|
...mergedProps,
|
|
9003
9371
|
_experimentalControls: controls,
|
|
9004
9372
|
ref
|
|
@@ -9007,6 +9375,7 @@ var wrapInSchema = (Component, schema) => {
|
|
|
9007
9375
|
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
9008
9376
|
return Wrapped;
|
|
9009
9377
|
};
|
|
9378
|
+
var EMPTY_EFFECTS = [];
|
|
9010
9379
|
var RegularSequenceRefForwardingFunction = ({
|
|
9011
9380
|
from = 0,
|
|
9012
9381
|
durationInFrames = Infinity,
|
|
@@ -9101,6 +9470,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
9101
9470
|
}, [name]);
|
|
9102
9471
|
const resolvedDocumentationLink = documentationLink ?? (name === undefined ? "https://www.remotion.dev/docs/sequence" : null);
|
|
9103
9472
|
const env = useRemotionEnvironment();
|
|
9473
|
+
const isInsideSeries = useContext17(IsInsideSeriesContext);
|
|
9104
9474
|
const inheritedStack = other?.stack ?? null;
|
|
9105
9475
|
const stackRef = useRef6(null);
|
|
9106
9476
|
stackRef.current = stack ?? inheritedStack;
|
|
@@ -9113,7 +9483,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
9113
9483
|
registerSequence({
|
|
9114
9484
|
type: "image",
|
|
9115
9485
|
controls: controls ?? null,
|
|
9116
|
-
effects: _remotionInternalEffects ??
|
|
9486
|
+
effects: _remotionInternalEffects ?? EMPTY_EFFECTS,
|
|
9117
9487
|
displayName: timelineClipName,
|
|
9118
9488
|
documentationLink: resolvedDocumentationLink,
|
|
9119
9489
|
duration: actualDurationInFrames,
|
|
@@ -9128,13 +9498,14 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
9128
9498
|
showInTimeline,
|
|
9129
9499
|
src: isMedia.src,
|
|
9130
9500
|
getStack: () => stackRef.current,
|
|
9131
|
-
refForOutline: refForOutline ?? null
|
|
9501
|
+
refForOutline: refForOutline ?? null,
|
|
9502
|
+
isInsideSeries
|
|
9132
9503
|
});
|
|
9133
9504
|
} else {
|
|
9134
9505
|
registerSequence({
|
|
9135
9506
|
type: isMedia.type,
|
|
9136
9507
|
controls: controls ?? null,
|
|
9137
|
-
effects: _remotionInternalEffects ??
|
|
9508
|
+
effects: _remotionInternalEffects ?? EMPTY_EFFECTS,
|
|
9138
9509
|
displayName: timelineClipName,
|
|
9139
9510
|
documentationLink: resolvedDocumentationLink,
|
|
9140
9511
|
doesVolumeChange: isMedia.data.doesVolumeChange,
|
|
@@ -9153,7 +9524,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
9153
9524
|
getStack: () => stackRef.current,
|
|
9154
9525
|
startMediaFrom: isMedia.data.startMediaFrom,
|
|
9155
9526
|
volume: isMedia.data.volumes,
|
|
9156
|
-
refForOutline: refForOutline ?? null
|
|
9527
|
+
refForOutline: refForOutline ?? null,
|
|
9528
|
+
isInsideSeries
|
|
9157
9529
|
});
|
|
9158
9530
|
}
|
|
9159
9531
|
return () => {
|
|
@@ -9176,8 +9548,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
9176
9548
|
premountDisplay: premountDisplay ?? null,
|
|
9177
9549
|
postmountDisplay: postmountDisplay ?? null,
|
|
9178
9550
|
controls: controls ?? null,
|
|
9179
|
-
effects: _remotionInternalEffects ??
|
|
9180
|
-
refForOutline: refForOutline ?? null
|
|
9551
|
+
effects: _remotionInternalEffects ?? EMPTY_EFFECTS,
|
|
9552
|
+
refForOutline: refForOutline ?? null,
|
|
9553
|
+
isInsideSeries
|
|
9181
9554
|
});
|
|
9182
9555
|
return () => {
|
|
9183
9556
|
unregisterSequence(id);
|
|
@@ -9203,7 +9576,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
9203
9576
|
_remotionInternalEffects,
|
|
9204
9577
|
isMedia,
|
|
9205
9578
|
resolvedDocumentationLink,
|
|
9206
|
-
refForOutline
|
|
9579
|
+
refForOutline,
|
|
9580
|
+
isInsideSeries
|
|
9207
9581
|
]);
|
|
9208
9582
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
9209
9583
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
@@ -9222,9 +9596,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
9222
9596
|
if (hidden) {
|
|
9223
9597
|
return null;
|
|
9224
9598
|
}
|
|
9225
|
-
return /* @__PURE__ */
|
|
9599
|
+
return /* @__PURE__ */ jsx12(SequenceContext.Provider, {
|
|
9226
9600
|
value: contextValue,
|
|
9227
|
-
children: content === null ? null : other.layout === "none" ? content : /* @__PURE__ */
|
|
9601
|
+
children: content === null ? null : other.layout === "none" ? content : /* @__PURE__ */ jsx12(AbsoluteFill, {
|
|
9228
9602
|
ref,
|
|
9229
9603
|
style: defaultStyle,
|
|
9230
9604
|
className: other.className,
|
|
@@ -9269,10 +9643,10 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
9269
9643
|
styleWhilePremounted,
|
|
9270
9644
|
styleWhilePostmounted
|
|
9271
9645
|
]);
|
|
9272
|
-
return /* @__PURE__ */
|
|
9646
|
+
return /* @__PURE__ */ jsx12(Freeze, {
|
|
9273
9647
|
frame: freezeFrame,
|
|
9274
9648
|
active: isFreezingActive,
|
|
9275
|
-
children: /* @__PURE__ */
|
|
9649
|
+
children: /* @__PURE__ */ jsx12(SequenceInner, {
|
|
9276
9650
|
ref,
|
|
9277
9651
|
from,
|
|
9278
9652
|
durationInFrames,
|
|
@@ -9292,20 +9666,24 @@ var SequenceRefForwardingFunction = (props, ref) => {
|
|
|
9292
9666
|
if (props.layout !== "none" && !env.isRendering) {
|
|
9293
9667
|
const effectivePremountFor = ENABLE_V5_BREAKING_CHANGES ? props.premountFor ?? fps : props.premountFor;
|
|
9294
9668
|
if (effectivePremountFor || props.postmountFor) {
|
|
9295
|
-
return /* @__PURE__ */
|
|
9669
|
+
return /* @__PURE__ */ jsx12(PremountedPostmountedSequence, {
|
|
9296
9670
|
ref,
|
|
9297
9671
|
...props,
|
|
9298
9672
|
premountFor: effectivePremountFor
|
|
9299
9673
|
});
|
|
9300
9674
|
}
|
|
9301
9675
|
}
|
|
9302
|
-
return /* @__PURE__ */
|
|
9676
|
+
return /* @__PURE__ */ jsx12(RegularSequence, {
|
|
9303
9677
|
...props,
|
|
9304
9678
|
ref
|
|
9305
9679
|
});
|
|
9306
9680
|
};
|
|
9307
9681
|
var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
|
|
9308
|
-
var Sequence = wrapInSchema(
|
|
9682
|
+
var Sequence = wrapInSchema({
|
|
9683
|
+
Component: SequenceInner,
|
|
9684
|
+
schema: sequenceSchema,
|
|
9685
|
+
supportsEffects: false
|
|
9686
|
+
});
|
|
9309
9687
|
var calculateImageFit = (fit, imageSize, canvasSize) => {
|
|
9310
9688
|
switch (fit) {
|
|
9311
9689
|
case "fill": {
|
|
@@ -9672,13 +10050,13 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
|
|
|
9672
10050
|
}
|
|
9673
10051
|
};
|
|
9674
10052
|
}, [draw]);
|
|
9675
|
-
return /* @__PURE__ */
|
|
10053
|
+
return /* @__PURE__ */ jsx13("canvas", {
|
|
9676
10054
|
ref: canvasRef,
|
|
9677
10055
|
className,
|
|
9678
10056
|
style
|
|
9679
10057
|
});
|
|
9680
10058
|
};
|
|
9681
|
-
var Canvas =
|
|
10059
|
+
var Canvas = React15.forwardRef(CanvasRefForwardingFunction);
|
|
9682
10060
|
var CACHE_SIZE = 5;
|
|
9683
10061
|
var getActualTime = ({
|
|
9684
10062
|
loopBehavior,
|
|
@@ -9690,13 +10068,14 @@ var getActualTime = ({
|
|
|
9690
10068
|
var decodeImage = async ({
|
|
9691
10069
|
resolvedSrc,
|
|
9692
10070
|
signal,
|
|
10071
|
+
requestInit,
|
|
9693
10072
|
currentTime,
|
|
9694
10073
|
initialLoopBehavior
|
|
9695
10074
|
}) => {
|
|
9696
10075
|
if (typeof ImageDecoder === "undefined") {
|
|
9697
10076
|
throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");
|
|
9698
10077
|
}
|
|
9699
|
-
const res = await fetch(resolvedSrc, { signal });
|
|
10078
|
+
const res = await fetch(resolvedSrc, { ...requestInit, signal });
|
|
9700
10079
|
const { body } = res;
|
|
9701
10080
|
if (!body) {
|
|
9702
10081
|
throw new Error("Got no body");
|
|
@@ -9819,6 +10198,18 @@ var decodeImage = async ({
|
|
|
9819
10198
|
frameCount: selectedTrack.frameCount
|
|
9820
10199
|
};
|
|
9821
10200
|
};
|
|
10201
|
+
var serializeRequestInit = (requestInit) => {
|
|
10202
|
+
if (!requestInit) {
|
|
10203
|
+
return null;
|
|
10204
|
+
}
|
|
10205
|
+
const requestInitWithoutSignal = { ...requestInit };
|
|
10206
|
+
delete requestInitWithoutSignal.signal;
|
|
10207
|
+
const { headers, ...rest } = requestInitWithoutSignal;
|
|
10208
|
+
return JSON.stringify({
|
|
10209
|
+
...rest,
|
|
10210
|
+
headers: headers ? Array.from(new Headers(headers).entries()) : null
|
|
10211
|
+
});
|
|
10212
|
+
};
|
|
9822
10213
|
var resolveAnimatedImageSource = (src) => {
|
|
9823
10214
|
if (typeof window === "undefined") {
|
|
9824
10215
|
return src;
|
|
@@ -9826,13 +10217,17 @@ var resolveAnimatedImageSource = (src) => {
|
|
|
9826
10217
|
return new URL(src, window.origin).href;
|
|
9827
10218
|
};
|
|
9828
10219
|
var animatedImageSchema = {
|
|
10220
|
+
durationInFrames: durationInFramesField,
|
|
10221
|
+
from: fromField,
|
|
9829
10222
|
playbackRate: {
|
|
9830
10223
|
type: "number",
|
|
9831
10224
|
min: 0,
|
|
9832
10225
|
max: 10,
|
|
9833
10226
|
step: 0.1,
|
|
9834
10227
|
default: 1,
|
|
9835
|
-
description: "Playback Rate"
|
|
10228
|
+
description: "Playback Rate",
|
|
10229
|
+
hiddenFromList: false,
|
|
10230
|
+
keyframable: false
|
|
9836
10231
|
},
|
|
9837
10232
|
...sequenceVisualStyleSchema,
|
|
9838
10233
|
hidden: hiddenField
|
|
@@ -9845,6 +10240,7 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
9845
10240
|
loopBehavior = "loop",
|
|
9846
10241
|
playbackRate = 1,
|
|
9847
10242
|
fit = "fill",
|
|
10243
|
+
requestInit,
|
|
9848
10244
|
effects,
|
|
9849
10245
|
controls,
|
|
9850
10246
|
...props
|
|
@@ -9858,6 +10254,9 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
9858
10254
|
const currentTime = frame / playbackRate / fps;
|
|
9859
10255
|
const currentTimeRef = useRef9(currentTime);
|
|
9860
10256
|
currentTimeRef.current = currentTime;
|
|
10257
|
+
const requestInitKey = serializeRequestInit(requestInit);
|
|
10258
|
+
const requestInitRef = useRef9(requestInit);
|
|
10259
|
+
requestInitRef.current = requestInit;
|
|
9861
10260
|
const ref = useRef9(null);
|
|
9862
10261
|
const memoizedEffects = useMemoizedEffects({
|
|
9863
10262
|
effects,
|
|
@@ -9876,6 +10275,7 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
9876
10275
|
decodeImage({
|
|
9877
10276
|
resolvedSrc,
|
|
9878
10277
|
signal: controller.signal,
|
|
10278
|
+
requestInit: requestInitRef.current,
|
|
9879
10279
|
currentTime: currentTimeRef.current,
|
|
9880
10280
|
initialLoopBehavior
|
|
9881
10281
|
}).then((d) => {
|
|
@@ -9900,6 +10300,7 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
9900
10300
|
resolvedSrc,
|
|
9901
10301
|
decodeHandle,
|
|
9902
10302
|
onError,
|
|
10303
|
+
requestInitKey,
|
|
9903
10304
|
initialLoopBehavior,
|
|
9904
10305
|
continueRender2
|
|
9905
10306
|
]);
|
|
@@ -9950,7 +10351,7 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
9950
10351
|
width,
|
|
9951
10352
|
height
|
|
9952
10353
|
]);
|
|
9953
|
-
return /* @__PURE__ */
|
|
10354
|
+
return /* @__PURE__ */ jsx14(Canvas, {
|
|
9954
10355
|
ref,
|
|
9955
10356
|
width,
|
|
9956
10357
|
height,
|
|
@@ -9972,6 +10373,7 @@ var AnimatedImageInner = ({
|
|
|
9972
10373
|
className,
|
|
9973
10374
|
style,
|
|
9974
10375
|
durationInFrames,
|
|
10376
|
+
requestInit,
|
|
9975
10377
|
effects = [],
|
|
9976
10378
|
_experimentalControls: controls,
|
|
9977
10379
|
ref,
|
|
@@ -9979,7 +10381,11 @@ var AnimatedImageInner = ({
|
|
|
9979
10381
|
}) => {
|
|
9980
10382
|
const { durationInFrames: videoDuration } = useVideoConfig();
|
|
9981
10383
|
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
10384
|
+
const actualRef = useRef9(null);
|
|
9982
10385
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
10386
|
+
useImperativeHandle2(ref, () => {
|
|
10387
|
+
return actualRef.current;
|
|
10388
|
+
}, []);
|
|
9983
10389
|
const animatedImageProps = {
|
|
9984
10390
|
src,
|
|
9985
10391
|
width,
|
|
@@ -9990,9 +10396,10 @@ var AnimatedImageInner = ({
|
|
|
9990
10396
|
loopBehavior,
|
|
9991
10397
|
id,
|
|
9992
10398
|
className,
|
|
9993
|
-
style
|
|
10399
|
+
style,
|
|
10400
|
+
requestInit
|
|
9994
10401
|
};
|
|
9995
|
-
return /* @__PURE__ */
|
|
10402
|
+
return /* @__PURE__ */ jsx14(Sequence, {
|
|
9996
10403
|
layout: "none",
|
|
9997
10404
|
durationInFrames: resolvedDuration,
|
|
9998
10405
|
name: "<AnimatedImage>",
|
|
@@ -10000,15 +10407,20 @@ var AnimatedImageInner = ({
|
|
|
10000
10407
|
_experimentalControls: controls,
|
|
10001
10408
|
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
10002
10409
|
...sequenceProps,
|
|
10003
|
-
|
|
10410
|
+
_remotionInternalRefForOutline: actualRef,
|
|
10411
|
+
children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
|
|
10004
10412
|
...animatedImageProps,
|
|
10005
|
-
ref,
|
|
10413
|
+
ref: actualRef,
|
|
10006
10414
|
effects,
|
|
10007
10415
|
controls
|
|
10008
10416
|
})
|
|
10009
10417
|
});
|
|
10010
10418
|
};
|
|
10011
|
-
var AnimatedImage = wrapInSchema(
|
|
10419
|
+
var AnimatedImage = wrapInSchema({
|
|
10420
|
+
Component: AnimatedImageInner,
|
|
10421
|
+
schema: animatedImageSchema,
|
|
10422
|
+
supportsEffects: true
|
|
10423
|
+
});
|
|
10012
10424
|
AnimatedImage.displayName = "AnimatedImage";
|
|
10013
10425
|
addSequenceStackTraces(AnimatedImage);
|
|
10014
10426
|
var validateArtifactFilename = (filename) => {
|
|
@@ -10040,7 +10452,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
10040
10452
|
}
|
|
10041
10453
|
validateContent(artifact.content);
|
|
10042
10454
|
};
|
|
10043
|
-
var RenderAssetManager =
|
|
10455
|
+
var RenderAssetManager = createContext17({
|
|
10044
10456
|
registerRenderAsset: () => {
|
|
10045
10457
|
return;
|
|
10046
10458
|
},
|
|
@@ -10090,7 +10502,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
10090
10502
|
renderAssets
|
|
10091
10503
|
};
|
|
10092
10504
|
}, [renderAssets, registerRenderAsset, unregisterRenderAsset]);
|
|
10093
|
-
return /* @__PURE__ */
|
|
10505
|
+
return /* @__PURE__ */ jsx15(RenderAssetManager.Provider, {
|
|
10094
10506
|
value: contextValue,
|
|
10095
10507
|
children
|
|
10096
10508
|
});
|
|
@@ -10178,9 +10590,9 @@ var calculateMediaDuration = ({
|
|
|
10178
10590
|
const actualDuration = duration / playbackRate;
|
|
10179
10591
|
return Math.floor(actualDuration);
|
|
10180
10592
|
};
|
|
10181
|
-
var LoopContext =
|
|
10593
|
+
var LoopContext = createContext18(null);
|
|
10182
10594
|
var useLoop = () => {
|
|
10183
|
-
return
|
|
10595
|
+
return React16.useContext(LoopContext);
|
|
10184
10596
|
};
|
|
10185
10597
|
var Loop = ({
|
|
10186
10598
|
durationInFrames,
|
|
@@ -10225,9 +10637,9 @@ var Loop = ({
|
|
|
10225
10637
|
durationInFrames
|
|
10226
10638
|
};
|
|
10227
10639
|
}, [currentFrame, durationInFrames]);
|
|
10228
|
-
return /* @__PURE__ */
|
|
10640
|
+
return /* @__PURE__ */ jsx16(LoopContext.Provider, {
|
|
10229
10641
|
value: loopContext,
|
|
10230
|
-
children: /* @__PURE__ */
|
|
10642
|
+
children: /* @__PURE__ */ jsx16(Sequence, {
|
|
10231
10643
|
durationInFrames,
|
|
10232
10644
|
from,
|
|
10233
10645
|
name: name ?? "<Loop>",
|
|
@@ -10250,7 +10662,7 @@ var playbackLogging = ({
|
|
|
10250
10662
|
const tags = [mountTime ? Date.now() - mountTime + "ms " : null, tag].filter(Boolean).join(" ");
|
|
10251
10663
|
Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
|
|
10252
10664
|
};
|
|
10253
|
-
var PreloadContext =
|
|
10665
|
+
var PreloadContext = createContext19({});
|
|
10254
10666
|
var preloads = {};
|
|
10255
10667
|
var updaters = [];
|
|
10256
10668
|
var setPreloads = (updater) => {
|
|
@@ -10268,7 +10680,7 @@ var PrefetchProvider = ({ children }) => {
|
|
|
10268
10680
|
updaters = updaters.filter((u) => u !== updaterFunction);
|
|
10269
10681
|
};
|
|
10270
10682
|
}, []);
|
|
10271
|
-
return /* @__PURE__ */
|
|
10683
|
+
return /* @__PURE__ */ jsx17(PreloadContext.Provider, {
|
|
10272
10684
|
value: _preloads,
|
|
10273
10685
|
children
|
|
10274
10686
|
});
|
|
@@ -10574,7 +10986,7 @@ var durationReducer = (state, action) => {
|
|
|
10574
10986
|
return state;
|
|
10575
10987
|
}
|
|
10576
10988
|
};
|
|
10577
|
-
var DurationsContext =
|
|
10989
|
+
var DurationsContext = createContext20({
|
|
10578
10990
|
durations: {},
|
|
10579
10991
|
setDurations: () => {
|
|
10580
10992
|
throw new Error("context missing");
|
|
@@ -10588,7 +11000,7 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
10588
11000
|
setDurations
|
|
10589
11001
|
};
|
|
10590
11002
|
}, [durations]);
|
|
10591
|
-
return /* @__PURE__ */
|
|
11003
|
+
return /* @__PURE__ */ jsx18(DurationsContext.Provider, {
|
|
10592
11004
|
value,
|
|
10593
11005
|
children
|
|
10594
11006
|
});
|
|
@@ -10827,8 +11239,8 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
10827
11239
|
}
|
|
10828
11240
|
return true;
|
|
10829
11241
|
};
|
|
10830
|
-
var SharedAudioContext =
|
|
10831
|
-
var SharedAudioTagsContext =
|
|
11242
|
+
var SharedAudioContext = createContext21(null);
|
|
11243
|
+
var SharedAudioTagsContext = createContext21(null);
|
|
10832
11244
|
var shouldSaveForLater = (state) => {
|
|
10833
11245
|
if (state === "suspended" || state === "running-to-suspended" || state === "interrupted") {
|
|
10834
11246
|
return true;
|
|
@@ -10991,7 +11403,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
10991
11403
|
getIsResumingAudioContext,
|
|
10992
11404
|
unscheduleAudioNode
|
|
10993
11405
|
]);
|
|
10994
|
-
return /* @__PURE__ */
|
|
11406
|
+
return /* @__PURE__ */ jsx19(SharedAudioContext.Provider, {
|
|
10995
11407
|
value: audioContextValue,
|
|
10996
11408
|
children
|
|
10997
11409
|
});
|
|
@@ -11021,7 +11433,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
11021
11433
|
};
|
|
11022
11434
|
});
|
|
11023
11435
|
}, [audioContext, numberOfAudioTags]);
|
|
11024
|
-
const effectToUse =
|
|
11436
|
+
const effectToUse = React19.useInsertionEffect ?? React19.useLayoutEffect;
|
|
11025
11437
|
effectToUse(() => {
|
|
11026
11438
|
return () => {
|
|
11027
11439
|
requestAnimationFrame(() => {
|
|
@@ -11164,7 +11576,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
11164
11576
|
value: audioTagsValue,
|
|
11165
11577
|
children: [
|
|
11166
11578
|
refs.map(({ id, ref }) => {
|
|
11167
|
-
return /* @__PURE__ */
|
|
11579
|
+
return /* @__PURE__ */ jsx19("audio", {
|
|
11168
11580
|
ref,
|
|
11169
11581
|
preload: "metadata",
|
|
11170
11582
|
src: EMPTY_AUDIO
|
|
@@ -11186,7 +11598,7 @@ var useSharedAudio = ({
|
|
|
11186
11598
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
11187
11599
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
11188
11600
|
}
|
|
11189
|
-
const el =
|
|
11601
|
+
const el = React19.createRef();
|
|
11190
11602
|
const mediaElementSourceNode = audioCtx?.audioContext ? makeSharedElementSourceNode({
|
|
11191
11603
|
audioContext: audioCtx.audioContext,
|
|
11192
11604
|
ref: el
|
|
@@ -11205,7 +11617,7 @@ var useSharedAudio = ({
|
|
|
11205
11617
|
}
|
|
11206
11618
|
};
|
|
11207
11619
|
});
|
|
11208
|
-
const effectToUse =
|
|
11620
|
+
const effectToUse = React19.useInsertionEffect ?? React19.useLayoutEffect;
|
|
11209
11621
|
if (typeof document !== "undefined") {
|
|
11210
11622
|
effectToUse(() => {
|
|
11211
11623
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
@@ -11637,7 +12049,8 @@ var useMediaInTimeline = ({
|
|
|
11637
12049
|
postmountDisplay,
|
|
11638
12050
|
controls: null,
|
|
11639
12051
|
effects: [],
|
|
11640
|
-
refForOutline
|
|
12052
|
+
refForOutline,
|
|
12053
|
+
isInsideSeries: false
|
|
11641
12054
|
});
|
|
11642
12055
|
return () => {
|
|
11643
12056
|
unregisterSequence(id);
|
|
@@ -11750,11 +12163,11 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
11750
12163
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
11751
12164
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
11752
12165
|
};
|
|
11753
|
-
var BufferingContextReact =
|
|
12166
|
+
var BufferingContextReact = React20.createContext(null);
|
|
11754
12167
|
var BufferingProvider = ({ children }) => {
|
|
11755
12168
|
const { logLevel, mountTime } = useContext24(LogLevelContext);
|
|
11756
12169
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
|
|
11757
|
-
return /* @__PURE__ */
|
|
12170
|
+
return /* @__PURE__ */ jsx20(BufferingContextReact.Provider, {
|
|
11758
12171
|
value: bufferManager,
|
|
11759
12172
|
children
|
|
11760
12173
|
});
|
|
@@ -11901,7 +12314,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
11901
12314
|
}, [bufferUntilFirstFrame]);
|
|
11902
12315
|
};
|
|
11903
12316
|
var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
|
|
11904
|
-
const lastUpdate =
|
|
12317
|
+
const lastUpdate = React21.useRef({
|
|
11905
12318
|
time: mediaRef.current?.currentTime ?? 0,
|
|
11906
12319
|
lastUpdate: performance.now()
|
|
11907
12320
|
});
|
|
@@ -12479,11 +12892,11 @@ var useMediaTag = ({
|
|
|
12479
12892
|
env.isPlayer
|
|
12480
12893
|
]);
|
|
12481
12894
|
};
|
|
12482
|
-
var MediaVolumeContext =
|
|
12895
|
+
var MediaVolumeContext = createContext22({
|
|
12483
12896
|
mediaMuted: false,
|
|
12484
12897
|
mediaVolume: 1
|
|
12485
12898
|
});
|
|
12486
|
-
var SetMediaVolumeContext =
|
|
12899
|
+
var SetMediaVolumeContext = createContext22({
|
|
12487
12900
|
setMediaMuted: () => {
|
|
12488
12901
|
throw new Error("default");
|
|
12489
12902
|
},
|
|
@@ -12650,7 +13063,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
12650
13063
|
volume: userPreferredVolume,
|
|
12651
13064
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
12652
13065
|
});
|
|
12653
|
-
const effectToUse =
|
|
13066
|
+
const effectToUse = React22.useInsertionEffect ?? React22.useLayoutEffect;
|
|
12654
13067
|
effectToUse(() => {
|
|
12655
13068
|
return () => {
|
|
12656
13069
|
requestAnimationFrame(() => {
|
|
@@ -12683,7 +13096,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
12683
13096
|
if (initialShouldPreMountAudioElements) {
|
|
12684
13097
|
return null;
|
|
12685
13098
|
}
|
|
12686
|
-
return /* @__PURE__ */
|
|
13099
|
+
return /* @__PURE__ */ jsx21("audio", {
|
|
12687
13100
|
ref: audioRef,
|
|
12688
13101
|
preload: "metadata",
|
|
12689
13102
|
crossOrigin: crossOriginValue,
|
|
@@ -12817,7 +13230,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
12817
13230
|
if (!needsToRenderAudioTag) {
|
|
12818
13231
|
return null;
|
|
12819
13232
|
}
|
|
12820
|
-
return /* @__PURE__ */
|
|
13233
|
+
return /* @__PURE__ */ jsx222("audio", {
|
|
12821
13234
|
ref: audioRef,
|
|
12822
13235
|
...nativeProps,
|
|
12823
13236
|
onError: onNativeError
|
|
@@ -12876,14 +13289,14 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
12876
13289
|
});
|
|
12877
13290
|
if (loop && durationFetched !== undefined) {
|
|
12878
13291
|
if (!Number.isFinite(durationFetched)) {
|
|
12879
|
-
return /* @__PURE__ */
|
|
13292
|
+
return /* @__PURE__ */ jsx23(Html5Audio, {
|
|
12880
13293
|
...propsOtherThanLoop,
|
|
12881
13294
|
ref,
|
|
12882
13295
|
_remotionInternalNativeLoopPassed: true
|
|
12883
13296
|
});
|
|
12884
13297
|
}
|
|
12885
13298
|
const duration = durationFetched * fps;
|
|
12886
|
-
return /* @__PURE__ */
|
|
13299
|
+
return /* @__PURE__ */ jsx23(Loop, {
|
|
12887
13300
|
layout: "none",
|
|
12888
13301
|
durationInFrames: calculateMediaDuration({
|
|
12889
13302
|
trimAfter: trimAfterValue,
|
|
@@ -12891,7 +13304,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
12891
13304
|
playbackRate: props.playbackRate ?? 1,
|
|
12892
13305
|
trimBefore: trimBeforeValue
|
|
12893
13306
|
}),
|
|
12894
|
-
children: /* @__PURE__ */
|
|
13307
|
+
children: /* @__PURE__ */ jsx23(Html5Audio, {
|
|
12895
13308
|
...propsOtherThanLoop,
|
|
12896
13309
|
ref,
|
|
12897
13310
|
_remotionInternalNativeLoopPassed: true
|
|
@@ -12899,13 +13312,13 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
12899
13312
|
});
|
|
12900
13313
|
}
|
|
12901
13314
|
if (typeof trimBeforeValue !== "undefined" || typeof trimAfterValue !== "undefined") {
|
|
12902
|
-
return /* @__PURE__ */
|
|
13315
|
+
return /* @__PURE__ */ jsx23(Sequence, {
|
|
12903
13316
|
layout: "none",
|
|
12904
13317
|
from: 0 - (trimBeforeValue ?? 0),
|
|
12905
13318
|
showInTimeline: false,
|
|
12906
13319
|
durationInFrames: trimAfterValue,
|
|
12907
13320
|
name,
|
|
12908
|
-
children: /* @__PURE__ */
|
|
13321
|
+
children: /* @__PURE__ */ jsx23(Html5Audio, {
|
|
12909
13322
|
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
12910
13323
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
12911
13324
|
...otherProps,
|
|
@@ -12919,7 +13332,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
12919
13332
|
volume: props.volume
|
|
12920
13333
|
}, "Html5Audio");
|
|
12921
13334
|
if (environment.isRendering) {
|
|
12922
|
-
return /* @__PURE__ */
|
|
13335
|
+
return /* @__PURE__ */ jsx23(AudioForRendering, {
|
|
12923
13336
|
onDuration,
|
|
12924
13337
|
...props,
|
|
12925
13338
|
ref,
|
|
@@ -12927,7 +13340,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
12927
13340
|
_remotionInternalNeedsDurationCalculation: Boolean(loop)
|
|
12928
13341
|
});
|
|
12929
13342
|
}
|
|
12930
|
-
return /* @__PURE__ */
|
|
13343
|
+
return /* @__PURE__ */ jsx23(AudioForPreview, {
|
|
12931
13344
|
_remotionInternalNativeLoopPassed: props._remotionInternalNativeLoopPassed ?? false,
|
|
12932
13345
|
_remotionInternalStack: stack ?? null,
|
|
12933
13346
|
shouldPreMountAudioTags: audioTagsContext !== null && audioTagsContext.numberOfAudioTags > 0,
|
|
@@ -12943,7 +13356,18 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
12943
13356
|
var Html5Audio = forwardRef7(AudioRefForwardingFunction);
|
|
12944
13357
|
addSequenceStackTraces(Html5Audio);
|
|
12945
13358
|
var Audio = Html5Audio;
|
|
13359
|
+
var resolveSolidPixelDensity = (pixelDensity) => {
|
|
13360
|
+
if (pixelDensity === undefined) {
|
|
13361
|
+
return 1;
|
|
13362
|
+
}
|
|
13363
|
+
if (typeof pixelDensity !== "number" || !Number.isFinite(pixelDensity) || pixelDensity <= 0) {
|
|
13364
|
+
throw new Error(`<Solid>: \`pixelDensity\` must be a positive finite number. Received: ${String(pixelDensity)}.`);
|
|
13365
|
+
}
|
|
13366
|
+
return pixelDensity;
|
|
13367
|
+
};
|
|
12946
13368
|
var solidSchema = {
|
|
13369
|
+
durationInFrames: durationInFramesField,
|
|
13370
|
+
from: fromField,
|
|
12947
13371
|
color: {
|
|
12948
13372
|
type: "color",
|
|
12949
13373
|
default: "transparent",
|
|
@@ -12954,14 +13378,16 @@ var solidSchema = {
|
|
|
12954
13378
|
min: 1,
|
|
12955
13379
|
step: 1,
|
|
12956
13380
|
default: 1920,
|
|
12957
|
-
description: "Width"
|
|
13381
|
+
description: "Width",
|
|
13382
|
+
hiddenFromList: false
|
|
12958
13383
|
},
|
|
12959
13384
|
height: {
|
|
12960
13385
|
type: "number",
|
|
12961
13386
|
min: 1,
|
|
12962
13387
|
step: 1,
|
|
12963
13388
|
default: 1080,
|
|
12964
|
-
description: "Height"
|
|
13389
|
+
description: "Height",
|
|
13390
|
+
hiddenFromList: false
|
|
12965
13391
|
},
|
|
12966
13392
|
...sequenceVisualStyleSchema,
|
|
12967
13393
|
hidden: hiddenField
|
|
@@ -12973,10 +13399,14 @@ var SolidInner = ({
|
|
|
12973
13399
|
effects = [],
|
|
12974
13400
|
className,
|
|
12975
13401
|
style,
|
|
13402
|
+
pixelDensity,
|
|
12976
13403
|
overrideId,
|
|
12977
13404
|
reference
|
|
12978
13405
|
}) => {
|
|
12979
13406
|
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
13407
|
+
const resolvedPixelDensity = resolveSolidPixelDensity(pixelDensity);
|
|
13408
|
+
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
13409
|
+
const canvasHeight = Math.ceil(height * resolvedPixelDensity);
|
|
12980
13410
|
const [outputCanvas, setOutputCanvas] = useState15(null);
|
|
12981
13411
|
const memoizedEffects = useMemoizedEffects({
|
|
12982
13412
|
effects,
|
|
@@ -13022,12 +13452,12 @@ var SolidInner = ({
|
|
|
13022
13452
|
ctx.fillRect(0, 0, 1, 1);
|
|
13023
13453
|
}
|
|
13024
13454
|
runEffectChain({
|
|
13025
|
-
state: chainState.get(
|
|
13455
|
+
state: chainState.get(canvasWidth, canvasHeight),
|
|
13026
13456
|
source: sourceCanvas,
|
|
13027
13457
|
effects: memoizedEffects,
|
|
13028
13458
|
output: outputCanvas,
|
|
13029
|
-
width,
|
|
13030
|
-
height
|
|
13459
|
+
width: canvasWidth,
|
|
13460
|
+
height: canvasHeight
|
|
13031
13461
|
}).then((completed) => {
|
|
13032
13462
|
if (completed) {
|
|
13033
13463
|
continueRender2(handle);
|
|
@@ -13043,19 +13473,26 @@ var SolidInner = ({
|
|
|
13043
13473
|
outputCanvas,
|
|
13044
13474
|
sourceCanvas,
|
|
13045
13475
|
chainState,
|
|
13046
|
-
|
|
13047
|
-
|
|
13476
|
+
canvasWidth,
|
|
13477
|
+
canvasHeight,
|
|
13048
13478
|
delayRender2,
|
|
13049
13479
|
continueRender2,
|
|
13050
13480
|
cancelRender2,
|
|
13051
13481
|
memoizedEffects
|
|
13052
13482
|
]);
|
|
13053
|
-
|
|
13483
|
+
const canvasStyle = useMemo29(() => {
|
|
13484
|
+
return {
|
|
13485
|
+
width,
|
|
13486
|
+
height,
|
|
13487
|
+
...style ?? {}
|
|
13488
|
+
};
|
|
13489
|
+
}, [height, style, width]);
|
|
13490
|
+
return /* @__PURE__ */ jsx24("canvas", {
|
|
13054
13491
|
ref: canvasRef,
|
|
13055
|
-
width,
|
|
13056
|
-
height,
|
|
13492
|
+
width: canvasWidth,
|
|
13493
|
+
height: canvasHeight,
|
|
13057
13494
|
className,
|
|
13058
|
-
style
|
|
13495
|
+
style: canvasStyle
|
|
13059
13496
|
});
|
|
13060
13497
|
};
|
|
13061
13498
|
var SolidOuter = forwardRef8(({
|
|
@@ -13071,6 +13508,7 @@ var SolidOuter = forwardRef8(({
|
|
|
13071
13508
|
from,
|
|
13072
13509
|
hidden,
|
|
13073
13510
|
showInTimeline,
|
|
13511
|
+
pixelDensity,
|
|
13074
13512
|
...props2
|
|
13075
13513
|
}, ref) => {
|
|
13076
13514
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
@@ -13078,7 +13516,7 @@ var SolidOuter = forwardRef8(({
|
|
|
13078
13516
|
useImperativeHandle6(ref, () => {
|
|
13079
13517
|
return actualRef.current;
|
|
13080
13518
|
}, []);
|
|
13081
|
-
return /* @__PURE__ */
|
|
13519
|
+
return /* @__PURE__ */ jsx24(Sequence, {
|
|
13082
13520
|
layout: "none",
|
|
13083
13521
|
from,
|
|
13084
13522
|
hidden,
|
|
@@ -13090,7 +13528,7 @@ var SolidOuter = forwardRef8(({
|
|
|
13090
13528
|
_remotionInternalRefForOutline: actualRef,
|
|
13091
13529
|
_remotionInternalDocumentationLink: name === undefined ? "https://www.remotion.dev/docs/solid" : undefined,
|
|
13092
13530
|
...props2,
|
|
13093
|
-
children: /* @__PURE__ */
|
|
13531
|
+
children: /* @__PURE__ */ jsx24(SolidInner, {
|
|
13094
13532
|
reference: actualRef,
|
|
13095
13533
|
overrideId: controls?.overrideId ?? null,
|
|
13096
13534
|
color,
|
|
@@ -13098,11 +13536,16 @@ var SolidOuter = forwardRef8(({
|
|
|
13098
13536
|
width,
|
|
13099
13537
|
className,
|
|
13100
13538
|
style,
|
|
13101
|
-
effects
|
|
13539
|
+
effects,
|
|
13540
|
+
pixelDensity
|
|
13102
13541
|
})
|
|
13103
13542
|
});
|
|
13104
13543
|
});
|
|
13105
|
-
var Solid = wrapInSchema(
|
|
13544
|
+
var Solid = wrapInSchema({
|
|
13545
|
+
Component: SolidOuter,
|
|
13546
|
+
schema: solidSchema,
|
|
13547
|
+
supportsEffects: true
|
|
13548
|
+
});
|
|
13106
13549
|
Solid.displayName = "Solid";
|
|
13107
13550
|
addSequenceStackTraces(Solid);
|
|
13108
13551
|
var cachedSupport = null;
|
|
@@ -13130,6 +13573,27 @@ function assertHtmlInCanvasDimensions(width, height) {
|
|
|
13130
13573
|
throw new Error(`HtmlInCanvas: \`height\` must be a positive integer. Received: ${String(height)}.`);
|
|
13131
13574
|
}
|
|
13132
13575
|
}
|
|
13576
|
+
function resolveHtmlInCanvasPixelDensity(pixelDensity) {
|
|
13577
|
+
if (pixelDensity === undefined) {
|
|
13578
|
+
return 1;
|
|
13579
|
+
}
|
|
13580
|
+
if (typeof pixelDensity !== "number" || !Number.isFinite(pixelDensity) || pixelDensity <= 0) {
|
|
13581
|
+
throw new Error(`HtmlInCanvas: \`pixelDensity\` must be a positive finite number. Received: ${String(pixelDensity)}.`);
|
|
13582
|
+
}
|
|
13583
|
+
return pixelDensity;
|
|
13584
|
+
}
|
|
13585
|
+
var resizeOffscreenCanvas = ({
|
|
13586
|
+
offscreen,
|
|
13587
|
+
width,
|
|
13588
|
+
height
|
|
13589
|
+
}) => {
|
|
13590
|
+
if (offscreen.width !== width) {
|
|
13591
|
+
offscreen.width = width;
|
|
13592
|
+
}
|
|
13593
|
+
if (offscreen.height !== height) {
|
|
13594
|
+
offscreen.height = height;
|
|
13595
|
+
}
|
|
13596
|
+
};
|
|
13133
13597
|
var defaultOnPaint = ({
|
|
13134
13598
|
canvas,
|
|
13135
13599
|
element,
|
|
@@ -13143,10 +13607,23 @@ var defaultOnPaint = ({
|
|
|
13143
13607
|
const transform = ctx.drawElementImage(elementImage, 0, 0);
|
|
13144
13608
|
element.style.transform = transform.toString();
|
|
13145
13609
|
};
|
|
13146
|
-
var HtmlInCanvasAncestorContext =
|
|
13147
|
-
var HtmlInCanvasContent = forwardRef9(({
|
|
13610
|
+
var HtmlInCanvasAncestorContext = createContext23(false);
|
|
13611
|
+
var HtmlInCanvasContent = forwardRef9(({
|
|
13612
|
+
width,
|
|
13613
|
+
height,
|
|
13614
|
+
effects,
|
|
13615
|
+
children,
|
|
13616
|
+
onPaint,
|
|
13617
|
+
onInit,
|
|
13618
|
+
pixelDensity,
|
|
13619
|
+
controls,
|
|
13620
|
+
style
|
|
13621
|
+
}, ref) => {
|
|
13148
13622
|
const isInsideAncestorHtmlInCanvas = useContext31(HtmlInCanvasAncestorContext);
|
|
13149
13623
|
assertHtmlInCanvasDimensions(width, height);
|
|
13624
|
+
const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
|
|
13625
|
+
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
13626
|
+
const canvasHeight = Math.ceil(height * resolvedPixelDensity);
|
|
13150
13627
|
const { continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
13151
13628
|
if (!isHtmlInCanvasSupported()) {
|
|
13152
13629
|
cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
|
|
@@ -13154,7 +13631,7 @@ var HtmlInCanvasContent = forwardRef9(({ width, height, effects, children, onPai
|
|
|
13154
13631
|
const canvas2dRef = useRef22(null);
|
|
13155
13632
|
const offscreenRef = useRef22(null);
|
|
13156
13633
|
const divRef = useRef22(null);
|
|
13157
|
-
const canvasSizeKey = `${width}x${height}`;
|
|
13634
|
+
const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}`;
|
|
13158
13635
|
const setLayoutCanvasRef = useCallback15((node) => {
|
|
13159
13636
|
canvas2dRef.current = node;
|
|
13160
13637
|
if (typeof ref === "function") {
|
|
@@ -13186,8 +13663,11 @@ var HtmlInCanvasContent = forwardRef9(({ width, height, effects, children, onPai
|
|
|
13186
13663
|
if (!offscreen) {
|
|
13187
13664
|
throw new Error("HtmlInCanvas: offscreen canvas not ready (transferControlToOffscreen failed or canvas is remounting)");
|
|
13188
13665
|
}
|
|
13189
|
-
|
|
13190
|
-
|
|
13666
|
+
resizeOffscreenCanvas({
|
|
13667
|
+
offscreen,
|
|
13668
|
+
width: canvasWidth,
|
|
13669
|
+
height: canvasHeight
|
|
13670
|
+
});
|
|
13191
13671
|
try {
|
|
13192
13672
|
const placeholderCanvas = canvas2dRef.current;
|
|
13193
13673
|
if (!placeholderCanvas) {
|
|
@@ -13206,7 +13686,8 @@ var HtmlInCanvasContent = forwardRef9(({ width, height, effects, children, onPai
|
|
|
13206
13686
|
const cleanup = await currentOnInit({
|
|
13207
13687
|
canvas: offscreen,
|
|
13208
13688
|
element,
|
|
13209
|
-
elementImage: initImage
|
|
13689
|
+
elementImage: initImage,
|
|
13690
|
+
pixelDensity: resolvedPixelDensity
|
|
13210
13691
|
});
|
|
13211
13692
|
if (typeof cleanup !== "function") {
|
|
13212
13693
|
throw new Error("HtmlInCanvas: when `onInit` is provided, it must return a cleanup function, or a Promise that resolves to one.");
|
|
@@ -13223,21 +13704,29 @@ var HtmlInCanvasContent = forwardRef9(({ width, height, effects, children, onPai
|
|
|
13223
13704
|
await handler({
|
|
13224
13705
|
canvas: offscreen,
|
|
13225
13706
|
element,
|
|
13226
|
-
elementImage: elImage
|
|
13707
|
+
elementImage: elImage,
|
|
13708
|
+
pixelDensity: resolvedPixelDensity
|
|
13227
13709
|
});
|
|
13228
13710
|
await runEffectChain({
|
|
13229
|
-
state: chainState.get(
|
|
13711
|
+
state: chainState.get(canvasWidth, canvasHeight),
|
|
13230
13712
|
source: offscreen,
|
|
13231
13713
|
effects: effectsRef.current,
|
|
13232
13714
|
output: offscreen,
|
|
13233
|
-
width,
|
|
13234
|
-
height
|
|
13715
|
+
width: canvasWidth,
|
|
13716
|
+
height: canvasHeight
|
|
13235
13717
|
});
|
|
13236
13718
|
continueRender2(handle);
|
|
13237
13719
|
} catch (error2) {
|
|
13238
13720
|
cancelRender2(error2);
|
|
13239
13721
|
}
|
|
13240
|
-
}, [
|
|
13722
|
+
}, [
|
|
13723
|
+
canvasHeight,
|
|
13724
|
+
canvasWidth,
|
|
13725
|
+
chainState,
|
|
13726
|
+
continueRender2,
|
|
13727
|
+
cancelRender2,
|
|
13728
|
+
resolvedPixelDensity
|
|
13729
|
+
]);
|
|
13241
13730
|
useLayoutEffect9(() => {
|
|
13242
13731
|
const placeholder = canvas2dRef.current;
|
|
13243
13732
|
if (!placeholder) {
|
|
@@ -13246,8 +13735,11 @@ var HtmlInCanvasContent = forwardRef9(({ width, height, effects, children, onPai
|
|
|
13246
13735
|
placeholder.layoutSubtree = true;
|
|
13247
13736
|
const offscreen = placeholder.transferControlToOffscreen();
|
|
13248
13737
|
offscreenRef.current = offscreen;
|
|
13249
|
-
|
|
13250
|
-
|
|
13738
|
+
resizeOffscreenCanvas({
|
|
13739
|
+
offscreen,
|
|
13740
|
+
width: canvasWidth,
|
|
13741
|
+
height: canvasHeight
|
|
13742
|
+
});
|
|
13251
13743
|
initializedRef.current = false;
|
|
13252
13744
|
unmountedRef.current = false;
|
|
13253
13745
|
placeholder.addEventListener("paint", onPaintCb);
|
|
@@ -13259,7 +13751,7 @@ var HtmlInCanvasContent = forwardRef9(({ width, height, effects, children, onPai
|
|
|
13259
13751
|
onInitCleanupRef.current?.();
|
|
13260
13752
|
onInitCleanupRef.current = null;
|
|
13261
13753
|
};
|
|
13262
|
-
}, [onPaintCb, cancelRender2,
|
|
13754
|
+
}, [onPaintCb, cancelRender2, canvasWidth, canvasHeight]);
|
|
13263
13755
|
const onPaintChangedRef = useRef22(false);
|
|
13264
13756
|
useLayoutEffect9(() => {
|
|
13265
13757
|
if (!onPaintChangedRef.current) {
|
|
@@ -13291,17 +13783,24 @@ var HtmlInCanvasContent = forwardRef9(({ width, height, effects, children, onPai
|
|
|
13291
13783
|
height
|
|
13292
13784
|
};
|
|
13293
13785
|
}, [width, height]);
|
|
13786
|
+
const canvasStyle = useMemo30(() => {
|
|
13787
|
+
return {
|
|
13788
|
+
width,
|
|
13789
|
+
height,
|
|
13790
|
+
...style ?? {}
|
|
13791
|
+
};
|
|
13792
|
+
}, [height, style, width]);
|
|
13294
13793
|
if (isInsideAncestorHtmlInCanvas) {
|
|
13295
13794
|
throw new Error("<HtmlInCanvas> effects cannot be nested together. Chrome will only display the outer effect. Consider merging the effects into one if you can.");
|
|
13296
13795
|
}
|
|
13297
|
-
return /* @__PURE__ */
|
|
13796
|
+
return /* @__PURE__ */ jsx25(HtmlInCanvasAncestorContext.Provider, {
|
|
13298
13797
|
value: true,
|
|
13299
|
-
children: /* @__PURE__ */
|
|
13798
|
+
children: /* @__PURE__ */ jsx25("canvas", {
|
|
13300
13799
|
ref: setLayoutCanvasRef,
|
|
13301
|
-
width,
|
|
13302
|
-
height,
|
|
13303
|
-
style,
|
|
13304
|
-
children: /* @__PURE__ */
|
|
13800
|
+
width: canvasWidth,
|
|
13801
|
+
height: canvasHeight,
|
|
13802
|
+
style: canvasStyle,
|
|
13803
|
+
children: /* @__PURE__ */ jsx25("div", {
|
|
13305
13804
|
ref: divRef,
|
|
13306
13805
|
style: innerStyle,
|
|
13307
13806
|
children
|
|
@@ -13317,6 +13816,7 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
13317
13816
|
children,
|
|
13318
13817
|
onPaint,
|
|
13319
13818
|
onInit,
|
|
13819
|
+
pixelDensity,
|
|
13320
13820
|
_experimentalControls: controls,
|
|
13321
13821
|
style,
|
|
13322
13822
|
durationInFrames,
|
|
@@ -13326,21 +13826,32 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
13326
13826
|
const { durationInFrames: videoDuration } = useVideoConfig();
|
|
13327
13827
|
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
13328
13828
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
13329
|
-
|
|
13829
|
+
const actualRef = useRef22(null);
|
|
13830
|
+
const setCanvasRef = useCallback15((node) => {
|
|
13831
|
+
actualRef.current = node;
|
|
13832
|
+
if (typeof ref === "function") {
|
|
13833
|
+
ref(node);
|
|
13834
|
+
} else if (ref) {
|
|
13835
|
+
ref.current = node;
|
|
13836
|
+
}
|
|
13837
|
+
}, [ref]);
|
|
13838
|
+
return /* @__PURE__ */ jsx25(Sequence, {
|
|
13330
13839
|
durationInFrames: resolvedDuration,
|
|
13331
13840
|
name: name ?? "<HtmlInCanvas>",
|
|
13332
13841
|
_remotionInternalDocumentationLink: name === undefined ? "https://www.remotion.dev/docs/remotion/html-in-canvas" : undefined,
|
|
13333
13842
|
_experimentalControls: controls,
|
|
13334
13843
|
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
13844
|
+
_remotionInternalRefForOutline: actualRef,
|
|
13335
13845
|
layout: "none",
|
|
13336
13846
|
...sequenceProps,
|
|
13337
|
-
children: /* @__PURE__ */
|
|
13338
|
-
ref,
|
|
13847
|
+
children: /* @__PURE__ */ jsx25(HtmlInCanvasContent, {
|
|
13848
|
+
ref: setCanvasRef,
|
|
13339
13849
|
width,
|
|
13340
13850
|
height,
|
|
13341
13851
|
effects,
|
|
13342
13852
|
onPaint,
|
|
13343
13853
|
onInit,
|
|
13854
|
+
pixelDensity,
|
|
13344
13855
|
controls,
|
|
13345
13856
|
style,
|
|
13346
13857
|
children
|
|
@@ -13349,10 +13860,16 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
13349
13860
|
});
|
|
13350
13861
|
HtmlInCanvasInner.displayName = "HtmlInCanvas";
|
|
13351
13862
|
var htmlInCanvasSchema = {
|
|
13863
|
+
durationInFrames: durationInFramesField,
|
|
13864
|
+
from: fromField,
|
|
13352
13865
|
...sequenceVisualStyleSchema,
|
|
13353
13866
|
hidden: hiddenField
|
|
13354
13867
|
};
|
|
13355
|
-
var HtmlInCanvasWrapped = wrapInSchema(
|
|
13868
|
+
var HtmlInCanvasWrapped = wrapInSchema({
|
|
13869
|
+
Component: HtmlInCanvasInner,
|
|
13870
|
+
schema: htmlInCanvasSchema,
|
|
13871
|
+
supportsEffects: true
|
|
13872
|
+
});
|
|
13356
13873
|
var HtmlInCanvas = Object.assign(HtmlInCanvasWrapped, {
|
|
13357
13874
|
isSupported: isHtmlInCanvasSupported
|
|
13358
13875
|
});
|
|
@@ -13365,6 +13882,8 @@ function truncateSrcForLabel(src) {
|
|
|
13365
13882
|
return src;
|
|
13366
13883
|
}
|
|
13367
13884
|
var canvasImageSchema = {
|
|
13885
|
+
durationInFrames: durationInFramesField,
|
|
13886
|
+
from: fromField,
|
|
13368
13887
|
fit: {
|
|
13369
13888
|
type: "enum",
|
|
13370
13889
|
default: "fill",
|
|
@@ -13451,6 +13970,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13451
13970
|
maxRetries = 2,
|
|
13452
13971
|
delayRenderRetries,
|
|
13453
13972
|
delayRenderTimeoutInMilliseconds,
|
|
13973
|
+
refForOutline,
|
|
13454
13974
|
...canvasProps
|
|
13455
13975
|
}, ref) => {
|
|
13456
13976
|
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
@@ -13471,12 +13991,15 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13471
13991
|
}, []);
|
|
13472
13992
|
const canvasRef = useCallback16((canvas) => {
|
|
13473
13993
|
setOutputCanvas(canvas);
|
|
13994
|
+
if (refForOutline) {
|
|
13995
|
+
refForOutline.current = canvas;
|
|
13996
|
+
}
|
|
13474
13997
|
if (typeof ref === "function") {
|
|
13475
13998
|
ref(canvas);
|
|
13476
13999
|
} else if (ref) {
|
|
13477
14000
|
ref.current = canvas;
|
|
13478
14001
|
}
|
|
13479
|
-
}, [ref]);
|
|
14002
|
+
}, [ref, refForOutline]);
|
|
13480
14003
|
useEffect17(() => {
|
|
13481
14004
|
if (!outputCanvas || !sourceCanvas) {
|
|
13482
14005
|
return;
|
|
@@ -13586,7 +14109,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13586
14109
|
sourceCanvas,
|
|
13587
14110
|
width
|
|
13588
14111
|
]);
|
|
13589
|
-
return /* @__PURE__ */
|
|
14112
|
+
return /* @__PURE__ */ jsx26("canvas", {
|
|
13590
14113
|
...canvasProps,
|
|
13591
14114
|
ref: canvasRef,
|
|
13592
14115
|
width,
|
|
@@ -13619,13 +14142,18 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13619
14142
|
stack,
|
|
13620
14143
|
_experimentalControls: controls,
|
|
13621
14144
|
_remotionInternalDocumentationLink,
|
|
14145
|
+
_remotionInternalRefForOutline,
|
|
13622
14146
|
...canvasProps
|
|
13623
14147
|
}, ref) => {
|
|
13624
14148
|
if (!src) {
|
|
13625
14149
|
throw new Error('No "src" prop was passed to <CanvasImage>.');
|
|
13626
14150
|
}
|
|
13627
14151
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
13628
|
-
|
|
14152
|
+
const actualRef = useRef23(null);
|
|
14153
|
+
useImperativeHandle7(ref, () => {
|
|
14154
|
+
return actualRef.current;
|
|
14155
|
+
}, []);
|
|
14156
|
+
return /* @__PURE__ */ jsx26(Sequence, {
|
|
13629
14157
|
layout: "none",
|
|
13630
14158
|
from: from ?? 0,
|
|
13631
14159
|
durationInFrames: durationInFrames ?? Infinity,
|
|
@@ -13637,8 +14165,9 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13637
14165
|
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
13638
14166
|
_remotionInternalIsMedia: { type: "image", src },
|
|
13639
14167
|
_remotionInternalStack: stack,
|
|
13640
|
-
|
|
13641
|
-
|
|
14168
|
+
_remotionInternalRefForOutline: _remotionInternalRefForOutline ?? actualRef,
|
|
14169
|
+
children: /* @__PURE__ */ jsx26(CanvasImageContent, {
|
|
14170
|
+
ref: actualRef,
|
|
13642
14171
|
src,
|
|
13643
14172
|
width,
|
|
13644
14173
|
height,
|
|
@@ -13653,11 +14182,16 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13653
14182
|
maxRetries,
|
|
13654
14183
|
delayRenderRetries,
|
|
13655
14184
|
delayRenderTimeoutInMilliseconds,
|
|
14185
|
+
refForOutline: _remotionInternalRefForOutline ?? null,
|
|
13656
14186
|
...canvasProps
|
|
13657
14187
|
})
|
|
13658
14188
|
});
|
|
13659
14189
|
});
|
|
13660
|
-
var CanvasImage = wrapInSchema(
|
|
14190
|
+
var CanvasImage = wrapInSchema({
|
|
14191
|
+
Component: CanvasImageInner,
|
|
14192
|
+
schema: canvasImageSchema,
|
|
14193
|
+
supportsEffects: true
|
|
14194
|
+
});
|
|
13661
14195
|
CanvasImage.displayName = "CanvasImage";
|
|
13662
14196
|
addSequenceStackTraces(CanvasImage);
|
|
13663
14197
|
var IFrameRefForwarding = ({
|
|
@@ -13684,7 +14218,7 @@ var IFrameRefForwarding = ({
|
|
|
13684
14218
|
console.error("Error loading iframe:", e, "Handle the event using the onError() prop to make this message disappear.");
|
|
13685
14219
|
}
|
|
13686
14220
|
}, [handle, onError, continueRender2]);
|
|
13687
|
-
return /* @__PURE__ */
|
|
14221
|
+
return /* @__PURE__ */ jsx27("iframe", {
|
|
13688
14222
|
referrerPolicy: "strict-origin-when-cross-origin",
|
|
13689
14223
|
...props2,
|
|
13690
14224
|
ref,
|
|
@@ -13707,19 +14241,26 @@ var ImgContent = ({
|
|
|
13707
14241
|
crossOrigin,
|
|
13708
14242
|
decoding,
|
|
13709
14243
|
ref,
|
|
14244
|
+
refForOutline,
|
|
13710
14245
|
...props2
|
|
13711
14246
|
}) => {
|
|
13712
|
-
const imageRef =
|
|
13713
|
-
const errors =
|
|
14247
|
+
const imageRef = useRef24(null);
|
|
14248
|
+
const errors = useRef24({});
|
|
13714
14249
|
const { delayPlayback } = useBufferState();
|
|
13715
14250
|
const sequenceContext = useContext33(SequenceContext);
|
|
13716
14251
|
const _propsValid = true;
|
|
13717
14252
|
if (!_propsValid) {
|
|
13718
14253
|
throw new Error("typecheck error");
|
|
13719
14254
|
}
|
|
13720
|
-
|
|
13721
|
-
|
|
13722
|
-
|
|
14255
|
+
const imageCallbackRef = useCallback18((img) => {
|
|
14256
|
+
imageRef.current = img;
|
|
14257
|
+
refForOutline.current = img;
|
|
14258
|
+
if (typeof ref === "function") {
|
|
14259
|
+
ref(img);
|
|
14260
|
+
} else if (ref) {
|
|
14261
|
+
ref.current = img;
|
|
14262
|
+
}
|
|
14263
|
+
}, [ref, refForOutline]);
|
|
13723
14264
|
const actualSrc = usePreload(src);
|
|
13724
14265
|
const retryIn = useCallback18((timeout) => {
|
|
13725
14266
|
if (!imageRef.current) {
|
|
@@ -13833,9 +14374,9 @@ var ImgContent = ({
|
|
|
13833
14374
|
requestsVideoFrame: false,
|
|
13834
14375
|
isClientSideRendering
|
|
13835
14376
|
});
|
|
13836
|
-
return /* @__PURE__ */
|
|
14377
|
+
return /* @__PURE__ */ jsx28("img", {
|
|
13837
14378
|
...props2,
|
|
13838
|
-
ref:
|
|
14379
|
+
ref: imageCallbackRef,
|
|
13839
14380
|
crossOrigin: crossOriginValue,
|
|
13840
14381
|
onError: didGetError,
|
|
13841
14382
|
decoding: isRendering ? "sync" : decoding
|
|
@@ -13850,12 +14391,13 @@ var NativeImgInner = ({
|
|
|
13850
14391
|
from,
|
|
13851
14392
|
durationInFrames,
|
|
13852
14393
|
_experimentalControls: controls,
|
|
14394
|
+
_remotionInternalRefForOutline: refForOutline,
|
|
13853
14395
|
...props2
|
|
13854
14396
|
}) => {
|
|
13855
14397
|
if (!src) {
|
|
13856
14398
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
13857
14399
|
}
|
|
13858
|
-
return /* @__PURE__ */
|
|
14400
|
+
return /* @__PURE__ */ jsx28(Sequence, {
|
|
13859
14401
|
layout: "none",
|
|
13860
14402
|
from: from ?? 0,
|
|
13861
14403
|
durationInFrames: durationInFrames ?? Infinity,
|
|
@@ -13866,14 +14408,18 @@ var NativeImgInner = ({
|
|
|
13866
14408
|
_experimentalControls: controls,
|
|
13867
14409
|
showInTimeline: showInTimeline ?? true,
|
|
13868
14410
|
hidden,
|
|
13869
|
-
|
|
14411
|
+
_remotionInternalRefForOutline: refForOutline,
|
|
14412
|
+
children: /* @__PURE__ */ jsx28(ImgContent, {
|
|
13870
14413
|
src,
|
|
14414
|
+
refForOutline,
|
|
13871
14415
|
...props2
|
|
13872
14416
|
})
|
|
13873
14417
|
});
|
|
13874
14418
|
};
|
|
13875
14419
|
var CanvasImageWithPrivateProps = CanvasImage;
|
|
13876
14420
|
var imgSchema = {
|
|
14421
|
+
durationInFrames: durationInFramesField,
|
|
14422
|
+
from: fromField,
|
|
13877
14423
|
...sequenceVisualStyleSchema,
|
|
13878
14424
|
hidden: hiddenField
|
|
13879
14425
|
};
|
|
@@ -13941,8 +14487,9 @@ var ImgInner = ({
|
|
|
13941
14487
|
delayRenderTimeoutInMilliseconds,
|
|
13942
14488
|
...props2
|
|
13943
14489
|
}) => {
|
|
14490
|
+
const refForOutline = useRef24(null);
|
|
13944
14491
|
if (effects.length === 0) {
|
|
13945
|
-
return /* @__PURE__ */
|
|
14492
|
+
return /* @__PURE__ */ jsx28(NativeImgInner, {
|
|
13946
14493
|
...props2,
|
|
13947
14494
|
ref,
|
|
13948
14495
|
hidden,
|
|
@@ -13961,7 +14508,8 @@ var ImgInner = ({
|
|
|
13961
14508
|
pauseWhenLoading,
|
|
13962
14509
|
maxRetries,
|
|
13963
14510
|
delayRenderRetries,
|
|
13964
|
-
delayRenderTimeoutInMilliseconds
|
|
14511
|
+
delayRenderTimeoutInMilliseconds,
|
|
14512
|
+
_remotionInternalRefForOutline: refForOutline
|
|
13965
14513
|
});
|
|
13966
14514
|
}
|
|
13967
14515
|
if (!src) {
|
|
@@ -13977,7 +14525,7 @@ var ImgInner = ({
|
|
|
13977
14525
|
const canvasHeight = typeof height === "number" ? height : undefined;
|
|
13978
14526
|
const canvasProps = props2;
|
|
13979
14527
|
const canvasFit = getFitFromObjectFit(style) ?? "fill";
|
|
13980
|
-
return /* @__PURE__ */
|
|
14528
|
+
return /* @__PURE__ */ jsx28(CanvasImageWithPrivateProps, {
|
|
13981
14529
|
src,
|
|
13982
14530
|
width: canvasWidth,
|
|
13983
14531
|
height: canvasHeight,
|
|
@@ -13998,12 +14546,17 @@ var ImgInner = ({
|
|
|
13998
14546
|
stack,
|
|
13999
14547
|
_remotionInternalDocumentationLink: name === undefined ? "https://www.remotion.dev/docs/img" : undefined,
|
|
14000
14548
|
_experimentalControls: controls,
|
|
14549
|
+
_remotionInternalRefForOutline: refForOutline,
|
|
14001
14550
|
...canvasProps
|
|
14002
14551
|
});
|
|
14003
14552
|
};
|
|
14004
|
-
var Img = wrapInSchema(
|
|
14553
|
+
var Img = wrapInSchema({
|
|
14554
|
+
Component: ImgInner,
|
|
14555
|
+
schema: imgSchema,
|
|
14556
|
+
supportsEffects: true
|
|
14557
|
+
});
|
|
14005
14558
|
addSequenceStackTraces(Img);
|
|
14006
|
-
var compositionsRef =
|
|
14559
|
+
var compositionsRef = React29.createRef();
|
|
14007
14560
|
var CompositionManagerProvider = ({
|
|
14008
14561
|
children,
|
|
14009
14562
|
onlyRenderComposition,
|
|
@@ -14014,7 +14567,7 @@ var CompositionManagerProvider = ({
|
|
|
14014
14567
|
const [folders, setFolders] = useState18([]);
|
|
14015
14568
|
const [canvasContent, setCanvasContent] = useState18(initialCanvasContent);
|
|
14016
14569
|
const [compositions, setCompositions] = useState18(initialCompositions);
|
|
14017
|
-
const currentcompositionsRef =
|
|
14570
|
+
const currentcompositionsRef = useRef25(compositions);
|
|
14018
14571
|
const updateCompositions = useCallback19((updateComps) => {
|
|
14019
14572
|
setCompositions((comps) => {
|
|
14020
14573
|
const updated = updateComps(comps);
|
|
@@ -14035,14 +14588,15 @@ var CompositionManagerProvider = ({
|
|
|
14035
14588
|
return comps.filter((c2) => c2.id !== id);
|
|
14036
14589
|
});
|
|
14037
14590
|
}, []);
|
|
14038
|
-
const registerFolder = useCallback19((name, parent, nonce) => {
|
|
14591
|
+
const registerFolder = useCallback19((name, parent, nonce, stack) => {
|
|
14039
14592
|
setFolders((prevFolders) => {
|
|
14040
14593
|
return [
|
|
14041
14594
|
...prevFolders,
|
|
14042
14595
|
{
|
|
14043
14596
|
name,
|
|
14044
14597
|
parent,
|
|
14045
|
-
nonce
|
|
14598
|
+
nonce,
|
|
14599
|
+
stack
|
|
14046
14600
|
}
|
|
14047
14601
|
];
|
|
14048
14602
|
});
|
|
@@ -14081,9 +14635,9 @@ var CompositionManagerProvider = ({
|
|
|
14081
14635
|
canvasContent
|
|
14082
14636
|
};
|
|
14083
14637
|
}, [compositions, folders, currentCompositionMetadata, canvasContent]);
|
|
14084
|
-
return /* @__PURE__ */
|
|
14638
|
+
return /* @__PURE__ */ jsx29(CompositionManager.Provider, {
|
|
14085
14639
|
value: compositionManagerContextValue,
|
|
14086
|
-
children: /* @__PURE__ */
|
|
14640
|
+
children: /* @__PURE__ */ jsx29(CompositionSetters.Provider, {
|
|
14087
14641
|
value: compositionManagerSetters,
|
|
14088
14642
|
children
|
|
14089
14643
|
})
|
|
@@ -14181,7 +14735,7 @@ var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
|
14181
14735
|
var getPreviewDomElement = () => {
|
|
14182
14736
|
return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
|
|
14183
14737
|
};
|
|
14184
|
-
var MaxMediaCacheSizeContext =
|
|
14738
|
+
var MaxMediaCacheSizeContext = React30.createContext(null);
|
|
14185
14739
|
var Root = null;
|
|
14186
14740
|
var listeners = [];
|
|
14187
14741
|
var getRoot = () => {
|
|
@@ -14199,7 +14753,7 @@ var waitForRoot = (fn) => {
|
|
|
14199
14753
|
listeners = listeners.filter((l) => l !== fn);
|
|
14200
14754
|
};
|
|
14201
14755
|
};
|
|
14202
|
-
var MediaEnabledContext =
|
|
14756
|
+
var MediaEnabledContext = createContext24(null);
|
|
14203
14757
|
var useVideoEnabled = () => {
|
|
14204
14758
|
const context = useContext34(MediaEnabledContext);
|
|
14205
14759
|
if (!context) {
|
|
@@ -14226,7 +14780,7 @@ var MediaEnabledProvider = ({
|
|
|
14226
14780
|
audioEnabled
|
|
14227
14781
|
}) => {
|
|
14228
14782
|
const value = useMemo33(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
14229
|
-
return /* @__PURE__ */
|
|
14783
|
+
return /* @__PURE__ */ jsx30(MediaEnabledContext.Provider, {
|
|
14230
14784
|
value,
|
|
14231
14785
|
children
|
|
14232
14786
|
});
|
|
@@ -14250,25 +14804,25 @@ var RemotionRootContexts = ({
|
|
|
14250
14804
|
const logging = useMemo34(() => {
|
|
14251
14805
|
return { logLevel, mountTime: Date.now() };
|
|
14252
14806
|
}, [logLevel]);
|
|
14253
|
-
return /* @__PURE__ */
|
|
14807
|
+
return /* @__PURE__ */ jsx31(LogLevelContext.Provider, {
|
|
14254
14808
|
value: logging,
|
|
14255
|
-
children: /* @__PURE__ */
|
|
14809
|
+
children: /* @__PURE__ */ jsx31(NonceContext.Provider, {
|
|
14256
14810
|
value: nonceContext,
|
|
14257
|
-
children: /* @__PURE__ */
|
|
14811
|
+
children: /* @__PURE__ */ jsx31(TimelineContextProvider, {
|
|
14258
14812
|
frameState,
|
|
14259
|
-
children: /* @__PURE__ */
|
|
14813
|
+
children: /* @__PURE__ */ jsx31(MediaEnabledProvider, {
|
|
14260
14814
|
videoEnabled,
|
|
14261
14815
|
audioEnabled,
|
|
14262
|
-
children: /* @__PURE__ */
|
|
14263
|
-
children: /* @__PURE__ */
|
|
14264
|
-
children: /* @__PURE__ */
|
|
14265
|
-
children: /* @__PURE__ */
|
|
14266
|
-
children: /* @__PURE__ */
|
|
14267
|
-
children: /* @__PURE__ */
|
|
14816
|
+
children: /* @__PURE__ */ jsx31(EditorPropsProvider, {
|
|
14817
|
+
children: /* @__PURE__ */ jsx31(PrefetchProvider, {
|
|
14818
|
+
children: /* @__PURE__ */ jsx31(SequenceManagerProvider, {
|
|
14819
|
+
children: /* @__PURE__ */ jsx31(DurationsContextProvider, {
|
|
14820
|
+
children: /* @__PURE__ */ jsx31(BufferingProvider, {
|
|
14821
|
+
children: /* @__PURE__ */ jsx31(SharedAudioContextProvider, {
|
|
14268
14822
|
audioLatencyHint,
|
|
14269
14823
|
audioEnabled,
|
|
14270
14824
|
previewSampleRate,
|
|
14271
|
-
children: /* @__PURE__ */
|
|
14825
|
+
children: /* @__PURE__ */ jsx31(SharedAudioTagsContextProvider, {
|
|
14272
14826
|
numberOfAudioTags,
|
|
14273
14827
|
children
|
|
14274
14828
|
})
|
|
@@ -14454,7 +15008,7 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
14454
15008
|
};
|
|
14455
15009
|
}
|
|
14456
15010
|
};
|
|
14457
|
-
var SequenceStackTracesUpdateContext =
|
|
15011
|
+
var SequenceStackTracesUpdateContext = React32.createContext(() => {});
|
|
14458
15012
|
var getEnvVariables = () => {
|
|
14459
15013
|
if (getRemotionEnvironment().isRendering) {
|
|
14460
15014
|
const param = window.remotion_envVariables;
|
|
@@ -14480,8 +15034,8 @@ var setupEnvVariables = () => {
|
|
|
14480
15034
|
window.process.env[key] = env[key];
|
|
14481
15035
|
});
|
|
14482
15036
|
};
|
|
14483
|
-
var CurrentScaleContext =
|
|
14484
|
-
var PreviewSizeContext =
|
|
15037
|
+
var CurrentScaleContext = React33.createContext(null);
|
|
15038
|
+
var PreviewSizeContext = createContext25({
|
|
14485
15039
|
setSize: () => {
|
|
14486
15040
|
return;
|
|
14487
15041
|
},
|
|
@@ -14504,6 +15058,7 @@ var calculateScale = ({
|
|
|
14504
15058
|
}
|
|
14505
15059
|
return Number(previewSize);
|
|
14506
15060
|
};
|
|
15061
|
+
var PixelDensityContext = React34.createContext(null);
|
|
14507
15062
|
var getOffthreadVideoSource = ({
|
|
14508
15063
|
src,
|
|
14509
15064
|
transparent,
|
|
@@ -14536,9 +15091,9 @@ var OffthreadVideoForRendering = ({
|
|
|
14536
15091
|
const frame = useCurrentFrame();
|
|
14537
15092
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
|
|
14538
15093
|
const videoConfig = useUnsafeVideoConfig();
|
|
14539
|
-
const sequenceContext =
|
|
15094
|
+
const sequenceContext = useContext36(SequenceContext);
|
|
14540
15095
|
const mediaStartsAt = useMediaStartsAt();
|
|
14541
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
15096
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
|
|
14542
15097
|
if (!src) {
|
|
14543
15098
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
14544
15099
|
}
|
|
@@ -14704,7 +15259,7 @@ var OffthreadVideoForRendering = ({
|
|
|
14704
15259
|
return null;
|
|
14705
15260
|
}
|
|
14706
15261
|
continueRender2(imageSrc.handle);
|
|
14707
|
-
return /* @__PURE__ */
|
|
15262
|
+
return /* @__PURE__ */ jsx322(Img, {
|
|
14708
15263
|
src: imageSrc.src,
|
|
14709
15264
|
delayRenderRetries,
|
|
14710
15265
|
delayRenderTimeoutInMilliseconds,
|
|
@@ -14727,16 +15282,22 @@ var useEmitVideoFrame = ({
|
|
|
14727
15282
|
return;
|
|
14728
15283
|
}
|
|
14729
15284
|
let handle = 0;
|
|
14730
|
-
const callback = () => {
|
|
15285
|
+
const callback = (_now, metadata) => {
|
|
14731
15286
|
if (!ref.current) {
|
|
14732
15287
|
return;
|
|
14733
15288
|
}
|
|
14734
|
-
onVideoFrame(ref.current);
|
|
15289
|
+
onVideoFrame(ref.current, _now, metadata);
|
|
14735
15290
|
handle = ref.current.requestVideoFrameCallback(callback);
|
|
14736
15291
|
};
|
|
14737
|
-
|
|
15292
|
+
onVideoFrame(current);
|
|
15293
|
+
if (!current.requestVideoFrameCallback) {
|
|
15294
|
+
return;
|
|
15295
|
+
}
|
|
15296
|
+
handle = current.requestVideoFrameCallback(callback);
|
|
14738
15297
|
return () => {
|
|
14739
|
-
|
|
15298
|
+
if (handle) {
|
|
15299
|
+
current.cancelVideoFrameCallback(handle);
|
|
15300
|
+
}
|
|
14740
15301
|
};
|
|
14741
15302
|
}, [onVideoFrame, ref]);
|
|
14742
15303
|
};
|
|
@@ -14750,11 +15311,11 @@ class MediaPlaybackError extends Error {
|
|
|
14750
15311
|
}
|
|
14751
15312
|
}
|
|
14752
15313
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
14753
|
-
const context =
|
|
15314
|
+
const context = useContext37(SharedAudioContext);
|
|
14754
15315
|
if (!context) {
|
|
14755
15316
|
throw new Error("SharedAudioContext not found");
|
|
14756
15317
|
}
|
|
14757
|
-
const videoRef =
|
|
15318
|
+
const videoRef = useRef26(null);
|
|
14758
15319
|
const sharedSource = useMemo36(() => {
|
|
14759
15320
|
if (!context.audioContext) {
|
|
14760
15321
|
return null;
|
|
@@ -14764,7 +15325,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
14764
15325
|
ref: videoRef
|
|
14765
15326
|
});
|
|
14766
15327
|
}, [context.audioContext]);
|
|
14767
|
-
const effectToUse =
|
|
15328
|
+
const effectToUse = React36.useInsertionEffect ?? React36.useLayoutEffect;
|
|
14768
15329
|
effectToUse(() => {
|
|
14769
15330
|
return () => {
|
|
14770
15331
|
requestAnimationFrame(() => {
|
|
@@ -14807,7 +15368,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
14807
15368
|
}
|
|
14808
15369
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
14809
15370
|
const { fps, durationInFrames } = useVideoConfig();
|
|
14810
|
-
const parentSequence =
|
|
15371
|
+
const parentSequence = useContext37(SequenceContext);
|
|
14811
15372
|
const logLevel = useLogLevel();
|
|
14812
15373
|
const mountTime = useMountTime();
|
|
14813
15374
|
const [timelineId] = useState20(() => String(Math.random()));
|
|
@@ -14927,7 +15488,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
14927
15488
|
current.removeEventListener("error", errorHandler);
|
|
14928
15489
|
};
|
|
14929
15490
|
}, [onError, src]);
|
|
14930
|
-
const currentOnDurationCallback =
|
|
15491
|
+
const currentOnDurationCallback = useRef26(onDuration);
|
|
14931
15492
|
currentOnDurationCallback.current = onDuration;
|
|
14932
15493
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
14933
15494
|
useEffect20(() => {
|
|
@@ -14968,7 +15529,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
14968
15529
|
requestsVideoFrame: Boolean(onVideoFrame),
|
|
14969
15530
|
isClientSideRendering: false
|
|
14970
15531
|
});
|
|
14971
|
-
return /* @__PURE__ */
|
|
15532
|
+
return /* @__PURE__ */ jsx33("video", {
|
|
14972
15533
|
ref: videoRef,
|
|
14973
15534
|
muted: muted || mediaMuted || userPreferredVolume <= 0,
|
|
14974
15535
|
playsInline: true,
|
|
@@ -15011,13 +15572,13 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
15011
15572
|
trimAfter
|
|
15012
15573
|
});
|
|
15013
15574
|
if (typeof trimBeforeValue !== "undefined" || typeof trimAfterValue !== "undefined") {
|
|
15014
|
-
return /* @__PURE__ */
|
|
15575
|
+
return /* @__PURE__ */ jsx34(Sequence, {
|
|
15015
15576
|
layout: "none",
|
|
15016
15577
|
from: 0 - (trimBeforeValue ?? 0),
|
|
15017
15578
|
showInTimeline: false,
|
|
15018
15579
|
durationInFrames: trimAfterValue,
|
|
15019
15580
|
name,
|
|
15020
|
-
children: /* @__PURE__ */
|
|
15581
|
+
children: /* @__PURE__ */ jsx34(InnerOffthreadVideo, {
|
|
15021
15582
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
15022
15583
|
...otherProps,
|
|
15023
15584
|
trimAfter: undefined,
|
|
@@ -15032,7 +15593,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
15032
15593
|
}
|
|
15033
15594
|
validateMediaProps(props2, "Video");
|
|
15034
15595
|
if (environment.isRendering) {
|
|
15035
|
-
return /* @__PURE__ */
|
|
15596
|
+
return /* @__PURE__ */ jsx34(OffthreadVideoForRendering, {
|
|
15036
15597
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
15037
15598
|
...otherProps,
|
|
15038
15599
|
trimAfter: undefined,
|
|
@@ -15054,7 +15615,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
15054
15615
|
delayRenderTimeoutInMilliseconds,
|
|
15055
15616
|
...propsForPreview
|
|
15056
15617
|
} = otherProps;
|
|
15057
|
-
return /* @__PURE__ */
|
|
15618
|
+
return /* @__PURE__ */ jsx34(VideoForPreview, {
|
|
15058
15619
|
_remotionInternalStack: stack ?? null,
|
|
15059
15620
|
onDuration,
|
|
15060
15621
|
onlyWarnForMediaSeekingError: true,
|
|
@@ -15072,11 +15633,9 @@ var OffthreadVideo = ({
|
|
|
15072
15633
|
acceptableTimeShiftInSeconds,
|
|
15073
15634
|
allowAmplificationDuringRender,
|
|
15074
15635
|
audioStreamIndex,
|
|
15075
|
-
className,
|
|
15076
15636
|
crossOrigin,
|
|
15077
15637
|
delayRenderRetries,
|
|
15078
15638
|
delayRenderTimeoutInMilliseconds,
|
|
15079
|
-
id,
|
|
15080
15639
|
loopVolumeCurveBehavior,
|
|
15081
15640
|
muted,
|
|
15082
15641
|
name,
|
|
@@ -15099,20 +15658,19 @@ var OffthreadVideo = ({
|
|
|
15099
15658
|
endAt,
|
|
15100
15659
|
stack,
|
|
15101
15660
|
startFrom,
|
|
15102
|
-
imageFormat
|
|
15661
|
+
imageFormat,
|
|
15662
|
+
...props2
|
|
15103
15663
|
}) => {
|
|
15104
15664
|
if (imageFormat) {
|
|
15105
15665
|
throw new TypeError(`The \`<OffthreadVideo>\` tag does no longer accept \`imageFormat\`. Use the \`transparent\` prop if you want to render a transparent video.`);
|
|
15106
15666
|
}
|
|
15107
|
-
return /* @__PURE__ */
|
|
15667
|
+
return /* @__PURE__ */ jsx34(InnerOffthreadVideo, {
|
|
15108
15668
|
acceptableTimeShiftInSeconds,
|
|
15109
15669
|
allowAmplificationDuringRender: allowAmplificationDuringRender ?? true,
|
|
15110
15670
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
15111
|
-
className,
|
|
15112
15671
|
crossOrigin,
|
|
15113
15672
|
delayRenderRetries,
|
|
15114
15673
|
delayRenderTimeoutInMilliseconds,
|
|
15115
|
-
id,
|
|
15116
15674
|
loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
|
|
15117
15675
|
muted: muted ?? false,
|
|
15118
15676
|
name,
|
|
@@ -15135,24 +15693,25 @@ var OffthreadVideo = ({
|
|
|
15135
15693
|
trimAfter,
|
|
15136
15694
|
trimBefore,
|
|
15137
15695
|
useWebAudioApi: useWebAudioApi ?? false,
|
|
15138
|
-
volume
|
|
15696
|
+
volume,
|
|
15697
|
+
...props2
|
|
15139
15698
|
});
|
|
15140
15699
|
};
|
|
15141
15700
|
addSequenceStackTraces(OffthreadVideo);
|
|
15142
15701
|
var WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged";
|
|
15143
15702
|
function useRemotionContexts() {
|
|
15144
|
-
const compositionManagerCtx =
|
|
15145
|
-
const timelineContext =
|
|
15146
|
-
const setTimelineContext =
|
|
15147
|
-
const sequenceContext =
|
|
15148
|
-
const nonceContext =
|
|
15149
|
-
const canUseRemotionHooksContext =
|
|
15150
|
-
const preloadContext =
|
|
15151
|
-
const resolveCompositionContext =
|
|
15152
|
-
const renderAssetManagerContext =
|
|
15153
|
-
const sequenceManagerContext =
|
|
15154
|
-
const bufferManagerContext =
|
|
15155
|
-
const logLevelContext =
|
|
15703
|
+
const compositionManagerCtx = React38.useContext(CompositionManager);
|
|
15704
|
+
const timelineContext = React38.useContext(TimelineContext);
|
|
15705
|
+
const setTimelineContext = React38.useContext(SetTimelineContext);
|
|
15706
|
+
const sequenceContext = React38.useContext(SequenceContext);
|
|
15707
|
+
const nonceContext = React38.useContext(NonceContext);
|
|
15708
|
+
const canUseRemotionHooksContext = React38.useContext(CanUseRemotionHooks);
|
|
15709
|
+
const preloadContext = React38.useContext(PreloadContext);
|
|
15710
|
+
const resolveCompositionContext = React38.useContext(ResolveCompositionContext);
|
|
15711
|
+
const renderAssetManagerContext = React38.useContext(RenderAssetManager);
|
|
15712
|
+
const sequenceManagerContext = React38.useContext(SequenceManager);
|
|
15713
|
+
const bufferManagerContext = React38.useContext(BufferingContextReact);
|
|
15714
|
+
const logLevelContext = React38.useContext(LogLevelContext);
|
|
15156
15715
|
return useMemo37(() => ({
|
|
15157
15716
|
compositionManagerCtx,
|
|
15158
15717
|
timelineContext,
|
|
@@ -15183,29 +15742,29 @@ function useRemotionContexts() {
|
|
|
15183
15742
|
}
|
|
15184
15743
|
var RemotionContextProvider = (props2) => {
|
|
15185
15744
|
const { children, contexts } = props2;
|
|
15186
|
-
return /* @__PURE__ */
|
|
15745
|
+
return /* @__PURE__ */ jsx35(LogLevelContext.Provider, {
|
|
15187
15746
|
value: contexts.logLevelContext,
|
|
15188
|
-
children: /* @__PURE__ */
|
|
15747
|
+
children: /* @__PURE__ */ jsx35(CanUseRemotionHooks.Provider, {
|
|
15189
15748
|
value: contexts.canUseRemotionHooksContext,
|
|
15190
|
-
children: /* @__PURE__ */
|
|
15749
|
+
children: /* @__PURE__ */ jsx35(NonceContext.Provider, {
|
|
15191
15750
|
value: contexts.nonceContext,
|
|
15192
|
-
children: /* @__PURE__ */
|
|
15751
|
+
children: /* @__PURE__ */ jsx35(PreloadContext.Provider, {
|
|
15193
15752
|
value: contexts.preloadContext,
|
|
15194
|
-
children: /* @__PURE__ */
|
|
15753
|
+
children: /* @__PURE__ */ jsx35(CompositionManager.Provider, {
|
|
15195
15754
|
value: contexts.compositionManagerCtx,
|
|
15196
|
-
children: /* @__PURE__ */
|
|
15755
|
+
children: /* @__PURE__ */ jsx35(SequenceManager.Provider, {
|
|
15197
15756
|
value: contexts.sequenceManagerContext,
|
|
15198
|
-
children: /* @__PURE__ */
|
|
15757
|
+
children: /* @__PURE__ */ jsx35(RenderAssetManager.Provider, {
|
|
15199
15758
|
value: contexts.renderAssetManagerContext,
|
|
15200
|
-
children: /* @__PURE__ */
|
|
15759
|
+
children: /* @__PURE__ */ jsx35(ResolveCompositionContext.Provider, {
|
|
15201
15760
|
value: contexts.resolveCompositionContext,
|
|
15202
|
-
children: /* @__PURE__ */
|
|
15761
|
+
children: /* @__PURE__ */ jsx35(TimelineContext.Provider, {
|
|
15203
15762
|
value: contexts.timelineContext,
|
|
15204
|
-
children: /* @__PURE__ */
|
|
15763
|
+
children: /* @__PURE__ */ jsx35(SetTimelineContext.Provider, {
|
|
15205
15764
|
value: contexts.setTimelineContext,
|
|
15206
|
-
children: /* @__PURE__ */
|
|
15765
|
+
children: /* @__PURE__ */ jsx35(SequenceContext.Provider, {
|
|
15207
15766
|
value: contexts.sequenceContext,
|
|
15208
|
-
children: /* @__PURE__ */
|
|
15767
|
+
children: /* @__PURE__ */ jsx35(BufferingContextReact.Provider, {
|
|
15209
15768
|
value: contexts.bufferManagerContext,
|
|
15210
15769
|
children
|
|
15211
15770
|
})
|
|
@@ -15273,8 +15832,10 @@ var Internals = {
|
|
|
15273
15832
|
SharedAudioTagsContext,
|
|
15274
15833
|
SharedAudioTagsContextProvider,
|
|
15275
15834
|
invalidCompositionErrorMessage,
|
|
15835
|
+
invalidFolderNameErrorMessage,
|
|
15276
15836
|
calculateMediaDuration,
|
|
15277
15837
|
isCompositionIdValid,
|
|
15838
|
+
isFolderNameValid,
|
|
15278
15839
|
getPreviewDomElement,
|
|
15279
15840
|
compositionsRef,
|
|
15280
15841
|
portalNode,
|
|
@@ -15309,6 +15870,7 @@ var Internals = {
|
|
|
15309
15870
|
BufferingContextReact,
|
|
15310
15871
|
getComponentsToAddStacksTo,
|
|
15311
15872
|
CurrentScaleContext,
|
|
15873
|
+
PixelDensityContext,
|
|
15312
15874
|
PreviewSizeContext,
|
|
15313
15875
|
calculateScale,
|
|
15314
15876
|
validateRenderAsset,
|
|
@@ -15348,13 +15910,19 @@ var Internals = {
|
|
|
15348
15910
|
createWebGL2ContextError,
|
|
15349
15911
|
computeEffectiveSchemaValuesDotNotation,
|
|
15350
15912
|
interpolateKeyframedStatus,
|
|
15913
|
+
makeStaticDragOverride,
|
|
15914
|
+
makeKeyframedDragOverride,
|
|
15915
|
+
resolveDragOverrideValue,
|
|
15916
|
+
getStaticDragOverrideValue,
|
|
15351
15917
|
OverrideIdsToNodePathsGettersContext,
|
|
15352
15918
|
OverrideIdsToNodePathsSettersContext,
|
|
15353
15919
|
findPropsToDelete,
|
|
15354
15920
|
makeSequencePropsSubscriptionKey,
|
|
15355
15921
|
getCodeValuesCtx,
|
|
15356
15922
|
getEffectCodeValuesCtx,
|
|
15357
|
-
hiddenField
|
|
15923
|
+
hiddenField,
|
|
15924
|
+
durationInFramesField,
|
|
15925
|
+
fromField
|
|
15358
15926
|
};
|
|
15359
15927
|
var validateFrame = ({
|
|
15360
15928
|
allowFloats,
|
|
@@ -15381,34 +15949,15 @@ var validateFrame = ({
|
|
|
15381
15949
|
}
|
|
15382
15950
|
};
|
|
15383
15951
|
var flattenChildren = (children) => {
|
|
15384
|
-
const childrenArray =
|
|
15952
|
+
const childrenArray = React39.Children.toArray(children);
|
|
15385
15953
|
return childrenArray.reduce((flatChildren, child) => {
|
|
15386
|
-
if (child.type ===
|
|
15954
|
+
if (child.type === React39.Fragment) {
|
|
15387
15955
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
15388
15956
|
}
|
|
15389
15957
|
flatChildren.push(child);
|
|
15390
15958
|
return flatChildren;
|
|
15391
15959
|
}, []);
|
|
15392
15960
|
};
|
|
15393
|
-
var IsInsideSeriesContext = createContext25(false);
|
|
15394
|
-
var IsInsideSeriesContainer = ({ children }) => {
|
|
15395
|
-
return /* @__PURE__ */ jsx35(IsInsideSeriesContext.Provider, {
|
|
15396
|
-
value: true,
|
|
15397
|
-
children
|
|
15398
|
-
});
|
|
15399
|
-
};
|
|
15400
|
-
var IsNotInsideSeriesProvider = ({ children }) => {
|
|
15401
|
-
return /* @__PURE__ */ jsx35(IsInsideSeriesContext.Provider, {
|
|
15402
|
-
value: false,
|
|
15403
|
-
children
|
|
15404
|
-
});
|
|
15405
|
-
};
|
|
15406
|
-
var useRequireToBeInsideSeries = () => {
|
|
15407
|
-
const isInsideSeries = React38.useContext(IsInsideSeriesContext);
|
|
15408
|
-
if (!isInsideSeries) {
|
|
15409
|
-
throw new Error("This component must be inside a <Series /> component.");
|
|
15410
|
-
}
|
|
15411
|
-
};
|
|
15412
15961
|
var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
15413
15962
|
useRequireToBeInsideSeries();
|
|
15414
15963
|
return /* @__PURE__ */ jsx36(IsNotInsideSeriesProvider, {
|
|
@@ -15479,7 +16028,11 @@ var SeriesInner = (props2) => {
|
|
|
15479
16028
|
})
|
|
15480
16029
|
});
|
|
15481
16030
|
};
|
|
15482
|
-
var Series = Object.assign(wrapInSchema(
|
|
16031
|
+
var Series = Object.assign(wrapInSchema({
|
|
16032
|
+
Component: SeriesInner,
|
|
16033
|
+
schema: sequenceSchemaDefaultLayoutNone,
|
|
16034
|
+
supportsEffects: false
|
|
16035
|
+
}), {
|
|
15483
16036
|
Sequence: SeriesSequence
|
|
15484
16037
|
});
|
|
15485
16038
|
addSequenceStackTraces(Series);
|
|
@@ -15949,14 +16502,14 @@ var VideoForRenderingForwardFunction = ({
|
|
|
15949
16502
|
const frame = useCurrentFrame();
|
|
15950
16503
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
15951
16504
|
const videoConfig = useUnsafeVideoConfig();
|
|
15952
|
-
const videoRef =
|
|
15953
|
-
const sequenceContext =
|
|
16505
|
+
const videoRef = useRef27(null);
|
|
16506
|
+
const sequenceContext = useContext38(SequenceContext);
|
|
15954
16507
|
const mediaStartsAt = useMediaStartsAt();
|
|
15955
16508
|
const environment = useRemotionEnvironment();
|
|
15956
16509
|
const logLevel = useLogLevel();
|
|
15957
16510
|
const mountTime = useMountTime();
|
|
15958
16511
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
15959
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
16512
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext38(RenderAssetManager);
|
|
15960
16513
|
const id = useMemo39(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
15961
16514
|
props2.src,
|
|
15962
16515
|
sequenceContext?.cumulatedFrom,
|
|
@@ -16015,6 +16568,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
16015
16568
|
useImperativeHandle10(ref, () => {
|
|
16016
16569
|
return videoRef.current;
|
|
16017
16570
|
}, []);
|
|
16571
|
+
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
16018
16572
|
useEffect21(() => {
|
|
16019
16573
|
if (!window.remotion_videoEnabled) {
|
|
16020
16574
|
return;
|
|
@@ -16158,6 +16712,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
16158
16712
|
_remotionInternalNativeLoopPassed,
|
|
16159
16713
|
showInTimeline,
|
|
16160
16714
|
onAutoPlayError,
|
|
16715
|
+
onVideoFrame,
|
|
16161
16716
|
...otherProps
|
|
16162
16717
|
} = props2;
|
|
16163
16718
|
const { loop, ...propsOtherThanLoop } = props2;
|
|
@@ -16166,7 +16721,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
16166
16721
|
if (environment.isClientSideRendering) {
|
|
16167
16722
|
throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
16168
16723
|
}
|
|
16169
|
-
const { durations, setDurations } =
|
|
16724
|
+
const { durations, setDurations } = useContext39(DurationsContext);
|
|
16170
16725
|
if (typeof ref === "string") {
|
|
16171
16726
|
throw new Error("string refs are not supported");
|
|
16172
16727
|
}
|
|
@@ -16177,7 +16732,6 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
16177
16732
|
const onDuration = useCallback23((src, durationInSeconds) => {
|
|
16178
16733
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
16179
16734
|
}, [setDurations]);
|
|
16180
|
-
const onVideoFrame = useCallback23(() => {}, []);
|
|
16181
16735
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
16182
16736
|
validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
|
|
16183
16737
|
const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
|
|
@@ -16223,6 +16777,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
16223
16777
|
name,
|
|
16224
16778
|
children: /* @__PURE__ */ jsx38(Html5Video, {
|
|
16225
16779
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
16780
|
+
onVideoFrame,
|
|
16226
16781
|
...otherProps,
|
|
16227
16782
|
ref,
|
|
16228
16783
|
stack
|
|
@@ -16246,7 +16801,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
16246
16801
|
onlyWarnForMediaSeekingError: false,
|
|
16247
16802
|
...otherProps,
|
|
16248
16803
|
ref,
|
|
16249
|
-
onVideoFrame: null,
|
|
16804
|
+
onVideoFrame: onVideoFrame ?? null,
|
|
16250
16805
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
16251
16806
|
onDuration,
|
|
16252
16807
|
_remotionInternalStack: stack ?? null,
|
|
@@ -16281,11 +16836,12 @@ var Config = new Proxy(proxyObj, {
|
|
|
16281
16836
|
Sequence.displayName = "Sequence";
|
|
16282
16837
|
addSequenceStackTraces(Sequence);
|
|
16283
16838
|
addSequenceStackTraces(Composition);
|
|
16839
|
+
addSequenceStackTraces(Folder);
|
|
16284
16840
|
|
|
16285
16841
|
// ../design/dist/esm/index.mjs
|
|
16286
16842
|
import { jsx as jsx210, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
16287
16843
|
import { jsx as jsx310, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
16288
|
-
import { useEffect as useEffect23, useMemo as useMemo210, useRef as
|
|
16844
|
+
import { useEffect as useEffect23, useMemo as useMemo210, useRef as useRef29 } from "react";
|
|
16289
16845
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
16290
16846
|
import { jsx as jsx53, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
16291
16847
|
import React62 from "react";
|
|
@@ -16308,15 +16864,15 @@ import { Fragment as Fragment5, jsx as jsx142 } from "react/jsx-runtime";
|
|
|
16308
16864
|
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
16309
16865
|
import * as React122 from "react";
|
|
16310
16866
|
import { jsx as jsx162 } from "react/jsx-runtime";
|
|
16311
|
-
import * as
|
|
16312
|
-
import * as
|
|
16867
|
+
import * as React162 from "react";
|
|
16868
|
+
import * as React132 from "react";
|
|
16313
16869
|
import * as ReactDOM from "react-dom";
|
|
16314
16870
|
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
16315
|
-
import * as
|
|
16871
|
+
import * as React14 from "react";
|
|
16316
16872
|
import * as React152 from "react";
|
|
16317
16873
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
16318
16874
|
import * as React17 from "react";
|
|
16319
|
-
import * as
|
|
16875
|
+
import * as React18 from "react";
|
|
16320
16876
|
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
16321
16877
|
import * as React202 from "react";
|
|
16322
16878
|
import * as React192 from "react";
|
|
@@ -16326,41 +16882,41 @@ import { useLayoutEffect as useLayoutEffect32, useEffect as useEffect82 } from "
|
|
|
16326
16882
|
import * as ReactDOM2 from "react-dom";
|
|
16327
16883
|
import * as React222 from "react";
|
|
16328
16884
|
import { jsx as jsx202 } from "react/jsx-runtime";
|
|
16329
|
-
import * as
|
|
16885
|
+
import * as React232 from "react";
|
|
16330
16886
|
import { jsx as jsx212 } from "react/jsx-runtime";
|
|
16331
16887
|
import * as React25 from "react";
|
|
16332
16888
|
import ReactDOM3 from "react-dom";
|
|
16333
16889
|
import { jsx as jsx223 } from "react/jsx-runtime";
|
|
16334
16890
|
import * as React26 from "react";
|
|
16335
16891
|
import * as React27 from "react";
|
|
16336
|
-
import * as
|
|
16892
|
+
import * as React28 from "react";
|
|
16337
16893
|
import { jsx as jsx232 } from "react/jsx-runtime";
|
|
16338
|
-
import * as
|
|
16339
|
-
import * as
|
|
16894
|
+
import * as React352 from "react";
|
|
16895
|
+
import * as React31 from "react";
|
|
16340
16896
|
import { useState as useState112 } from "react";
|
|
16341
16897
|
import * as React292 from "react";
|
|
16342
|
-
import * as
|
|
16898
|
+
import * as React302 from "react";
|
|
16343
16899
|
import * as React342 from "react";
|
|
16344
16900
|
import * as React332 from "react";
|
|
16345
16901
|
import * as React322 from "react";
|
|
16346
16902
|
import { Fragment as Fragment8, jsx as jsx242, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
16347
16903
|
import { forwardRef as forwardRef142, createElement as createElement7 } from "react";
|
|
16348
16904
|
import { forwardRef as forwardRef132, createElement as createElement6 } from "react";
|
|
16349
|
-
import * as
|
|
16905
|
+
import * as React37 from "react";
|
|
16350
16906
|
import { jsx as jsx252, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
16351
16907
|
import { jsx as jsx262 } from "react/jsx-runtime";
|
|
16352
16908
|
import * as React49 from "react";
|
|
16353
16909
|
import * as React382 from "react";
|
|
16354
16910
|
import { jsx as jsx272 } from "react/jsx-runtime";
|
|
16355
16911
|
import * as React47 from "react";
|
|
16356
|
-
import
|
|
16357
|
-
import * as
|
|
16912
|
+
import React40 from "react";
|
|
16913
|
+
import * as React392 from "react";
|
|
16358
16914
|
import { Fragment as Fragment22, jsx as jsx282 } from "react/jsx-runtime";
|
|
16359
16915
|
import { jsx as jsx292 } from "react/jsx-runtime";
|
|
16360
16916
|
import React210 from "react";
|
|
16361
16917
|
import { jsx as jsx2102 } from "react/jsx-runtime";
|
|
16362
16918
|
import * as React42 from "react";
|
|
16363
|
-
import * as
|
|
16919
|
+
import * as React412 from "react";
|
|
16364
16920
|
import * as React43 from "react";
|
|
16365
16921
|
import * as ReactDOM5 from "react-dom";
|
|
16366
16922
|
import { jsx as jsx302 } from "react/jsx-runtime";
|
|
@@ -16413,7 +16969,7 @@ function useComposedRefs(...refs) {
|
|
|
16413
16969
|
return React3.useCallback(composeRefs(...refs), refs);
|
|
16414
16970
|
}
|
|
16415
16971
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
16416
|
-
var use =
|
|
16972
|
+
var use = React23[" use ".trim().toString()];
|
|
16417
16973
|
function isPromiseLike(value) {
|
|
16418
16974
|
return typeof value === "object" && value !== null && "then" in value;
|
|
16419
16975
|
}
|
|
@@ -16422,25 +16978,25 @@ function isLazyComponent(element) {
|
|
|
16422
16978
|
}
|
|
16423
16979
|
function createSlot(ownerName) {
|
|
16424
16980
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
16425
|
-
const Slot2 =
|
|
16981
|
+
const Slot2 = React23.forwardRef((props, forwardedRef) => {
|
|
16426
16982
|
let { children, ...slotProps } = props;
|
|
16427
16983
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
16428
16984
|
children = use(children._payload);
|
|
16429
16985
|
}
|
|
16430
|
-
const childrenArray =
|
|
16986
|
+
const childrenArray = React23.Children.toArray(children);
|
|
16431
16987
|
const slottable = childrenArray.find(isSlottable);
|
|
16432
16988
|
if (slottable) {
|
|
16433
16989
|
const newElement = slottable.props.children;
|
|
16434
16990
|
const newChildren = childrenArray.map((child) => {
|
|
16435
16991
|
if (child === slottable) {
|
|
16436
|
-
if (
|
|
16437
|
-
return
|
|
16438
|
-
return
|
|
16992
|
+
if (React23.Children.count(newElement) > 1)
|
|
16993
|
+
return React23.Children.only(null);
|
|
16994
|
+
return React23.isValidElement(newElement) ? newElement.props.children : null;
|
|
16439
16995
|
} else {
|
|
16440
16996
|
return child;
|
|
16441
16997
|
}
|
|
16442
16998
|
});
|
|
16443
|
-
return /* @__PURE__ */ jsx39(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
16999
|
+
return /* @__PURE__ */ jsx39(SlotClone, { ...slotProps, ref: forwardedRef, children: React23.isValidElement(newElement) ? React23.cloneElement(newElement, undefined, newChildren) : null });
|
|
16444
17000
|
}
|
|
16445
17001
|
return /* @__PURE__ */ jsx39(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
16446
17002
|
});
|
|
@@ -16449,20 +17005,20 @@ function createSlot(ownerName) {
|
|
|
16449
17005
|
}
|
|
16450
17006
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
16451
17007
|
function createSlotClone(ownerName) {
|
|
16452
|
-
const SlotClone =
|
|
17008
|
+
const SlotClone = React23.forwardRef((props, forwardedRef) => {
|
|
16453
17009
|
let { children, ...slotProps } = props;
|
|
16454
17010
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
16455
17011
|
children = use(children._payload);
|
|
16456
17012
|
}
|
|
16457
|
-
if (
|
|
17013
|
+
if (React23.isValidElement(children)) {
|
|
16458
17014
|
const childrenRef = getElementRef(children);
|
|
16459
17015
|
const props2 = mergeProps(slotProps, children.props);
|
|
16460
|
-
if (children.type !==
|
|
17016
|
+
if (children.type !== React23.Fragment) {
|
|
16461
17017
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
16462
17018
|
}
|
|
16463
|
-
return
|
|
17019
|
+
return React23.cloneElement(children, props2);
|
|
16464
17020
|
}
|
|
16465
|
-
return
|
|
17021
|
+
return React23.Children.count(children) > 1 ? React23.Children.only(null) : null;
|
|
16466
17022
|
});
|
|
16467
17023
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
16468
17024
|
return SlotClone;
|
|
@@ -16478,7 +17034,7 @@ function createSlottable(ownerName) {
|
|
|
16478
17034
|
}
|
|
16479
17035
|
var Slottable = /* @__PURE__ */ createSlottable("Slottable");
|
|
16480
17036
|
function isSlottable(child) {
|
|
16481
|
-
return
|
|
17037
|
+
return React23.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
16482
17038
|
}
|
|
16483
17039
|
function mergeProps(slotProps, childProps) {
|
|
16484
17040
|
const overrideProps = { ...childProps };
|
|
@@ -16535,7 +17091,7 @@ var getChildNodeFrom = (htmlElement) => {
|
|
|
16535
17091
|
return childNode;
|
|
16536
17092
|
};
|
|
16537
17093
|
var useHoverTransforms = (ref, disabled) => {
|
|
16538
|
-
const [state, setState] =
|
|
17094
|
+
const [state, setState] = React35.useState({
|
|
16539
17095
|
progress: 0,
|
|
16540
17096
|
isActive: false
|
|
16541
17097
|
});
|
|
@@ -16547,7 +17103,7 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
16547
17103
|
eventTarget.dispatchEvent(new Event("enabled"));
|
|
16548
17104
|
}
|
|
16549
17105
|
}, [disabled, eventTarget]);
|
|
16550
|
-
|
|
17106
|
+
React35.useEffect(() => {
|
|
16551
17107
|
const element = ref.current;
|
|
16552
17108
|
if (!element)
|
|
16553
17109
|
return;
|
|
@@ -16622,8 +17178,8 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
16622
17178
|
return state;
|
|
16623
17179
|
};
|
|
16624
17180
|
var useClickTransforms = (ref) => {
|
|
16625
|
-
const [hoverProgress, setHoverProgress] =
|
|
16626
|
-
|
|
17181
|
+
const [hoverProgress, setHoverProgress] = React35.useState(0);
|
|
17182
|
+
React35.useEffect(() => {
|
|
16627
17183
|
const element = getChildNodeFrom(ref.current);
|
|
16628
17184
|
if (!element) {
|
|
16629
17185
|
return;
|
|
@@ -16807,7 +17363,7 @@ var Spinner = ({ size, duration }) => {
|
|
|
16807
17363
|
height: size
|
|
16808
17364
|
};
|
|
16809
17365
|
}, [size]);
|
|
16810
|
-
const pathsRef =
|
|
17366
|
+
const pathsRef = useRef29([]);
|
|
16811
17367
|
useEffect23(() => {
|
|
16812
17368
|
const animate = () => {
|
|
16813
17369
|
const now = performance.now();
|
|
@@ -16853,7 +17409,7 @@ var Button = ({
|
|
|
16853
17409
|
...rest
|
|
16854
17410
|
}) => {
|
|
16855
17411
|
const [dimensions, setDimensions] = useState22(null);
|
|
16856
|
-
const ref =
|
|
17412
|
+
const ref = useRef28(null);
|
|
16857
17413
|
const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
|
|
16858
17414
|
const onPointerEnter = useCallback25((e) => {
|
|
16859
17415
|
if (e.pointerType !== "mouse") {
|
|
@@ -17351,7 +17907,7 @@ var NODES = [
|
|
|
17351
17907
|
"ul"
|
|
17352
17908
|
];
|
|
17353
17909
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
17354
|
-
const Node2 =
|
|
17910
|
+
const Node2 = React132.forwardRef((props, forwardedRef) => {
|
|
17355
17911
|
const { asChild, ...primitiveProps } = props;
|
|
17356
17912
|
const Comp = asChild ? Slot2 : node;
|
|
17357
17913
|
if (typeof window !== "undefined") {
|
|
@@ -17367,11 +17923,11 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
17367
17923
|
ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
17368
17924
|
}
|
|
17369
17925
|
function useCallbackRef(callback) {
|
|
17370
|
-
const callbackRef =
|
|
17371
|
-
|
|
17926
|
+
const callbackRef = React14.useRef(callback);
|
|
17927
|
+
React14.useEffect(() => {
|
|
17372
17928
|
callbackRef.current = callback;
|
|
17373
17929
|
});
|
|
17374
|
-
return
|
|
17930
|
+
return React14.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
17375
17931
|
}
|
|
17376
17932
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
17377
17933
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
@@ -17390,12 +17946,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
17390
17946
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
17391
17947
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
17392
17948
|
var originalBodyPointerEvents;
|
|
17393
|
-
var DismissableLayerContext =
|
|
17949
|
+
var DismissableLayerContext = React162.createContext({
|
|
17394
17950
|
layers: /* @__PURE__ */ new Set,
|
|
17395
17951
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set,
|
|
17396
17952
|
branches: /* @__PURE__ */ new Set
|
|
17397
17953
|
});
|
|
17398
|
-
var DismissableLayer =
|
|
17954
|
+
var DismissableLayer = React162.forwardRef((props, forwardedRef) => {
|
|
17399
17955
|
const {
|
|
17400
17956
|
disableOutsidePointerEvents = false,
|
|
17401
17957
|
onEscapeKeyDown,
|
|
@@ -17405,10 +17961,10 @@ var DismissableLayer = React16.forwardRef((props, forwardedRef) => {
|
|
|
17405
17961
|
onDismiss,
|
|
17406
17962
|
...layerProps
|
|
17407
17963
|
} = props;
|
|
17408
|
-
const context =
|
|
17409
|
-
const [node, setNode] =
|
|
17964
|
+
const context = React162.useContext(DismissableLayerContext);
|
|
17965
|
+
const [node, setNode] = React162.useState(null);
|
|
17410
17966
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
17411
|
-
const [, force] =
|
|
17967
|
+
const [, force] = React162.useState({});
|
|
17412
17968
|
const composedRefs = useComposedRefs2(forwardedRef, (node2) => setNode(node2));
|
|
17413
17969
|
const layers = Array.from(context.layers);
|
|
17414
17970
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -17446,7 +18002,7 @@ var DismissableLayer = React16.forwardRef((props, forwardedRef) => {
|
|
|
17446
18002
|
onDismiss();
|
|
17447
18003
|
}
|
|
17448
18004
|
}, ownerDocument);
|
|
17449
|
-
|
|
18005
|
+
React162.useEffect(() => {
|
|
17450
18006
|
if (!node)
|
|
17451
18007
|
return;
|
|
17452
18008
|
if (disableOutsidePointerEvents) {
|
|
@@ -17464,7 +18020,7 @@ var DismissableLayer = React16.forwardRef((props, forwardedRef) => {
|
|
|
17464
18020
|
}
|
|
17465
18021
|
};
|
|
17466
18022
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
17467
|
-
|
|
18023
|
+
React162.useEffect(() => {
|
|
17468
18024
|
return () => {
|
|
17469
18025
|
if (!node)
|
|
17470
18026
|
return;
|
|
@@ -17473,7 +18029,7 @@ var DismissableLayer = React16.forwardRef((props, forwardedRef) => {
|
|
|
17473
18029
|
dispatchUpdate();
|
|
17474
18030
|
};
|
|
17475
18031
|
}, [node, context]);
|
|
17476
|
-
|
|
18032
|
+
React162.useEffect(() => {
|
|
17477
18033
|
const handleUpdate = () => force({});
|
|
17478
18034
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
17479
18035
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -17492,11 +18048,11 @@ var DismissableLayer = React16.forwardRef((props, forwardedRef) => {
|
|
|
17492
18048
|
});
|
|
17493
18049
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
17494
18050
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
17495
|
-
var DismissableLayerBranch =
|
|
17496
|
-
const context =
|
|
17497
|
-
const ref =
|
|
18051
|
+
var DismissableLayerBranch = React162.forwardRef((props, forwardedRef) => {
|
|
18052
|
+
const context = React162.useContext(DismissableLayerContext);
|
|
18053
|
+
const ref = React162.useRef(null);
|
|
17498
18054
|
const composedRefs = useComposedRefs2(forwardedRef, ref);
|
|
17499
|
-
|
|
18055
|
+
React162.useEffect(() => {
|
|
17500
18056
|
const node = ref.current;
|
|
17501
18057
|
if (node) {
|
|
17502
18058
|
context.branches.add(node);
|
|
@@ -17510,9 +18066,9 @@ var DismissableLayerBranch = React16.forwardRef((props, forwardedRef) => {
|
|
|
17510
18066
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
17511
18067
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
17512
18068
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
17513
|
-
const isPointerInsideReactTreeRef =
|
|
17514
|
-
const handleClickRef =
|
|
17515
|
-
|
|
18069
|
+
const isPointerInsideReactTreeRef = React162.useRef(false);
|
|
18070
|
+
const handleClickRef = React162.useRef(() => {});
|
|
18071
|
+
React162.useEffect(() => {
|
|
17516
18072
|
const handlePointerDown = (event) => {
|
|
17517
18073
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
17518
18074
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -17547,8 +18103,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
17547
18103
|
}
|
|
17548
18104
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
17549
18105
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
17550
|
-
const isFocusInsideReactTreeRef =
|
|
17551
|
-
|
|
18106
|
+
const isFocusInsideReactTreeRef = React162.useRef(false);
|
|
18107
|
+
React162.useEffect(() => {
|
|
17552
18108
|
const handleFocus = (event) => {
|
|
17553
18109
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
17554
18110
|
const eventDetail = { originalEvent: event };
|
|
@@ -17606,7 +18162,7 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
|
17606
18162
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
17607
18163
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
17608
18164
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
17609
|
-
var FocusScope =
|
|
18165
|
+
var FocusScope = React18.forwardRef((props, forwardedRef) => {
|
|
17610
18166
|
const {
|
|
17611
18167
|
loop = false,
|
|
17612
18168
|
trapped = false,
|
|
@@ -17614,12 +18170,12 @@ var FocusScope = React182.forwardRef((props, forwardedRef) => {
|
|
|
17614
18170
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
17615
18171
|
...scopeProps
|
|
17616
18172
|
} = props;
|
|
17617
|
-
const [container22, setContainer] =
|
|
18173
|
+
const [container22, setContainer] = React18.useState(null);
|
|
17618
18174
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
17619
18175
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
17620
|
-
const lastFocusedElementRef =
|
|
18176
|
+
const lastFocusedElementRef = React18.useRef(null);
|
|
17621
18177
|
const composedRefs = useComposedRefs2(forwardedRef, (node) => setContainer(node));
|
|
17622
|
-
const focusScope =
|
|
18178
|
+
const focusScope = React18.useRef({
|
|
17623
18179
|
paused: false,
|
|
17624
18180
|
pause() {
|
|
17625
18181
|
this.paused = true;
|
|
@@ -17628,7 +18184,7 @@ var FocusScope = React182.forwardRef((props, forwardedRef) => {
|
|
|
17628
18184
|
this.paused = false;
|
|
17629
18185
|
}
|
|
17630
18186
|
}).current;
|
|
17631
|
-
|
|
18187
|
+
React18.useEffect(() => {
|
|
17632
18188
|
if (trapped) {
|
|
17633
18189
|
let handleFocusIn2 = function(event) {
|
|
17634
18190
|
if (focusScope.paused || !container22)
|
|
@@ -17670,7 +18226,7 @@ var FocusScope = React182.forwardRef((props, forwardedRef) => {
|
|
|
17670
18226
|
};
|
|
17671
18227
|
}
|
|
17672
18228
|
}, [trapped, container22, focusScope.paused]);
|
|
17673
|
-
|
|
18229
|
+
React18.useEffect(() => {
|
|
17674
18230
|
if (container22) {
|
|
17675
18231
|
focusScopesStack.add(focusScope);
|
|
17676
18232
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -17701,7 +18257,7 @@ var FocusScope = React182.forwardRef((props, forwardedRef) => {
|
|
|
17701
18257
|
};
|
|
17702
18258
|
}
|
|
17703
18259
|
}, [container22, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
17704
|
-
const handleKeyDown =
|
|
18260
|
+
const handleKeyDown = React18.useCallback((event) => {
|
|
17705
18261
|
if (!loop && !trapped)
|
|
17706
18262
|
return;
|
|
17707
18263
|
if (focusScope.paused)
|
|
@@ -19631,7 +20187,7 @@ var Arrow = React222.forwardRef((props, forwardedRef) => {
|
|
|
19631
20187
|
Arrow.displayName = NAME;
|
|
19632
20188
|
var Root2 = Arrow;
|
|
19633
20189
|
function useSize(element) {
|
|
19634
|
-
const [size4, setSize] =
|
|
20190
|
+
const [size4, setSize] = React232.useState(undefined);
|
|
19635
20191
|
useLayoutEffect22(() => {
|
|
19636
20192
|
if (element) {
|
|
19637
20193
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -19953,7 +20509,7 @@ function usePrevious(value) {
|
|
|
19953
20509
|
}, [value]);
|
|
19954
20510
|
}
|
|
19955
20511
|
var NAME2 = "VisuallyHidden";
|
|
19956
|
-
var VisuallyHidden =
|
|
20512
|
+
var VisuallyHidden = React28.forwardRef((props, forwardedRef) => {
|
|
19957
20513
|
return /* @__PURE__ */ jsx232(Primitive.span, {
|
|
19958
20514
|
...props,
|
|
19959
20515
|
ref: forwardedRef,
|
|
@@ -20283,7 +20839,7 @@ var SideCar = function(_a) {
|
|
|
20283
20839
|
if (!Target) {
|
|
20284
20840
|
throw new Error("Sidecar medium not found");
|
|
20285
20841
|
}
|
|
20286
|
-
return
|
|
20842
|
+
return React302.createElement(Target, __assign({}, rest));
|
|
20287
20843
|
};
|
|
20288
20844
|
SideCar.isSideCarExport = true;
|
|
20289
20845
|
function exportSidecar(medium, exported) {
|
|
@@ -20294,9 +20850,9 @@ var effectCar = createSidecarMedium();
|
|
|
20294
20850
|
var nothing = function() {
|
|
20295
20851
|
return;
|
|
20296
20852
|
};
|
|
20297
|
-
var RemoveScroll =
|
|
20298
|
-
var ref =
|
|
20299
|
-
var _a =
|
|
20853
|
+
var RemoveScroll = React31.forwardRef(function(props, parentRef) {
|
|
20854
|
+
var ref = React31.useRef(null);
|
|
20855
|
+
var _a = React31.useState({
|
|
20300
20856
|
onScrollCapture: nothing,
|
|
20301
20857
|
onWheelCapture: nothing,
|
|
20302
20858
|
onTouchMoveCapture: nothing
|
|
@@ -20305,7 +20861,7 @@ var RemoveScroll = React312.forwardRef(function(props, parentRef) {
|
|
|
20305
20861
|
var SideCar2 = sideCar;
|
|
20306
20862
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
20307
20863
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
20308
|
-
return
|
|
20864
|
+
return React31.createElement(React31.Fragment, null, enabled && React31.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }), forwardProps ? React31.cloneElement(React31.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React31.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children));
|
|
20309
20865
|
});
|
|
20310
20866
|
RemoveScroll.defaultProps = {
|
|
20311
20867
|
enabled: true,
|
|
@@ -20764,8 +21320,8 @@ function getOutermostShadowParent(node) {
|
|
|
20764
21320
|
return shadowParent;
|
|
20765
21321
|
}
|
|
20766
21322
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
20767
|
-
var ReactRemoveScroll =
|
|
20768
|
-
return
|
|
21323
|
+
var ReactRemoveScroll = React352.forwardRef(function(props, ref) {
|
|
21324
|
+
return React352.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
20769
21325
|
});
|
|
20770
21326
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
20771
21327
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -21771,7 +22327,7 @@ var ChevronDown = createLucideIcon("ChevronDown", [
|
|
|
21771
22327
|
var ChevronUp = createLucideIcon("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
|
|
21772
22328
|
var Select2 = Root222;
|
|
21773
22329
|
var SelectValue2 = Value;
|
|
21774
|
-
var SelectTrigger2 =
|
|
22330
|
+
var SelectTrigger2 = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(Trigger, {
|
|
21775
22331
|
ref,
|
|
21776
22332
|
className: cn("flex h-10 w-full items-center justify-between rounded-md border-black border-2 border-b-4 bg-card-bg px-3 py-5 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 font-brand", className),
|
|
21777
22333
|
...props,
|
|
@@ -21786,7 +22342,7 @@ var SelectTrigger2 = React372.forwardRef(({ className, children, ...props }, ref
|
|
|
21786
22342
|
]
|
|
21787
22343
|
}));
|
|
21788
22344
|
SelectTrigger2.displayName = Trigger.displayName;
|
|
21789
|
-
var SelectScrollUpButton2 =
|
|
22345
|
+
var SelectScrollUpButton2 = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx252(ScrollUpButton, {
|
|
21790
22346
|
ref,
|
|
21791
22347
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
21792
22348
|
...props,
|
|
@@ -21795,7 +22351,7 @@ var SelectScrollUpButton2 = React372.forwardRef(({ className, ...props }, ref) =
|
|
|
21795
22351
|
})
|
|
21796
22352
|
}));
|
|
21797
22353
|
SelectScrollUpButton2.displayName = ScrollUpButton.displayName;
|
|
21798
|
-
var SelectScrollDownButton2 =
|
|
22354
|
+
var SelectScrollDownButton2 = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx252(ScrollDownButton, {
|
|
21799
22355
|
ref,
|
|
21800
22356
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
21801
22357
|
...props,
|
|
@@ -21804,7 +22360,7 @@ var SelectScrollDownButton2 = React372.forwardRef(({ className, ...props }, ref)
|
|
|
21804
22360
|
})
|
|
21805
22361
|
}));
|
|
21806
22362
|
SelectScrollDownButton2.displayName = ScrollDownButton.displayName;
|
|
21807
|
-
var SelectContent2 =
|
|
22363
|
+
var SelectContent2 = React37.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx252(Portal2, {
|
|
21808
22364
|
children: /* @__PURE__ */ jsxs5(Content2, {
|
|
21809
22365
|
ref,
|
|
21810
22366
|
className: cn(" border-2 border-black relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md font-brand bg-card-bg text-text shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
@@ -21821,13 +22377,13 @@ var SelectContent2 = React372.forwardRef(({ className, children, position = "pop
|
|
|
21821
22377
|
})
|
|
21822
22378
|
}));
|
|
21823
22379
|
SelectContent2.displayName = Content2.displayName;
|
|
21824
|
-
var SelectLabel2 =
|
|
22380
|
+
var SelectLabel2 = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx252(Label, {
|
|
21825
22381
|
ref,
|
|
21826
22382
|
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
21827
22383
|
...props
|
|
21828
22384
|
}));
|
|
21829
22385
|
SelectLabel2.displayName = Label.displayName;
|
|
21830
|
-
var SelectItem2 =
|
|
22386
|
+
var SelectItem2 = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(Item, {
|
|
21831
22387
|
ref,
|
|
21832
22388
|
className: cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-slate-200 dark:focus:bg-white/10 data-disabled:pointer-events-none data-disabled:opacity-50 font-brand", className),
|
|
21833
22389
|
...props,
|
|
@@ -21846,7 +22402,7 @@ var SelectItem2 = React372.forwardRef(({ className, children, ...props }, ref) =
|
|
|
21846
22402
|
]
|
|
21847
22403
|
}));
|
|
21848
22404
|
SelectItem2.displayName = Item.displayName;
|
|
21849
|
-
var SelectSeparator2 =
|
|
22405
|
+
var SelectSeparator2 = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx252(Separator, {
|
|
21850
22406
|
ref,
|
|
21851
22407
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
21852
22408
|
...props
|
|
@@ -21935,22 +22491,22 @@ function composeContextScopes2(...scopes) {
|
|
|
21935
22491
|
}
|
|
21936
22492
|
function createSlot2(ownerName) {
|
|
21937
22493
|
const SlotClone2 = /* @__PURE__ */ createSlotClone2(ownerName);
|
|
21938
|
-
const Slot22 =
|
|
22494
|
+
const Slot22 = React392.forwardRef((props, forwardedRef) => {
|
|
21939
22495
|
const { children, ...slotProps } = props;
|
|
21940
|
-
const childrenArray =
|
|
22496
|
+
const childrenArray = React392.Children.toArray(children);
|
|
21941
22497
|
const slottable = childrenArray.find(isSlottable3);
|
|
21942
22498
|
if (slottable) {
|
|
21943
22499
|
const newElement = slottable.props.children;
|
|
21944
22500
|
const newChildren = childrenArray.map((child) => {
|
|
21945
22501
|
if (child === slottable) {
|
|
21946
|
-
if (
|
|
21947
|
-
return
|
|
21948
|
-
return
|
|
22502
|
+
if (React392.Children.count(newElement) > 1)
|
|
22503
|
+
return React392.Children.only(null);
|
|
22504
|
+
return React392.isValidElement(newElement) ? newElement.props.children : null;
|
|
21949
22505
|
} else {
|
|
21950
22506
|
return child;
|
|
21951
22507
|
}
|
|
21952
22508
|
});
|
|
21953
|
-
return /* @__PURE__ */ jsx282(SlotClone2, { ...slotProps, ref: forwardedRef, children:
|
|
22509
|
+
return /* @__PURE__ */ jsx282(SlotClone2, { ...slotProps, ref: forwardedRef, children: React392.isValidElement(newElement) ? React392.cloneElement(newElement, undefined, newChildren) : null });
|
|
21954
22510
|
}
|
|
21955
22511
|
return /* @__PURE__ */ jsx282(SlotClone2, { ...slotProps, ref: forwardedRef, children });
|
|
21956
22512
|
});
|
|
@@ -21958,24 +22514,24 @@ function createSlot2(ownerName) {
|
|
|
21958
22514
|
return Slot22;
|
|
21959
22515
|
}
|
|
21960
22516
|
function createSlotClone2(ownerName) {
|
|
21961
|
-
const SlotClone2 =
|
|
22517
|
+
const SlotClone2 = React392.forwardRef((props, forwardedRef) => {
|
|
21962
22518
|
const { children, ...slotProps } = props;
|
|
21963
|
-
if (
|
|
22519
|
+
if (React392.isValidElement(children)) {
|
|
21964
22520
|
const childrenRef = getElementRef3(children);
|
|
21965
22521
|
const props2 = mergeProps3(slotProps, children.props);
|
|
21966
|
-
if (children.type !==
|
|
22522
|
+
if (children.type !== React392.Fragment) {
|
|
21967
22523
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
21968
22524
|
}
|
|
21969
|
-
return
|
|
22525
|
+
return React392.cloneElement(children, props2);
|
|
21970
22526
|
}
|
|
21971
|
-
return
|
|
22527
|
+
return React392.Children.count(children) > 1 ? React392.Children.only(null) : null;
|
|
21972
22528
|
});
|
|
21973
22529
|
SlotClone2.displayName = `${ownerName}.SlotClone`;
|
|
21974
22530
|
return SlotClone2;
|
|
21975
22531
|
}
|
|
21976
22532
|
var SLOTTABLE_IDENTIFIER2 = Symbol("radix.slottable");
|
|
21977
22533
|
function isSlottable3(child) {
|
|
21978
|
-
return
|
|
22534
|
+
return React392.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
21979
22535
|
}
|
|
21980
22536
|
function mergeProps3(slotProps, childProps) {
|
|
21981
22537
|
const overrideProps = { ...childProps };
|
|
@@ -22020,14 +22576,14 @@ function createCollection2(name) {
|
|
|
22020
22576
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map });
|
|
22021
22577
|
const CollectionProvider = (props) => {
|
|
22022
22578
|
const { scope, children } = props;
|
|
22023
|
-
const ref =
|
|
22024
|
-
const itemMap =
|
|
22579
|
+
const ref = React40.useRef(null);
|
|
22580
|
+
const itemMap = React40.useRef(/* @__PURE__ */ new Map).current;
|
|
22025
22581
|
return /* @__PURE__ */ jsx292(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
22026
22582
|
};
|
|
22027
22583
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
22028
22584
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
22029
22585
|
const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);
|
|
22030
|
-
const CollectionSlot =
|
|
22586
|
+
const CollectionSlot = React40.forwardRef((props, forwardedRef) => {
|
|
22031
22587
|
const { scope, children } = props;
|
|
22032
22588
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
22033
22589
|
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
@@ -22037,12 +22593,12 @@ function createCollection2(name) {
|
|
|
22037
22593
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
22038
22594
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
22039
22595
|
const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);
|
|
22040
|
-
const CollectionItemSlot =
|
|
22596
|
+
const CollectionItemSlot = React40.forwardRef((props, forwardedRef) => {
|
|
22041
22597
|
const { scope, children, ...itemData } = props;
|
|
22042
|
-
const ref =
|
|
22598
|
+
const ref = React40.useRef(null);
|
|
22043
22599
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
22044
22600
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
22045
|
-
|
|
22601
|
+
React40.useEffect(() => {
|
|
22046
22602
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
22047
22603
|
return () => void context.itemMap.delete(ref);
|
|
22048
22604
|
});
|
|
@@ -22051,7 +22607,7 @@ function createCollection2(name) {
|
|
|
22051
22607
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
22052
22608
|
function useCollection2(scope) {
|
|
22053
22609
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
22054
|
-
const getItems =
|
|
22610
|
+
const getItems = React40.useCallback(() => {
|
|
22055
22611
|
const collectionNode = context.collectionRef.current;
|
|
22056
22612
|
if (!collectionNode)
|
|
22057
22613
|
return [];
|
|
@@ -22369,7 +22925,7 @@ function toSafeIndex(array, index2) {
|
|
|
22369
22925
|
function toSafeInteger(number) {
|
|
22370
22926
|
return number !== number || number === 0 ? 0 : Math.trunc(number);
|
|
22371
22927
|
}
|
|
22372
|
-
var useLayoutEffect222 = globalThis?.document ?
|
|
22928
|
+
var useLayoutEffect222 = globalThis?.document ? React412.useLayoutEffect : () => {};
|
|
22373
22929
|
var useReactId2 = React42[" useId ".trim().toString()] || (() => {
|
|
22374
22930
|
return;
|
|
22375
22931
|
});
|