@remotion/promo-pages 4.0.461 → 4.0.463
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 +1496 -953
- package/dist/design.js +1837 -1416
- package/dist/experts/experts-data.js +5 -16
- package/dist/experts.js +1624 -1203
- package/dist/homepage/Pricing.js +1865 -1444
- package/dist/prompts/PromptsGallery.js +1709 -1288
- package/dist/prompts/PromptsShow.js +1379 -958
- package/dist/prompts/PromptsSubmit.js +1381 -960
- package/dist/team.js +1705 -1284
- package/dist/template-modal-content.js +1715 -1294
- package/dist/templates.js +1706 -1284
- package/package.json +17 -17
- 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 -15
- package/dist/components/experts/experts-data.js +0 -289
- package/dist/components/experts/experts-icons.d.ts +0 -7
- package/dist/components/experts/experts-icons.js +0 -36
- 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/PromptsShow.css +0 -2578
- 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/template-modal-content.css +0 -35
package/dist/design.js
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
1
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
-
for (let key of __getOwnPropNames(mod))
|
|
10
|
-
if (!__hasOwnProp.call(to, key))
|
|
11
|
-
__defProp(to, key, {
|
|
12
|
-
get: () => mod[key],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
17
6
|
var __export = (target, all) => {
|
|
18
7
|
for (var name in all)
|
|
19
8
|
__defProp(target, name, {
|
|
20
9
|
get: all[name],
|
|
21
10
|
enumerable: true,
|
|
22
11
|
configurable: true,
|
|
23
|
-
set: (
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
24
13
|
});
|
|
25
14
|
};
|
|
26
15
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -5743,8 +5732,21 @@ import * as React6 from "react";
|
|
|
5743
5732
|
import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
|
|
5744
5733
|
import { useContext as useContext8, useMemo as useMemo7 } from "react";
|
|
5745
5734
|
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
5746
|
-
import {
|
|
5747
|
-
|
|
5735
|
+
import {
|
|
5736
|
+
forwardRef as forwardRef4,
|
|
5737
|
+
useCallback as useCallback6,
|
|
5738
|
+
useEffect as useEffect5,
|
|
5739
|
+
useMemo as useMemo16,
|
|
5740
|
+
useState as useState6
|
|
5741
|
+
} from "react";
|
|
5742
|
+
import {
|
|
5743
|
+
forwardRef as forwardRef3,
|
|
5744
|
+
useContext as useContext17,
|
|
5745
|
+
useEffect as useEffect3,
|
|
5746
|
+
useMemo as useMemo14,
|
|
5747
|
+
useState as useState5
|
|
5748
|
+
} from "react";
|
|
5749
|
+
import { useContext as useContext14, useMemo as useMemo11 } from "react";
|
|
5748
5750
|
import { createContext as createContext12 } from "react";
|
|
5749
5751
|
import { useContext as useContext10, useMemo as useMemo9 } from "react";
|
|
5750
5752
|
import {
|
|
@@ -5755,52 +5757,45 @@ import {
|
|
|
5755
5757
|
useState as useState2
|
|
5756
5758
|
} from "react";
|
|
5757
5759
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
5758
|
-
import {
|
|
5759
|
-
import { useRef as useRef5 } from "react";
|
|
5760
|
-
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5761
|
-
import {
|
|
5762
|
-
forwardRef as forwardRef3,
|
|
5763
|
-
useContext as useContext16,
|
|
5764
|
-
useEffect as useEffect5,
|
|
5765
|
-
useMemo as useMemo16,
|
|
5766
|
-
useState as useState6
|
|
5767
|
-
} from "react";
|
|
5768
|
-
import { useContext as useContext14, useMemo as useMemo13 } from "react";
|
|
5760
|
+
import { useContext as useContext11 } from "react";
|
|
5769
5761
|
import { useContext as useContext13 } from "react";
|
|
5770
|
-
import { useContext as useContext12, useMemo as
|
|
5771
|
-
import { jsx as
|
|
5762
|
+
import { useContext as useContext12, useMemo as useMemo10 } from "react";
|
|
5763
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5772
5764
|
import { createContext as createContext14 } from "react";
|
|
5773
|
-
import
|
|
5774
|
-
import { jsx as
|
|
5775
|
-
import
|
|
5765
|
+
import React11, { useCallback as useCallback5, useMemo as useMemo12, useRef as useRef4, useState as useState3 } from "react";
|
|
5766
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
5767
|
+
import React12, { forwardRef as forwardRef2, useState as useState4, useContext as useContext16, useMemo as useMemo13 } from "react";
|
|
5768
|
+
import { useContext as useContext15, useRef as useRef5 } from "react";
|
|
5776
5769
|
import { createContext as createContext15 } from "react";
|
|
5770
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
5771
|
+
import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef6 } from "react";
|
|
5777
5772
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5778
5773
|
import {
|
|
5779
|
-
forwardRef as
|
|
5774
|
+
forwardRef as forwardRef5,
|
|
5780
5775
|
useEffect as useEffect6,
|
|
5781
5776
|
useImperativeHandle as useImperativeHandle2,
|
|
5782
5777
|
useLayoutEffect as useLayoutEffect2,
|
|
5783
5778
|
useRef as useRef8,
|
|
5784
5779
|
useState as useState7
|
|
5785
5780
|
} from "react";
|
|
5786
|
-
import React15, { useCallback as
|
|
5781
|
+
import React15, { useCallback as useCallback7, useImperativeHandle, useRef as useRef7 } from "react";
|
|
5787
5782
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
5788
5783
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
5789
5784
|
import {
|
|
5790
5785
|
createContext as createContext16,
|
|
5791
|
-
forwardRef as
|
|
5792
|
-
useCallback as
|
|
5793
|
-
useContext as
|
|
5786
|
+
forwardRef as forwardRef6,
|
|
5787
|
+
useCallback as useCallback8,
|
|
5788
|
+
useContext as useContext18,
|
|
5794
5789
|
useLayoutEffect as useLayoutEffect3,
|
|
5795
5790
|
useMemo as useMemo17,
|
|
5796
5791
|
useRef as useRef9,
|
|
5797
5792
|
useState as useState8
|
|
5798
5793
|
} from "react";
|
|
5799
5794
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
5800
|
-
import { useContext as
|
|
5795
|
+
import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
|
|
5801
5796
|
import {
|
|
5802
5797
|
createContext as createContext17,
|
|
5803
|
-
useCallback as
|
|
5798
|
+
useCallback as useCallback9,
|
|
5804
5799
|
useImperativeHandle as useImperativeHandle3,
|
|
5805
5800
|
useLayoutEffect as useLayoutEffect4,
|
|
5806
5801
|
useMemo as useMemo18,
|
|
@@ -5808,29 +5803,29 @@ import {
|
|
|
5808
5803
|
useState as useState9
|
|
5809
5804
|
} from "react";
|
|
5810
5805
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5811
|
-
import { forwardRef as
|
|
5806
|
+
import { forwardRef as forwardRef9, useCallback as useCallback14, useContext as useContext31 } from "react";
|
|
5812
5807
|
import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
|
|
5813
5808
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5814
|
-
import { useContext as
|
|
5809
|
+
import { useContext as useContext20 } from "react";
|
|
5815
5810
|
import { createContext as createContext19, useEffect as useEffect7, useState as useState11 } from "react";
|
|
5816
5811
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
5817
5812
|
import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
|
|
5818
5813
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
5819
5814
|
import React23, {
|
|
5820
|
-
forwardRef as
|
|
5821
|
-
useContext as
|
|
5815
|
+
forwardRef as forwardRef7,
|
|
5816
|
+
useContext as useContext29,
|
|
5822
5817
|
useEffect as useEffect14,
|
|
5823
5818
|
useImperativeHandle as useImperativeHandle4,
|
|
5824
5819
|
useMemo as useMemo28,
|
|
5825
5820
|
useRef as useRef18,
|
|
5826
5821
|
useState as useState16
|
|
5827
5822
|
} from "react";
|
|
5828
|
-
import { useContext as
|
|
5823
|
+
import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
|
|
5829
5824
|
import React20, {
|
|
5830
5825
|
createContext as createContext21,
|
|
5831
5826
|
createRef as createRef2,
|
|
5832
|
-
useCallback as
|
|
5833
|
-
useContext as
|
|
5827
|
+
useCallback as useCallback10,
|
|
5828
|
+
useContext as useContext21,
|
|
5834
5829
|
useMemo as useMemo22,
|
|
5835
5830
|
useRef as useRef11,
|
|
5836
5831
|
useState as useState12
|
|
@@ -5838,20 +5833,20 @@ import React20, {
|
|
|
5838
5833
|
import { useMemo as useMemo21 } from "react";
|
|
5839
5834
|
import { jsx as jsx20, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5840
5835
|
import { useRef as useRef12 } from "react";
|
|
5841
|
-
import { useContext as
|
|
5842
|
-
import { useContext as
|
|
5836
|
+
import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo23, useState as useState13 } from "react";
|
|
5837
|
+
import { useContext as useContext23 } from "react";
|
|
5843
5838
|
import {
|
|
5844
|
-
useCallback as
|
|
5845
|
-
useContext as
|
|
5839
|
+
useCallback as useCallback13,
|
|
5840
|
+
useContext as useContext27,
|
|
5846
5841
|
useEffect as useEffect12,
|
|
5847
5842
|
useLayoutEffect as useLayoutEffect8,
|
|
5848
5843
|
useRef as useRef17
|
|
5849
5844
|
} from "react";
|
|
5850
|
-
import { useCallback as
|
|
5851
|
-
import { useContext as
|
|
5845
|
+
import { useCallback as useCallback12, useMemo as useMemo26, useRef as useRef15 } from "react";
|
|
5846
|
+
import { useContext as useContext26, useMemo as useMemo25 } from "react";
|
|
5852
5847
|
import React21, {
|
|
5853
|
-
useCallback as
|
|
5854
|
-
useContext as
|
|
5848
|
+
useCallback as useCallback11,
|
|
5849
|
+
useContext as useContext25,
|
|
5855
5850
|
useEffect as useEffect9,
|
|
5856
5851
|
useLayoutEffect as useLayoutEffect7,
|
|
5857
5852
|
useMemo as useMemo24,
|
|
@@ -5863,11 +5858,11 @@ import React22 from "react";
|
|
|
5863
5858
|
import { useEffect as useEffect10, useState as useState15 } from "react";
|
|
5864
5859
|
import { useEffect as useEffect11, useRef as useRef16 } from "react";
|
|
5865
5860
|
import { useEffect as useEffect13 } from "react";
|
|
5866
|
-
import { createContext as createContext22, useContext as
|
|
5861
|
+
import { createContext as createContext22, useContext as useContext28, useMemo as useMemo27 } from "react";
|
|
5867
5862
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
5868
5863
|
import {
|
|
5869
|
-
forwardRef as
|
|
5870
|
-
useContext as
|
|
5864
|
+
forwardRef as forwardRef8,
|
|
5865
|
+
useContext as useContext30,
|
|
5871
5866
|
useEffect as useEffect15,
|
|
5872
5867
|
useImperativeHandle as useImperativeHandle5,
|
|
5873
5868
|
useLayoutEffect as useLayoutEffect9,
|
|
@@ -5876,11 +5871,11 @@ import {
|
|
|
5876
5871
|
} from "react";
|
|
5877
5872
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5878
5873
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
5879
|
-
import { forwardRef as
|
|
5874
|
+
import { forwardRef as forwardRef10, useCallback as useCallback15, useState as useState17 } from "react";
|
|
5880
5875
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
5881
5876
|
import {
|
|
5882
|
-
useCallback as
|
|
5883
|
-
useContext as
|
|
5877
|
+
useCallback as useCallback16,
|
|
5878
|
+
useContext as useContext32,
|
|
5884
5879
|
useImperativeHandle as useImperativeHandle6,
|
|
5885
5880
|
useLayoutEffect as useLayoutEffect10,
|
|
5886
5881
|
useRef as useRef20,
|
|
@@ -5890,7 +5885,7 @@ import { jsx as jsx26 } from "react/jsx-runtime";
|
|
|
5890
5885
|
import { createRef as createRef3 } from "react";
|
|
5891
5886
|
import React28 from "react";
|
|
5892
5887
|
import {
|
|
5893
|
-
useCallback as
|
|
5888
|
+
useCallback as useCallback17,
|
|
5894
5889
|
useImperativeHandle as useImperativeHandle7,
|
|
5895
5890
|
useMemo as useMemo30,
|
|
5896
5891
|
useRef as useRef21,
|
|
@@ -5899,15 +5894,15 @@ import {
|
|
|
5899
5894
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
5900
5895
|
import React29 from "react";
|
|
5901
5896
|
import { useMemo as useMemo322 } from "react";
|
|
5902
|
-
import { createContext as createContext23, useContext as
|
|
5897
|
+
import { createContext as createContext23, useContext as useContext33, useMemo as useMemo31 } from "react";
|
|
5903
5898
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
5904
5899
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
5905
5900
|
import React31 from "react";
|
|
5906
5901
|
import React32, { createContext as createContext24 } from "react";
|
|
5907
|
-
import { useCallback as
|
|
5902
|
+
import { useCallback as useCallback19 } from "react";
|
|
5908
5903
|
import {
|
|
5909
|
-
useCallback as
|
|
5910
|
-
useContext as
|
|
5904
|
+
useCallback as useCallback18,
|
|
5905
|
+
useContext as useContext34,
|
|
5911
5906
|
useEffect as useEffect16,
|
|
5912
5907
|
useLayoutEffect as useLayoutEffect11,
|
|
5913
5908
|
useMemo as useMemo33,
|
|
@@ -5915,8 +5910,8 @@ import {
|
|
|
5915
5910
|
} from "react";
|
|
5916
5911
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
5917
5912
|
import React34, {
|
|
5918
|
-
forwardRef as
|
|
5919
|
-
useContext as
|
|
5913
|
+
forwardRef as forwardRef11,
|
|
5914
|
+
useContext as useContext35,
|
|
5920
5915
|
useEffect as useEffect18,
|
|
5921
5916
|
useImperativeHandle as useImperativeHandle8,
|
|
5922
5917
|
useMemo as useMemo34,
|
|
@@ -5928,16 +5923,16 @@ import { jsx as jsx31 } from "react/jsx-runtime";
|
|
|
5928
5923
|
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
5929
5924
|
import React36, { useMemo as useMemo35 } from "react";
|
|
5930
5925
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
5931
|
-
import { Children, forwardRef as
|
|
5926
|
+
import { Children, forwardRef as forwardRef12, useMemo as useMemo36 } from "react";
|
|
5932
5927
|
import React37 from "react";
|
|
5933
5928
|
import React38, { createContext as createContext25 } from "react";
|
|
5934
5929
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
5935
5930
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
5936
5931
|
import React40 from "react";
|
|
5937
|
-
import { forwardRef as
|
|
5932
|
+
import { forwardRef as forwardRef14, useCallback as useCallback20, useContext as useContext37 } from "react";
|
|
5938
5933
|
import {
|
|
5939
|
-
forwardRef as
|
|
5940
|
-
useContext as
|
|
5934
|
+
forwardRef as forwardRef13,
|
|
5935
|
+
useContext as useContext36,
|
|
5941
5936
|
useEffect as useEffect19,
|
|
5942
5937
|
useImperativeHandle as useImperativeHandle9,
|
|
5943
5938
|
useLayoutEffect as useLayoutEffect12,
|
|
@@ -5947,13 +5942,17 @@ import {
|
|
|
5947
5942
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
5948
5943
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
5949
5944
|
var __defProp2 = Object.defineProperty;
|
|
5945
|
+
var __returnValue2 = (v) => v;
|
|
5946
|
+
function __exportSetter2(name, newValue) {
|
|
5947
|
+
this[name] = __returnValue2.bind(null, newValue);
|
|
5948
|
+
}
|
|
5950
5949
|
var __export2 = (target, all) => {
|
|
5951
5950
|
for (var name in all)
|
|
5952
5951
|
__defProp2(target, name, {
|
|
5953
5952
|
get: all[name],
|
|
5954
5953
|
enumerable: true,
|
|
5955
5954
|
configurable: true,
|
|
5956
|
-
set: (
|
|
5955
|
+
set: __exportSetter2.bind(all, name)
|
|
5957
5956
|
});
|
|
5958
5957
|
};
|
|
5959
5958
|
if (typeof createContext !== "function") {
|
|
@@ -7013,6 +7012,81 @@ var Composition = (props) => {
|
|
|
7013
7012
|
...props
|
|
7014
7013
|
});
|
|
7015
7014
|
};
|
|
7015
|
+
var componentsToAddStacksTo = [];
|
|
7016
|
+
var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
7017
|
+
var addSequenceStackTraces = (component) => {
|
|
7018
|
+
componentsToAddStacksTo.push(component);
|
|
7019
|
+
};
|
|
7020
|
+
var sequenceStyleSchema = {
|
|
7021
|
+
"style.translate": {
|
|
7022
|
+
type: "translate",
|
|
7023
|
+
step: 1,
|
|
7024
|
+
default: "0px 0px",
|
|
7025
|
+
description: "Offset"
|
|
7026
|
+
},
|
|
7027
|
+
"style.scale": {
|
|
7028
|
+
type: "number",
|
|
7029
|
+
min: 0.05,
|
|
7030
|
+
max: 100,
|
|
7031
|
+
step: 0.01,
|
|
7032
|
+
default: 1,
|
|
7033
|
+
description: "Scale"
|
|
7034
|
+
},
|
|
7035
|
+
"style.rotate": {
|
|
7036
|
+
type: "rotation",
|
|
7037
|
+
step: 1,
|
|
7038
|
+
default: "0deg",
|
|
7039
|
+
description: "Rotation"
|
|
7040
|
+
},
|
|
7041
|
+
"style.opacity": {
|
|
7042
|
+
type: "number",
|
|
7043
|
+
min: 0,
|
|
7044
|
+
max: 1,
|
|
7045
|
+
step: 0.01,
|
|
7046
|
+
default: 1,
|
|
7047
|
+
description: "Opacity"
|
|
7048
|
+
},
|
|
7049
|
+
premountFor: {
|
|
7050
|
+
type: "number",
|
|
7051
|
+
default: 0,
|
|
7052
|
+
description: "Premount For",
|
|
7053
|
+
min: 0,
|
|
7054
|
+
step: 1
|
|
7055
|
+
},
|
|
7056
|
+
postmountFor: {
|
|
7057
|
+
type: "hidden"
|
|
7058
|
+
},
|
|
7059
|
+
styleWhilePremounted: {
|
|
7060
|
+
type: "hidden"
|
|
7061
|
+
},
|
|
7062
|
+
styleWhilePostmounted: {
|
|
7063
|
+
type: "hidden"
|
|
7064
|
+
}
|
|
7065
|
+
};
|
|
7066
|
+
var hiddenField = {
|
|
7067
|
+
type: "boolean",
|
|
7068
|
+
default: false,
|
|
7069
|
+
description: "Hidden"
|
|
7070
|
+
};
|
|
7071
|
+
var sequenceSchema = {
|
|
7072
|
+
hidden: hiddenField,
|
|
7073
|
+
layout: {
|
|
7074
|
+
type: "enum",
|
|
7075
|
+
default: "absolute-fill",
|
|
7076
|
+
description: "Layout",
|
|
7077
|
+
variants: {
|
|
7078
|
+
"absolute-fill": sequenceStyleSchema,
|
|
7079
|
+
none: {}
|
|
7080
|
+
}
|
|
7081
|
+
}
|
|
7082
|
+
};
|
|
7083
|
+
var sequenceSchemaDefaultLayoutNone = {
|
|
7084
|
+
...sequenceSchema,
|
|
7085
|
+
layout: {
|
|
7086
|
+
...sequenceSchema.layout,
|
|
7087
|
+
default: "none"
|
|
7088
|
+
}
|
|
7089
|
+
};
|
|
7016
7090
|
var SequenceContext = createContext12(null);
|
|
7017
7091
|
var exports_timeline_position_state = {};
|
|
7018
7092
|
__export2(exports_timeline_position_state, {
|
|
@@ -7218,1221 +7292,1409 @@ var useCurrentFrame = () => {
|
|
|
7218
7292
|
const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
|
|
7219
7293
|
return frame - contextOffset;
|
|
7220
7294
|
};
|
|
7221
|
-
var
|
|
7222
|
-
const
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7295
|
+
var useUnsafeVideoConfig = () => {
|
|
7296
|
+
const context = useContext12(SequenceContext);
|
|
7297
|
+
const ctxWidth = context?.width ?? null;
|
|
7298
|
+
const ctxHeight = context?.height ?? null;
|
|
7299
|
+
const ctxDuration = context?.durationInFrames ?? null;
|
|
7300
|
+
const video = useVideo();
|
|
7301
|
+
return useMemo10(() => {
|
|
7302
|
+
if (!video) {
|
|
7303
|
+
return null;
|
|
7230
7304
|
}
|
|
7231
|
-
|
|
7232
|
-
|
|
7305
|
+
const {
|
|
7306
|
+
id,
|
|
7307
|
+
durationInFrames,
|
|
7308
|
+
fps,
|
|
7309
|
+
height,
|
|
7310
|
+
width,
|
|
7311
|
+
defaultProps,
|
|
7312
|
+
props,
|
|
7313
|
+
defaultCodec,
|
|
7314
|
+
defaultOutName,
|
|
7315
|
+
defaultVideoImageFormat,
|
|
7316
|
+
defaultPixelFormat,
|
|
7317
|
+
defaultProResProfile,
|
|
7318
|
+
defaultSampleRate
|
|
7319
|
+
} = video;
|
|
7320
|
+
return {
|
|
7321
|
+
id,
|
|
7322
|
+
width: ctxWidth ?? width,
|
|
7323
|
+
height: ctxHeight ?? height,
|
|
7324
|
+
fps,
|
|
7325
|
+
durationInFrames: ctxDuration ?? durationInFrames,
|
|
7326
|
+
defaultProps,
|
|
7327
|
+
props,
|
|
7328
|
+
defaultCodec,
|
|
7329
|
+
defaultOutName,
|
|
7330
|
+
defaultVideoImageFormat,
|
|
7331
|
+
defaultPixelFormat,
|
|
7332
|
+
defaultProResProfile,
|
|
7333
|
+
defaultSampleRate
|
|
7334
|
+
};
|
|
7335
|
+
}, [ctxDuration, ctxHeight, ctxWidth, video]);
|
|
7233
7336
|
};
|
|
7234
|
-
var
|
|
7235
|
-
const
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
current = [eff];
|
|
7246
|
-
currentBackend = backend;
|
|
7337
|
+
var useVideoConfig = () => {
|
|
7338
|
+
const videoConfig = useUnsafeVideoConfig();
|
|
7339
|
+
const context = useContext13(CanUseRemotionHooks);
|
|
7340
|
+
const isPlayer = useIsPlayer();
|
|
7341
|
+
if (!videoConfig) {
|
|
7342
|
+
if (typeof window !== "undefined" && window.remotion_isPlayer || isPlayer) {
|
|
7343
|
+
throw new Error([
|
|
7344
|
+
"No video config found. Likely reasons:",
|
|
7345
|
+
"- You are probably calling useVideoConfig() from outside the component passed to <Player />. See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.",
|
|
7346
|
+
"- You have multiple versions of Remotion installed which causes the React context to get lost."
|
|
7347
|
+
].join("-"));
|
|
7247
7348
|
}
|
|
7349
|
+
throw new Error("No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.");
|
|
7248
7350
|
}
|
|
7249
|
-
if (
|
|
7250
|
-
|
|
7351
|
+
if (!context) {
|
|
7352
|
+
throw new Error("Called useVideoConfig() outside a Remotion composition.");
|
|
7251
7353
|
}
|
|
7252
|
-
return
|
|
7354
|
+
return videoConfig;
|
|
7253
7355
|
};
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7356
|
+
var Freeze = ({
|
|
7357
|
+
frame: frameToFreeze,
|
|
7358
|
+
children,
|
|
7359
|
+
active = true
|
|
7360
|
+
}) => {
|
|
7361
|
+
const frame = useCurrentFrame();
|
|
7362
|
+
const videoConfig = useVideoConfig();
|
|
7363
|
+
if (typeof frameToFreeze === "undefined") {
|
|
7364
|
+
throw new Error(`The <Freeze /> component requires a 'frame' prop, but none was passed.`);
|
|
7263
7365
|
}
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
if (existing) {
|
|
7267
|
-
return existing;
|
|
7268
|
-
}
|
|
7269
|
-
const pair = [
|
|
7270
|
-
this.allocateCanvas(backend),
|
|
7271
|
-
this.allocateCanvas(backend)
|
|
7272
|
-
];
|
|
7273
|
-
this.pairs.set(backend, pair);
|
|
7274
|
-
return pair;
|
|
7366
|
+
if (typeof frameToFreeze !== "number") {
|
|
7367
|
+
throw new Error(`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof frameToFreeze}`);
|
|
7275
7368
|
}
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
throw new Error("WebGL context was lost during canvas effect rendering. " + "This typically happens in headless or memory-constrained environments (e.g. Remotion Lambda). " + "Try reducing concurrency or increasing the Lambda function memory.");
|
|
7279
|
-
}
|
|
7369
|
+
if (Number.isNaN(frameToFreeze)) {
|
|
7370
|
+
throw new Error(`The 'frame' prop of <Freeze /> must be a real number, but it is NaN.`);
|
|
7280
7371
|
}
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
});
|
|
7308
|
-
canvas.addEventListener("webglcontextrestored", () => {
|
|
7309
|
-
this.lostContexts.delete(canvas);
|
|
7310
|
-
});
|
|
7311
|
-
ctx.pixelStorei(ctx.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
|
|
7312
|
-
return canvas;
|
|
7372
|
+
if (!Number.isFinite(frameToFreeze)) {
|
|
7373
|
+
throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frameToFreeze}.`);
|
|
7374
|
+
}
|
|
7375
|
+
const isActive = useMemo11(() => {
|
|
7376
|
+
if (typeof active === "boolean") {
|
|
7377
|
+
return active;
|
|
7378
|
+
}
|
|
7379
|
+
if (typeof active === "function") {
|
|
7380
|
+
return active(frame);
|
|
7381
|
+
}
|
|
7382
|
+
}, [active, frame]);
|
|
7383
|
+
const timelineContext = useTimelineContext();
|
|
7384
|
+
const sequenceContext = useContext14(SequenceContext);
|
|
7385
|
+
const relativeFrom = sequenceContext?.relativeFrom ?? 0;
|
|
7386
|
+
const timelineValue = useMemo11(() => {
|
|
7387
|
+
if (!isActive) {
|
|
7388
|
+
return timelineContext;
|
|
7389
|
+
}
|
|
7390
|
+
return {
|
|
7391
|
+
...timelineContext,
|
|
7392
|
+
playing: false,
|
|
7393
|
+
imperativePlaying: {
|
|
7394
|
+
current: false
|
|
7395
|
+
},
|
|
7396
|
+
frame: {
|
|
7397
|
+
[videoConfig.id]: frameToFreeze + relativeFrom
|
|
7313
7398
|
}
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7399
|
+
};
|
|
7400
|
+
}, [isActive, timelineContext, videoConfig.id, frameToFreeze, relativeFrom]);
|
|
7401
|
+
const newSequenceContext = useMemo11(() => {
|
|
7402
|
+
if (!sequenceContext) {
|
|
7403
|
+
return null;
|
|
7404
|
+
}
|
|
7405
|
+
if (!isActive) {
|
|
7406
|
+
return sequenceContext;
|
|
7407
|
+
}
|
|
7408
|
+
return {
|
|
7409
|
+
...sequenceContext,
|
|
7410
|
+
cumulatedFrom: 0
|
|
7411
|
+
};
|
|
7412
|
+
}, [sequenceContext, isActive]);
|
|
7413
|
+
return /* @__PURE__ */ jsx92(TimelineContext.Provider, {
|
|
7414
|
+
value: timelineValue,
|
|
7415
|
+
children: /* @__PURE__ */ jsx92(SequenceContext.Provider, {
|
|
7416
|
+
value: newSequenceContext,
|
|
7417
|
+
children
|
|
7418
|
+
})
|
|
7419
|
+
});
|
|
7420
|
+
};
|
|
7421
|
+
var PremountContext = createContext14({
|
|
7422
|
+
premountFramesRemaining: 0
|
|
7423
|
+
});
|
|
7424
|
+
var SequenceManager = React11.createContext({
|
|
7425
|
+
registerSequence: () => {
|
|
7426
|
+
throw new Error("SequenceManagerContext not initialized");
|
|
7427
|
+
},
|
|
7428
|
+
unregisterSequence: () => {
|
|
7429
|
+
throw new Error("SequenceManagerContext not initialized");
|
|
7430
|
+
},
|
|
7431
|
+
sequences: []
|
|
7432
|
+
});
|
|
7433
|
+
var makeSequencePropsSubscriptionKey = (key) => {
|
|
7434
|
+
return `${key.nodePath.join(".")}.${key.sequenceKeys.join(".")}.${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
|
|
7435
|
+
};
|
|
7436
|
+
var VisualModeCodeValuesContext = React11.createContext({
|
|
7437
|
+
codeValues: {}
|
|
7438
|
+
});
|
|
7439
|
+
var VisualModeDragOverridesContext = React11.createContext({
|
|
7440
|
+
getDragOverrides: () => {
|
|
7441
|
+
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
7442
|
+
},
|
|
7443
|
+
getEffectDragOverrides: () => {
|
|
7444
|
+
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
7445
|
+
}
|
|
7446
|
+
});
|
|
7447
|
+
var VisualModeSettersContext = React11.createContext({
|
|
7448
|
+
setDragOverrides: () => {
|
|
7449
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7450
|
+
},
|
|
7451
|
+
clearDragOverrides: () => {
|
|
7452
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7453
|
+
},
|
|
7454
|
+
setEffectDragOverrides: () => {
|
|
7455
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7456
|
+
},
|
|
7457
|
+
clearEffectDragOverrides: () => {
|
|
7458
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7459
|
+
},
|
|
7460
|
+
setCodeValues: () => {
|
|
7461
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7462
|
+
}
|
|
7463
|
+
});
|
|
7464
|
+
var effectDragOverridesKey = (nodePath, effectIndex) => `${makeSequencePropsSubscriptionKey(nodePath)}.effects.${effectIndex}`;
|
|
7465
|
+
var SequenceManagerProvider = ({ children }) => {
|
|
7466
|
+
const [sequences, setSequences] = useState3([]);
|
|
7467
|
+
const [dragOverrides, setControlOverrides] = useState3({});
|
|
7468
|
+
const controlOverridesRef = useRef4(dragOverrides);
|
|
7469
|
+
controlOverridesRef.current = dragOverrides;
|
|
7470
|
+
const [effectDragOverridesState, setEffectDragOverridesState] = useState3({});
|
|
7471
|
+
const [codeValues, setCodeValuesMapState] = useState3({});
|
|
7472
|
+
const setDragOverrides = useCallback5((nodePath, key, value) => {
|
|
7473
|
+
setControlOverrides((prev) => ({
|
|
7474
|
+
...prev,
|
|
7475
|
+
[makeSequencePropsSubscriptionKey(nodePath)]: {
|
|
7476
|
+
...prev[makeSequencePropsSubscriptionKey(nodePath)],
|
|
7477
|
+
[key]: value
|
|
7478
|
+
}
|
|
7479
|
+
}));
|
|
7480
|
+
}, []);
|
|
7481
|
+
const clearDragOverrides = useCallback5((nodePath) => {
|
|
7482
|
+
setControlOverrides((prev) => {
|
|
7483
|
+
const key = makeSequencePropsSubscriptionKey(nodePath);
|
|
7484
|
+
if (!prev[key]) {
|
|
7485
|
+
return prev;
|
|
7486
|
+
}
|
|
7487
|
+
const next = { ...prev };
|
|
7488
|
+
delete next[key];
|
|
7489
|
+
return next;
|
|
7490
|
+
});
|
|
7491
|
+
}, []);
|
|
7492
|
+
const setEffectDragOverrides = useCallback5((nodePath, effectIndex, key, value) => {
|
|
7493
|
+
setEffectDragOverridesState((prev) => {
|
|
7494
|
+
const mapKey = effectDragOverridesKey(nodePath, effectIndex);
|
|
7495
|
+
return {
|
|
7496
|
+
...prev,
|
|
7497
|
+
[mapKey]: {
|
|
7498
|
+
...prev[mapKey],
|
|
7499
|
+
[key]: value
|
|
7317
7500
|
}
|
|
7318
|
-
|
|
7501
|
+
};
|
|
7502
|
+
});
|
|
7503
|
+
}, []);
|
|
7504
|
+
const clearEffectDragOverrides = useCallback5((nodePath, effectIndex) => {
|
|
7505
|
+
setEffectDragOverridesState((prev) => {
|
|
7506
|
+
const mapKey = effectDragOverridesKey(nodePath, effectIndex);
|
|
7507
|
+
if (!prev[mapKey]) {
|
|
7508
|
+
return prev;
|
|
7319
7509
|
}
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7510
|
+
const next = { ...prev };
|
|
7511
|
+
delete next[mapKey];
|
|
7512
|
+
return next;
|
|
7513
|
+
});
|
|
7514
|
+
}, []);
|
|
7515
|
+
const setCodeValues = useCallback5((nodePath, values) => {
|
|
7516
|
+
setCodeValuesMapState((prev) => {
|
|
7517
|
+
const key = makeSequencePropsSubscriptionKey(nodePath);
|
|
7518
|
+
const prevKey = prev[key];
|
|
7519
|
+
const newKey = values(prevKey);
|
|
7520
|
+
if (prevKey === newKey) {
|
|
7521
|
+
return prev;
|
|
7522
|
+
}
|
|
7523
|
+
return { ...prev, [key]: newKey };
|
|
7524
|
+
});
|
|
7525
|
+
}, []);
|
|
7526
|
+
const registerSequence = useCallback5((seq) => {
|
|
7527
|
+
setSequences((seqs) => {
|
|
7528
|
+
return [...seqs, seq];
|
|
7529
|
+
});
|
|
7530
|
+
}, []);
|
|
7531
|
+
const unregisterSequence = useCallback5((seq) => {
|
|
7532
|
+
setSequences((seqs) => seqs.filter((s) => s.id !== seq));
|
|
7533
|
+
}, []);
|
|
7534
|
+
const sequenceContext = useMemo12(() => {
|
|
7535
|
+
return {
|
|
7536
|
+
registerSequence,
|
|
7537
|
+
sequences,
|
|
7538
|
+
unregisterSequence
|
|
7539
|
+
};
|
|
7540
|
+
}, [registerSequence, sequences, unregisterSequence]);
|
|
7541
|
+
const getDragOverrides = useCallback5((nodePath) => {
|
|
7542
|
+
return dragOverrides[makeSequencePropsSubscriptionKey(nodePath)] ?? {};
|
|
7543
|
+
}, [dragOverrides]);
|
|
7544
|
+
const getEffectDragOverrides = useCallback5((nodePath, effectIndex) => {
|
|
7545
|
+
return effectDragOverridesState[effectDragOverridesKey(nodePath, effectIndex)] ?? {};
|
|
7546
|
+
}, [effectDragOverridesState]);
|
|
7547
|
+
const codeValuesContext = useMemo12(() => {
|
|
7548
|
+
return {
|
|
7549
|
+
codeValues
|
|
7550
|
+
};
|
|
7551
|
+
}, [codeValues]);
|
|
7552
|
+
const dragOverridesContext = useMemo12(() => {
|
|
7553
|
+
return {
|
|
7554
|
+
getDragOverrides,
|
|
7555
|
+
getEffectDragOverrides
|
|
7556
|
+
};
|
|
7557
|
+
}, [getDragOverrides, getEffectDragOverrides]);
|
|
7558
|
+
const settersContext = useMemo12(() => {
|
|
7559
|
+
return {
|
|
7560
|
+
setDragOverrides,
|
|
7561
|
+
clearDragOverrides,
|
|
7562
|
+
setEffectDragOverrides,
|
|
7563
|
+
clearEffectDragOverrides,
|
|
7564
|
+
setCodeValues
|
|
7565
|
+
};
|
|
7566
|
+
}, [
|
|
7567
|
+
setDragOverrides,
|
|
7568
|
+
clearDragOverrides,
|
|
7569
|
+
setEffectDragOverrides,
|
|
7570
|
+
clearEffectDragOverrides,
|
|
7571
|
+
setCodeValues
|
|
7572
|
+
]);
|
|
7573
|
+
return /* @__PURE__ */ jsx102(SequenceManager.Provider, {
|
|
7574
|
+
value: sequenceContext,
|
|
7575
|
+
children: /* @__PURE__ */ jsx102(VisualModeCodeValuesContext.Provider, {
|
|
7576
|
+
value: codeValuesContext,
|
|
7577
|
+
children: /* @__PURE__ */ jsx102(VisualModeDragOverridesContext.Provider, {
|
|
7578
|
+
value: dragOverridesContext,
|
|
7579
|
+
children: /* @__PURE__ */ jsx102(VisualModeSettersContext.Provider, {
|
|
7580
|
+
value: settersContext,
|
|
7581
|
+
children
|
|
7582
|
+
})
|
|
7583
|
+
})
|
|
7584
|
+
})
|
|
7585
|
+
});
|
|
7586
|
+
};
|
|
7587
|
+
var ENABLE_V5_BREAKING_CHANGES = false;
|
|
7588
|
+
var deleteNestedKey = (obj, keysToRemove) => {
|
|
7589
|
+
for (const key of keysToRemove) {
|
|
7590
|
+
const parts = key.split(".");
|
|
7591
|
+
const parents = [obj];
|
|
7592
|
+
let current = obj;
|
|
7593
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
7594
|
+
const part = parts[i];
|
|
7595
|
+
const next = current[part];
|
|
7596
|
+
if (next === undefined || next === null) {
|
|
7597
|
+
current = null;
|
|
7598
|
+
break;
|
|
7599
|
+
}
|
|
7600
|
+
current = next;
|
|
7601
|
+
parents.push(current);
|
|
7602
|
+
}
|
|
7603
|
+
if (current === null) {
|
|
7604
|
+
continue;
|
|
7605
|
+
}
|
|
7606
|
+
delete current[parts[parts.length - 1]];
|
|
7607
|
+
for (let i = parents.length - 1;i > 0; i--) {
|
|
7608
|
+
const parent = parents[i];
|
|
7609
|
+
if (Object.keys(parent).length === 0) {
|
|
7610
|
+
const parentKey = parts[i - 1];
|
|
7611
|
+
delete parents[i - 1][parentKey];
|
|
7612
|
+
} else {
|
|
7613
|
+
break;
|
|
7323
7614
|
}
|
|
7324
7615
|
}
|
|
7325
7616
|
}
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
var
|
|
7329
|
-
|
|
7330
|
-
|
|
7617
|
+
return obj;
|
|
7618
|
+
};
|
|
7619
|
+
var OverrideIdsToNodePathsGettersContext = createContext15({
|
|
7620
|
+
overrideIdToNodePathMappings: {}
|
|
7621
|
+
});
|
|
7622
|
+
var OverrideIdsToNodePathsSettersContext = createContext15({
|
|
7623
|
+
setOverrideIdToNodePath: () => {
|
|
7624
|
+
throw new Error("OverrideIdsToNodePathsSettersContext not initialized");
|
|
7331
7625
|
}
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7626
|
+
});
|
|
7627
|
+
var mergeOverrides = ({
|
|
7628
|
+
descriptor,
|
|
7629
|
+
codeOverrides,
|
|
7630
|
+
dragOverrides
|
|
7631
|
+
}) => {
|
|
7632
|
+
if (!codeOverrides && !dragOverrides) {
|
|
7633
|
+
return { params: descriptor.params, effectKey: descriptor.effectKey };
|
|
7634
|
+
}
|
|
7635
|
+
const merged = {
|
|
7636
|
+
...descriptor.params
|
|
7637
|
+
};
|
|
7638
|
+
if (codeOverrides) {
|
|
7639
|
+
for (const [key, value] of Object.entries(codeOverrides)) {
|
|
7640
|
+
if (value !== undefined) {
|
|
7641
|
+
merged[key] = value;
|
|
7642
|
+
}
|
|
7335
7643
|
}
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7644
|
+
}
|
|
7645
|
+
if (dragOverrides) {
|
|
7646
|
+
for (const [key, value] of Object.entries(dragOverrides)) {
|
|
7647
|
+
merged[key] = value;
|
|
7340
7648
|
}
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7649
|
+
}
|
|
7650
|
+
return {
|
|
7651
|
+
params: merged,
|
|
7652
|
+
effectKey: descriptor.definition.calculateKey(merged)
|
|
7653
|
+
};
|
|
7344
7654
|
};
|
|
7345
|
-
var
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7655
|
+
var extractCodeOverrides = (propStatus) => {
|
|
7656
|
+
if (!propStatus) {
|
|
7657
|
+
return null;
|
|
7658
|
+
}
|
|
7659
|
+
const out = {};
|
|
7660
|
+
let hasAny = false;
|
|
7661
|
+
for (const [key, status] of Object.entries(propStatus)) {
|
|
7662
|
+
if (status.canUpdate) {
|
|
7663
|
+
out[key] = status.codeValue;
|
|
7664
|
+
hasAny = true;
|
|
7665
|
+
}
|
|
7355
7666
|
}
|
|
7667
|
+
return hasAny ? out : null;
|
|
7356
7668
|
};
|
|
7357
|
-
var
|
|
7358
|
-
const
|
|
7359
|
-
|
|
7360
|
-
|
|
7669
|
+
var useMemoizedEffectDefinitions = (effects) => {
|
|
7670
|
+
const previousRef = useRef5(null);
|
|
7671
|
+
const definitions = effects.map((descriptor) => descriptor.definition);
|
|
7672
|
+
const previous = previousRef.current;
|
|
7673
|
+
const isSame = previous !== null && previous.length === definitions.length && previous.every((def, i) => def === definitions[i]);
|
|
7674
|
+
if (isSame) {
|
|
7675
|
+
return previous;
|
|
7361
7676
|
}
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
state.cleanupRegistry.push({ definition: widened, state: setupState });
|
|
7365
|
-
return setupState;
|
|
7677
|
+
previousRef.current = definitions;
|
|
7678
|
+
return definitions;
|
|
7366
7679
|
};
|
|
7367
|
-
var
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
output,
|
|
7372
|
-
frame,
|
|
7373
|
-
width,
|
|
7374
|
-
height
|
|
7680
|
+
var getEffectCodeValuesCtx = ({
|
|
7681
|
+
codeValues,
|
|
7682
|
+
nodePath,
|
|
7683
|
+
effectIndex
|
|
7375
7684
|
}) => {
|
|
7376
|
-
const
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
let currentImage = source;
|
|
7380
|
-
let lastTarget = null;
|
|
7381
|
-
if (runs.length === 0) {
|
|
7382
|
-
if (source === output) {
|
|
7383
|
-
return true;
|
|
7384
|
-
}
|
|
7385
|
-
const ctx = output.getContext("2d");
|
|
7386
|
-
if (!ctx) {
|
|
7387
|
-
throw new Error("Failed to acquire 2D context for output canvas");
|
|
7388
|
-
}
|
|
7389
|
-
ctx.clearRect(0, 0, width, height);
|
|
7390
|
-
ctx.drawImage(currentImage, 0, 0, width, height);
|
|
7391
|
-
return true;
|
|
7685
|
+
const status = codeValues[makeSequencePropsSubscriptionKey(nodePath)];
|
|
7686
|
+
if (!status) {
|
|
7687
|
+
return { type: "cannot-update-sequence", reason: "not-found" };
|
|
7392
7688
|
}
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
if (run.backend === "webgpu") {
|
|
7396
|
-
needsGpuDevice = true;
|
|
7397
|
-
break;
|
|
7398
|
-
}
|
|
7689
|
+
if (!status.canUpdate) {
|
|
7690
|
+
return { type: "cannot-update-sequence", reason: status.reason };
|
|
7399
7691
|
}
|
|
7400
|
-
const
|
|
7401
|
-
if (
|
|
7402
|
-
return
|
|
7692
|
+
const effect = status.effects.find((e) => e.effectIndex === effectIndex);
|
|
7693
|
+
if (!effect) {
|
|
7694
|
+
return { type: "cannot-update-effect", reason: "not-found" };
|
|
7403
7695
|
}
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
const [a, b] = state.pool.getPair(run.backend);
|
|
7407
|
-
let dst = a;
|
|
7408
|
-
for (const eff of run.effects) {
|
|
7409
|
-
const def = eff.definition;
|
|
7410
|
-
const setupState = ensureSetup(state, def, dst);
|
|
7411
|
-
def.apply({
|
|
7412
|
-
source: currentImage,
|
|
7413
|
-
target: dst,
|
|
7414
|
-
state: setupState,
|
|
7415
|
-
params: eff.params,
|
|
7416
|
-
frame,
|
|
7417
|
-
width,
|
|
7418
|
-
height,
|
|
7419
|
-
gpuDevice
|
|
7420
|
-
});
|
|
7421
|
-
if (run.backend === "webgl2") {
|
|
7422
|
-
state.pool.assertContextNotLost(dst);
|
|
7423
|
-
}
|
|
7424
|
-
currentImage = dst;
|
|
7425
|
-
dst = dst === a ? b : a;
|
|
7426
|
-
}
|
|
7427
|
-
lastTarget = currentImage ?? lastTarget;
|
|
7428
|
-
const nextRun = runs[runIndex + 1];
|
|
7429
|
-
if (nextRun && nextRun.backend !== run.backend && lastTarget) {
|
|
7430
|
-
const bitmap = await createImageBitmap(lastTarget);
|
|
7431
|
-
if (isCancelled()) {
|
|
7432
|
-
bitmap.close();
|
|
7433
|
-
return false;
|
|
7434
|
-
}
|
|
7435
|
-
currentImage = bitmap;
|
|
7436
|
-
}
|
|
7696
|
+
if (!effect.canUpdate) {
|
|
7697
|
+
return { type: "cannot-update-effect", reason: effect.reason };
|
|
7437
7698
|
}
|
|
7438
|
-
|
|
7439
|
-
|
|
7699
|
+
return { type: "can-update-effect", props: effect.props };
|
|
7700
|
+
};
|
|
7701
|
+
var getCodeValuesCtx = (codeValues, nodePath) => {
|
|
7702
|
+
const status = codeValues[makeSequencePropsSubscriptionKey(nodePath)];
|
|
7703
|
+
if (!status) {
|
|
7704
|
+
return;
|
|
7440
7705
|
}
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
throw new Error("Failed to acquire 2D context for output canvas");
|
|
7706
|
+
if (!status.canUpdate) {
|
|
7707
|
+
return;
|
|
7444
7708
|
}
|
|
7445
|
-
|
|
7446
|
-
outCtx.drawImage(lastTarget, 0, 0, width, height);
|
|
7447
|
-
return true;
|
|
7448
|
-
};
|
|
7449
|
-
var useEffectChainState = () => {
|
|
7450
|
-
const chainStateRef = useRef4(null);
|
|
7451
|
-
const sizeRef = useRef4(null);
|
|
7452
|
-
useEffect3(() => {
|
|
7453
|
-
return () => {
|
|
7454
|
-
if (chainStateRef.current) {
|
|
7455
|
-
cleanupEffectChainState(chainStateRef.current);
|
|
7456
|
-
}
|
|
7457
|
-
};
|
|
7458
|
-
}, []);
|
|
7459
|
-
return useMemo10(() => ({
|
|
7460
|
-
get: (width, height) => {
|
|
7461
|
-
if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
|
|
7462
|
-
if (chainStateRef.current) {
|
|
7463
|
-
cleanupEffectChainState(chainStateRef.current);
|
|
7464
|
-
}
|
|
7465
|
-
chainStateRef.current = createEffectChainState(width, height);
|
|
7466
|
-
sizeRef.current = { width, height };
|
|
7467
|
-
}
|
|
7468
|
-
return chainStateRef.current;
|
|
7469
|
-
}
|
|
7470
|
-
}), []);
|
|
7709
|
+
return status.props;
|
|
7471
7710
|
};
|
|
7472
|
-
var useMemoizedEffects = (
|
|
7711
|
+
var useMemoizedEffects = ({
|
|
7712
|
+
effects,
|
|
7713
|
+
overrideId
|
|
7714
|
+
}) => {
|
|
7473
7715
|
const previousRef = useRef5(null);
|
|
7716
|
+
const { codeValues } = useContext15(VisualModeCodeValuesContext);
|
|
7717
|
+
const { getEffectDragOverrides } = useContext15(VisualModeDragOverridesContext);
|
|
7718
|
+
const { overrideIdToNodePathMappings } = useContext15(OverrideIdsToNodePathsGettersContext);
|
|
7474
7719
|
const previous = previousRef.current;
|
|
7475
|
-
const
|
|
7720
|
+
const nodePath = overrideId ? overrideIdToNodePathMappings[overrideId] ?? null : null;
|
|
7721
|
+
const resolved = effects.map((descriptor, index) => {
|
|
7722
|
+
if (nodePath === null) {
|
|
7723
|
+
return {
|
|
7724
|
+
descriptor,
|
|
7725
|
+
params: descriptor.params,
|
|
7726
|
+
effectKey: descriptor.effectKey
|
|
7727
|
+
};
|
|
7728
|
+
}
|
|
7729
|
+
const effectStatus = getEffectCodeValuesCtx({
|
|
7730
|
+
codeValues,
|
|
7731
|
+
nodePath,
|
|
7732
|
+
effectIndex: index
|
|
7733
|
+
});
|
|
7734
|
+
const codeOverrides = effectStatus.type === "can-update-effect" ? extractCodeOverrides(effectStatus.props) : null;
|
|
7735
|
+
const dragOverridesMap = getEffectDragOverrides(nodePath, index);
|
|
7736
|
+
const dragOverrides = Object.keys(dragOverridesMap).length === 0 ? null : dragOverridesMap;
|
|
7737
|
+
const { params, effectKey } = mergeOverrides({
|
|
7738
|
+
descriptor,
|
|
7739
|
+
codeOverrides,
|
|
7740
|
+
dragOverrides
|
|
7741
|
+
});
|
|
7742
|
+
return { descriptor, params, effectKey };
|
|
7743
|
+
});
|
|
7744
|
+
const isSame = previous !== null && previous.length === resolved.length && previous.every((p, i) => p.definition === resolved[i].descriptor.definition && p.effectKey === resolved[i].effectKey);
|
|
7476
7745
|
if (isSame) {
|
|
7477
7746
|
return previous;
|
|
7478
7747
|
}
|
|
7479
|
-
const next =
|
|
7480
|
-
definition:
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
params: e.params,
|
|
7748
|
+
const next = resolved.map(({ descriptor, params, effectKey }) => ({
|
|
7749
|
+
definition: descriptor.definition,
|
|
7750
|
+
effectKey,
|
|
7751
|
+
params,
|
|
7484
7752
|
memoized: true
|
|
7485
7753
|
}));
|
|
7486
7754
|
previousRef.current = next;
|
|
7487
7755
|
return next;
|
|
7488
7756
|
};
|
|
7489
|
-
var
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
};
|
|
7505
|
-
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
7506
|
-
if (alreadyImported) {
|
|
7507
|
-
if (alreadyImported === VERSION) {
|
|
7508
|
-
return;
|
|
7509
|
-
}
|
|
7510
|
-
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
7511
|
-
set();
|
|
7512
|
-
return;
|
|
7757
|
+
var flattenActiveSchema = (schema, resolve) => {
|
|
7758
|
+
const out = {};
|
|
7759
|
+
for (const key of Object.keys(schema)) {
|
|
7760
|
+
const field = schema[key];
|
|
7761
|
+
if (field.type === "hidden") {
|
|
7762
|
+
continue;
|
|
7763
|
+
} else if (field.type === "enum") {
|
|
7764
|
+
out[key] = field;
|
|
7765
|
+
const current = resolve(key) ?? field.default;
|
|
7766
|
+
const variant = field.variants[current];
|
|
7767
|
+
if (variant) {
|
|
7768
|
+
Object.assign(out, flattenActiveSchema(variant, resolve));
|
|
7769
|
+
}
|
|
7770
|
+
} else {
|
|
7771
|
+
out[key] = field;
|
|
7513
7772
|
}
|
|
7514
|
-
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
7515
|
-
VERSION,
|
|
7516
|
-
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
7517
|
-
].filter(truthy2).join(" and ")}. This will cause things to break in an unexpected way.
|
|
7518
|
-
Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
|
|
7519
7773
|
}
|
|
7520
|
-
|
|
7774
|
+
return out;
|
|
7521
7775
|
};
|
|
7522
|
-
var
|
|
7523
|
-
const
|
|
7524
|
-
const
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
const video = useVideo();
|
|
7528
|
-
return useMemo12(() => {
|
|
7529
|
-
if (!video) {
|
|
7530
|
-
return null;
|
|
7776
|
+
var getFlatSchemaWithAllKeys = (schema) => {
|
|
7777
|
+
const out = {};
|
|
7778
|
+
const addKey = (key, field) => {
|
|
7779
|
+
if (key in out) {
|
|
7780
|
+
throw new Error(`Duplicate key "${key}" in schema: discriminated union variants must not share keys`);
|
|
7531
7781
|
}
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
defaultProResProfile,
|
|
7545
|
-
defaultSampleRate
|
|
7546
|
-
} = video;
|
|
7547
|
-
return {
|
|
7548
|
-
id,
|
|
7549
|
-
width: ctxWidth ?? width,
|
|
7550
|
-
height: ctxHeight ?? height,
|
|
7551
|
-
fps,
|
|
7552
|
-
durationInFrames: ctxDuration ?? durationInFrames,
|
|
7553
|
-
defaultProps,
|
|
7554
|
-
props,
|
|
7555
|
-
defaultCodec,
|
|
7556
|
-
defaultOutName,
|
|
7557
|
-
defaultVideoImageFormat,
|
|
7558
|
-
defaultPixelFormat,
|
|
7559
|
-
defaultProResProfile,
|
|
7560
|
-
defaultSampleRate
|
|
7561
|
-
};
|
|
7562
|
-
}, [ctxDuration, ctxHeight, ctxWidth, video]);
|
|
7563
|
-
};
|
|
7564
|
-
var useVideoConfig = () => {
|
|
7565
|
-
const videoConfig = useUnsafeVideoConfig();
|
|
7566
|
-
const context = useContext13(CanUseRemotionHooks);
|
|
7567
|
-
const isPlayer = useIsPlayer();
|
|
7568
|
-
if (!videoConfig) {
|
|
7569
|
-
if (typeof window !== "undefined" && window.remotion_isPlayer || isPlayer) {
|
|
7570
|
-
throw new Error([
|
|
7571
|
-
"No video config found. Likely reasons:",
|
|
7572
|
-
"- You are probably calling useVideoConfig() from outside the component passed to <Player />. See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.",
|
|
7573
|
-
"- You have multiple versions of Remotion installed which causes the React context to get lost."
|
|
7574
|
-
].join("-"));
|
|
7782
|
+
out[key] = field;
|
|
7783
|
+
};
|
|
7784
|
+
for (const key of Object.keys(schema)) {
|
|
7785
|
+
const field = schema[key];
|
|
7786
|
+
addKey(key, field);
|
|
7787
|
+
if (field.type === "enum") {
|
|
7788
|
+
for (const variant of Object.values(field.variants)) {
|
|
7789
|
+
const flatVariant = getFlatSchemaWithAllKeys(variant);
|
|
7790
|
+
for (const variantKey of Object.keys(flatVariant)) {
|
|
7791
|
+
addKey(variantKey, flatVariant[variantKey]);
|
|
7792
|
+
}
|
|
7793
|
+
}
|
|
7575
7794
|
}
|
|
7576
|
-
throw new Error("No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.");
|
|
7577
7795
|
}
|
|
7578
|
-
|
|
7579
|
-
throw new Error("Called useVideoConfig() outside a Remotion composition.");
|
|
7580
|
-
}
|
|
7581
|
-
return videoConfig;
|
|
7796
|
+
return out;
|
|
7582
7797
|
};
|
|
7583
|
-
var
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7798
|
+
var findPropsToDelete = ({
|
|
7799
|
+
schema,
|
|
7800
|
+
key,
|
|
7801
|
+
value
|
|
7587
7802
|
}) => {
|
|
7588
|
-
const
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
throw new Error(`The <Freeze /> component requires a 'frame' prop, but none was passed.`);
|
|
7592
|
-
}
|
|
7593
|
-
if (typeof frameToFreeze !== "number") {
|
|
7594
|
-
throw new Error(`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof frameToFreeze}`);
|
|
7803
|
+
const fieldSchema = schema[key];
|
|
7804
|
+
if (!fieldSchema) {
|
|
7805
|
+
throw new Error("Key " + JSON.stringify(key) + " not found in schema");
|
|
7595
7806
|
}
|
|
7596
|
-
if (
|
|
7597
|
-
throw new Error(
|
|
7807
|
+
if (typeof value !== "string") {
|
|
7808
|
+
throw new Error("Value must be a string, but is " + JSON.stringify(value));
|
|
7598
7809
|
}
|
|
7599
|
-
if (
|
|
7600
|
-
throw new Error(
|
|
7810
|
+
if (fieldSchema.type !== "enum") {
|
|
7811
|
+
throw new Error("Key " + JSON.stringify(key) + " is not an enum");
|
|
7601
7812
|
}
|
|
7602
|
-
const
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7813
|
+
const currentVariant = fieldSchema.variants[value];
|
|
7814
|
+
if (!currentVariant) {
|
|
7815
|
+
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));
|
|
7816
|
+
}
|
|
7817
|
+
const otherVariants = Object.keys(fieldSchema.variants).filter((v) => v !== value);
|
|
7818
|
+
const otherKeys = new Set;
|
|
7819
|
+
for (const variant of otherVariants) {
|
|
7820
|
+
const otherVariant = fieldSchema.variants[variant];
|
|
7821
|
+
const keys = Object.keys(otherVariant);
|
|
7822
|
+
for (const k of keys) {
|
|
7823
|
+
otherKeys.add(k);
|
|
7608
7824
|
}
|
|
7609
|
-
}
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7825
|
+
}
|
|
7826
|
+
return [...otherKeys];
|
|
7827
|
+
};
|
|
7828
|
+
var getEffectiveVisualModeValue = ({
|
|
7829
|
+
codeValue,
|
|
7830
|
+
dragOverrideValue,
|
|
7831
|
+
defaultValue,
|
|
7832
|
+
shouldResortToDefaultValueIfUndefined = false
|
|
7833
|
+
}) => {
|
|
7834
|
+
if (dragOverrideValue !== undefined) {
|
|
7835
|
+
return dragOverrideValue;
|
|
7836
|
+
}
|
|
7837
|
+
if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
|
|
7838
|
+
return defaultValue;
|
|
7839
|
+
}
|
|
7840
|
+
return codeValue.codeValue;
|
|
7841
|
+
};
|
|
7842
|
+
var findFieldInSchema = (schema, key) => {
|
|
7843
|
+
if (key in schema) {
|
|
7844
|
+
return schema[key];
|
|
7845
|
+
}
|
|
7846
|
+
for (const field of Object.values(schema)) {
|
|
7847
|
+
if (field.type !== "enum") {
|
|
7848
|
+
continue;
|
|
7616
7849
|
}
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
current: false
|
|
7622
|
-
},
|
|
7623
|
-
frame: {
|
|
7624
|
-
[videoConfig.id]: frameToFreeze + relativeFrom
|
|
7850
|
+
for (const variant of Object.values(field.variants)) {
|
|
7851
|
+
const found = findFieldInSchema(variant, key);
|
|
7852
|
+
if (found) {
|
|
7853
|
+
return found;
|
|
7625
7854
|
}
|
|
7626
|
-
};
|
|
7627
|
-
}, [isActive, timelineContext, videoConfig.id, frameToFreeze, relativeFrom]);
|
|
7628
|
-
const newSequenceContext = useMemo13(() => {
|
|
7629
|
-
if (!sequenceContext) {
|
|
7630
|
-
return null;
|
|
7631
|
-
}
|
|
7632
|
-
if (!isActive) {
|
|
7633
|
-
return sequenceContext;
|
|
7634
7855
|
}
|
|
7635
|
-
return {
|
|
7636
|
-
...sequenceContext,
|
|
7637
|
-
cumulatedFrom: 0
|
|
7638
|
-
};
|
|
7639
|
-
}, [sequenceContext, isActive]);
|
|
7640
|
-
return /* @__PURE__ */ jsx102(TimelineContext.Provider, {
|
|
7641
|
-
value: timelineValue,
|
|
7642
|
-
children: /* @__PURE__ */ jsx102(SequenceContext.Provider, {
|
|
7643
|
-
value: newSequenceContext,
|
|
7644
|
-
children
|
|
7645
|
-
})
|
|
7646
|
-
});
|
|
7647
|
-
};
|
|
7648
|
-
var PremountContext = createContext14({
|
|
7649
|
-
premountFramesRemaining: 0
|
|
7650
|
-
});
|
|
7651
|
-
var sequenceStyleSchema = {
|
|
7652
|
-
"style.translate": {
|
|
7653
|
-
type: "translate",
|
|
7654
|
-
step: 1,
|
|
7655
|
-
default: "0px 0px",
|
|
7656
|
-
description: "Offset"
|
|
7657
|
-
},
|
|
7658
|
-
"style.scale": {
|
|
7659
|
-
type: "number",
|
|
7660
|
-
min: 0.05,
|
|
7661
|
-
max: 100,
|
|
7662
|
-
step: 0.01,
|
|
7663
|
-
default: 1,
|
|
7664
|
-
description: "Scale"
|
|
7665
|
-
},
|
|
7666
|
-
"style.rotate": {
|
|
7667
|
-
type: "rotation",
|
|
7668
|
-
step: 1,
|
|
7669
|
-
default: "0deg",
|
|
7670
|
-
description: "Rotation"
|
|
7671
|
-
},
|
|
7672
|
-
"style.opacity": {
|
|
7673
|
-
type: "number",
|
|
7674
|
-
min: 0,
|
|
7675
|
-
max: 1,
|
|
7676
|
-
step: 0.01,
|
|
7677
|
-
default: 1,
|
|
7678
|
-
description: "Opacity"
|
|
7679
|
-
},
|
|
7680
|
-
premountFor: {
|
|
7681
|
-
type: "number",
|
|
7682
|
-
default: 0,
|
|
7683
|
-
description: "Premount For",
|
|
7684
|
-
min: 0,
|
|
7685
|
-
step: 1
|
|
7686
|
-
},
|
|
7687
|
-
postmountFor: {
|
|
7688
|
-
type: "hidden"
|
|
7689
|
-
},
|
|
7690
|
-
styleWhilePremounted: {
|
|
7691
|
-
type: "hidden"
|
|
7692
|
-
},
|
|
7693
|
-
styleWhilePostmounted: {
|
|
7694
|
-
type: "hidden"
|
|
7695
7856
|
}
|
|
7857
|
+
return;
|
|
7696
7858
|
};
|
|
7697
|
-
var
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7859
|
+
var computeEffectiveSchemaValuesDotNotation = ({
|
|
7860
|
+
schema,
|
|
7861
|
+
currentValue,
|
|
7862
|
+
overrideValues,
|
|
7863
|
+
propStatus
|
|
7864
|
+
}) => {
|
|
7865
|
+
const merged = {};
|
|
7866
|
+
const propsToDelete = new Set;
|
|
7867
|
+
for (const key of Object.keys(currentValue)) {
|
|
7868
|
+
const codeValueStatus = propStatus?.[key] ?? null;
|
|
7869
|
+
const field = findFieldInSchema(schema, key);
|
|
7870
|
+
if (field?.type === "hidden") {
|
|
7871
|
+
continue;
|
|
7705
7872
|
}
|
|
7873
|
+
const value = codeValueStatus === null || codeValueStatus.canUpdate === false ? currentValue[key] : getEffectiveVisualModeValue({
|
|
7874
|
+
codeValue: codeValueStatus,
|
|
7875
|
+
dragOverrideValue: overrideValues[key],
|
|
7876
|
+
defaultValue: field?.default,
|
|
7877
|
+
shouldResortToDefaultValueIfUndefined: false
|
|
7878
|
+
});
|
|
7879
|
+
if (value === undefined) {
|
|
7880
|
+
propsToDelete.add(key);
|
|
7881
|
+
}
|
|
7882
|
+
merged[key] = value;
|
|
7706
7883
|
}
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7884
|
+
for (const key of Object.keys(overrideValues)) {
|
|
7885
|
+
if (schema[key]?.type === "enum") {
|
|
7886
|
+
const propsToDeleteForKey = findPropsToDelete({
|
|
7887
|
+
schema,
|
|
7888
|
+
key,
|
|
7889
|
+
value: merged[key]
|
|
7890
|
+
});
|
|
7891
|
+
for (const propToDelete of propsToDeleteForKey) {
|
|
7892
|
+
propsToDelete.add(propToDelete);
|
|
7893
|
+
}
|
|
7894
|
+
}
|
|
7713
7895
|
}
|
|
7896
|
+
return { merged, propsToDelete };
|
|
7714
7897
|
};
|
|
7715
|
-
var
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
unregisterSequence: () => {
|
|
7723
|
-
throw new Error("SequenceManagerContext not initialized");
|
|
7724
|
-
},
|
|
7725
|
-
sequences: []
|
|
7726
|
-
});
|
|
7727
|
-
var SequenceVisibilityToggleContext = React12.createContext({
|
|
7728
|
-
hidden: {},
|
|
7729
|
-
setHidden: () => {
|
|
7730
|
-
throw new Error("SequenceVisibilityToggle not initialized");
|
|
7731
|
-
}
|
|
7732
|
-
});
|
|
7733
|
-
var getCodeValuesCtx = (codeValues, nodePath) => {
|
|
7734
|
-
const status = codeValues[nodePathToString(nodePath)];
|
|
7735
|
-
if (!status) {
|
|
7736
|
-
return;
|
|
7737
|
-
}
|
|
7738
|
-
if (!status.canUpdate) {
|
|
7739
|
-
return;
|
|
7898
|
+
var getNestedValue = (obj, key) => {
|
|
7899
|
+
const parts = key.split(".");
|
|
7900
|
+
let current = obj;
|
|
7901
|
+
for (const part of parts) {
|
|
7902
|
+
if (current === null || current === undefined || typeof current !== "object")
|
|
7903
|
+
return;
|
|
7904
|
+
current = current[part];
|
|
7740
7905
|
}
|
|
7741
|
-
return
|
|
7906
|
+
return current;
|
|
7742
7907
|
};
|
|
7743
|
-
var
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
});
|
|
7748
|
-
var VisualModeDragOverridesContext = React12.createContext({
|
|
7749
|
-
getDragOverrides: () => {
|
|
7750
|
-
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
7751
|
-
}
|
|
7752
|
-
});
|
|
7753
|
-
var VisualModeSettersContext = React12.createContext({
|
|
7754
|
-
setDragOverrides: () => {
|
|
7755
|
-
throw new Error("VisualModeSettersContext not initialized");
|
|
7756
|
-
},
|
|
7757
|
-
clearDragOverrides: () => {
|
|
7758
|
-
throw new Error("VisualModeSettersContext not initialized");
|
|
7759
|
-
},
|
|
7760
|
-
setCodeValues: () => {
|
|
7761
|
-
throw new Error("VisualModeSettersContext not initialized");
|
|
7908
|
+
var readValuesFromProps = (props, keys) => {
|
|
7909
|
+
const out = {};
|
|
7910
|
+
for (const key of keys) {
|
|
7911
|
+
out[key] = getNestedValue(props, key);
|
|
7762
7912
|
}
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7913
|
+
return out;
|
|
7914
|
+
};
|
|
7915
|
+
var selectActiveKeys = (schema, values) => {
|
|
7916
|
+
return Object.keys(flattenActiveSchema(schema, (key) => values[key]));
|
|
7917
|
+
};
|
|
7918
|
+
var mergeValues = ({
|
|
7919
|
+
props,
|
|
7920
|
+
valuesDotNotation,
|
|
7921
|
+
schemaKeys,
|
|
7922
|
+
propsToDelete
|
|
7923
|
+
}) => {
|
|
7924
|
+
const merged = { ...props };
|
|
7925
|
+
for (const key of schemaKeys) {
|
|
7926
|
+
const value = valuesDotNotation[key];
|
|
7927
|
+
const parts = key.split(".");
|
|
7928
|
+
if (parts.length === 1) {
|
|
7929
|
+
merged[key] = value;
|
|
7930
|
+
continue;
|
|
7931
|
+
}
|
|
7932
|
+
let current = merged;
|
|
7933
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
7934
|
+
const part = parts[i];
|
|
7935
|
+
if (typeof current[part] === "object" && current[part] !== null) {
|
|
7936
|
+
current[part] = { ...current[part] };
|
|
7937
|
+
} else {
|
|
7938
|
+
current[part] = {};
|
|
7785
7939
|
}
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7940
|
+
current = current[part];
|
|
7941
|
+
}
|
|
7942
|
+
current[parts[parts.length - 1]] = value;
|
|
7943
|
+
}
|
|
7944
|
+
deleteNestedKey(merged, propsToDelete);
|
|
7945
|
+
return merged;
|
|
7946
|
+
};
|
|
7947
|
+
var stackToOverrideMap = {};
|
|
7948
|
+
var wrapInSchema = (Component, schema) => {
|
|
7949
|
+
const flatSchema = getFlatSchemaWithAllKeys(schema);
|
|
7950
|
+
const flatKeys = Object.keys(flatSchema);
|
|
7951
|
+
const Wrapped = forwardRef2((props, ref) => {
|
|
7952
|
+
const env = useRemotionEnvironment();
|
|
7953
|
+
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
|
|
7954
|
+
return React12.createElement(Component, {
|
|
7955
|
+
...props,
|
|
7956
|
+
_experimentalControls: null,
|
|
7957
|
+
ref
|
|
7958
|
+
});
|
|
7959
|
+
}
|
|
7960
|
+
const { codeValues } = useContext16(VisualModeCodeValuesContext);
|
|
7961
|
+
const { getDragOverrides } = useContext16(VisualModeDragOverridesContext);
|
|
7962
|
+
const nodePathMapping = useContext16(OverrideIdsToNodePathsGettersContext);
|
|
7963
|
+
if (props._experimentalControls) {
|
|
7964
|
+
return React12.createElement(Component, {
|
|
7965
|
+
...props,
|
|
7966
|
+
ref
|
|
7967
|
+
});
|
|
7968
|
+
}
|
|
7969
|
+
const [overrideId] = useState4(() => {
|
|
7970
|
+
const { stack } = props;
|
|
7971
|
+
if (!stack) {
|
|
7972
|
+
return String(Math.random());
|
|
7798
7973
|
}
|
|
7799
|
-
|
|
7974
|
+
const existingOverrideId = stackToOverrideMap[stack];
|
|
7975
|
+
if (existingOverrideId) {
|
|
7976
|
+
return existingOverrideId;
|
|
7977
|
+
}
|
|
7978
|
+
const newOverrideId = String(Math.random());
|
|
7979
|
+
stackToOverrideMap[stack] = newOverrideId;
|
|
7980
|
+
return newOverrideId;
|
|
7800
7981
|
});
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7982
|
+
const nodePath = nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
|
|
7983
|
+
const runtimeValues = flatKeys.map((k) => getNestedValue(props, k));
|
|
7984
|
+
const currentRuntimeValueDotNotation = useMemo13(() => readValuesFromProps(props, flatKeys), runtimeValues);
|
|
7985
|
+
const controls = useMemo13(() => {
|
|
7986
|
+
return {
|
|
7987
|
+
schema,
|
|
7988
|
+
currentRuntimeValueDotNotation,
|
|
7989
|
+
overrideId
|
|
7990
|
+
};
|
|
7991
|
+
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
7992
|
+
const { merged: valuesDotNotation, propsToDelete } = useMemo13(() => {
|
|
7993
|
+
return computeEffectiveSchemaValuesDotNotation({
|
|
7994
|
+
schema,
|
|
7995
|
+
currentValue: currentRuntimeValueDotNotation,
|
|
7996
|
+
overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
|
|
7997
|
+
propStatus: nodePath === null ? undefined : getCodeValuesCtx(codeValues, nodePath)
|
|
7998
|
+
});
|
|
7999
|
+
}, [
|
|
8000
|
+
currentRuntimeValueDotNotation,
|
|
8001
|
+
getDragOverrides,
|
|
8002
|
+
nodePath,
|
|
8003
|
+
codeValues
|
|
8004
|
+
]);
|
|
8005
|
+
const activeKeys = selectActiveKeys(schema, valuesDotNotation);
|
|
8006
|
+
const mergedProps = mergeValues({
|
|
8007
|
+
props,
|
|
8008
|
+
valuesDotNotation,
|
|
8009
|
+
schemaKeys: activeKeys,
|
|
8010
|
+
propsToDelete
|
|
7805
8011
|
});
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
8012
|
+
return React12.createElement(Component, {
|
|
8013
|
+
...mergedProps,
|
|
8014
|
+
_experimentalControls: controls,
|
|
8015
|
+
ref
|
|
8016
|
+
});
|
|
8017
|
+
});
|
|
8018
|
+
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
8019
|
+
return Wrapped;
|
|
8020
|
+
};
|
|
8021
|
+
var RegularSequenceRefForwardingFunction = ({
|
|
8022
|
+
from = 0,
|
|
8023
|
+
durationInFrames = Infinity,
|
|
8024
|
+
children,
|
|
8025
|
+
name,
|
|
8026
|
+
height,
|
|
8027
|
+
width,
|
|
8028
|
+
showInTimeline = true,
|
|
8029
|
+
hidden = false,
|
|
8030
|
+
_experimentalControls: controls,
|
|
8031
|
+
_experimentalEffects,
|
|
8032
|
+
_remotionInternalLoopDisplay: loopDisplay,
|
|
8033
|
+
_remotionInternalStack: stack,
|
|
8034
|
+
_remotionInternalPremountDisplay: premountDisplay,
|
|
8035
|
+
_remotionInternalPostmountDisplay: postmountDisplay,
|
|
8036
|
+
_remotionInternalIsMedia: isMedia,
|
|
8037
|
+
...other
|
|
8038
|
+
}, ref) => {
|
|
8039
|
+
const { layout = "absolute-fill" } = other;
|
|
8040
|
+
const [id] = useState5(() => String(Math.random()));
|
|
8041
|
+
const parentSequence = useContext17(SequenceContext);
|
|
8042
|
+
const { rootId } = useTimelineContext();
|
|
8043
|
+
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
8044
|
+
const nonce = useNonce();
|
|
8045
|
+
if (layout !== "absolute-fill" && layout !== "none") {
|
|
8046
|
+
throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${layout}`);
|
|
8047
|
+
}
|
|
8048
|
+
if (layout === "none" && typeof other.style !== "undefined") {
|
|
8049
|
+
throw new TypeError('If layout="none", you may not pass a style. Passed: ' + JSON.stringify(other.style));
|
|
8050
|
+
}
|
|
8051
|
+
if (typeof durationInFrames !== "number") {
|
|
8052
|
+
throw new TypeError(`You passed to durationInFrames an argument of type ${typeof durationInFrames}, but it must be a number.`);
|
|
8053
|
+
}
|
|
8054
|
+
if (durationInFrames <= 0) {
|
|
8055
|
+
throw new TypeError(`durationInFrames must be positive, but got ${durationInFrames}`);
|
|
8056
|
+
}
|
|
8057
|
+
if (typeof from !== "number") {
|
|
8058
|
+
throw new TypeError(`You passed to the "from" props of your <Sequence> an argument of type ${typeof from}, but it must be a number.`);
|
|
8059
|
+
}
|
|
8060
|
+
if (!Number.isFinite(from)) {
|
|
8061
|
+
throw new TypeError(`The "from" prop of a sequence must be finite, but got ${from}.`);
|
|
8062
|
+
}
|
|
8063
|
+
const absoluteFrame = useTimelinePosition();
|
|
8064
|
+
const videoConfig = useVideoConfig();
|
|
8065
|
+
const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - from, durationInFrames) : durationInFrames;
|
|
8066
|
+
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
8067
|
+
const { registerSequence, unregisterSequence } = useContext17(SequenceManager);
|
|
8068
|
+
const premounting = useMemo14(() => {
|
|
8069
|
+
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
8070
|
+
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
8071
|
+
const postmounting = useMemo14(() => {
|
|
8072
|
+
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
8073
|
+
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
8074
|
+
const contextValue = useMemo14(() => {
|
|
7818
8075
|
return {
|
|
7819
|
-
|
|
7820
|
-
|
|
8076
|
+
cumulatedFrom,
|
|
8077
|
+
relativeFrom: from,
|
|
8078
|
+
durationInFrames: actualDurationInFrames,
|
|
8079
|
+
parentFrom: parentSequence?.relativeFrom ?? 0,
|
|
8080
|
+
id,
|
|
8081
|
+
height: height ?? parentSequence?.height ?? null,
|
|
8082
|
+
width: width ?? parentSequence?.width ?? null,
|
|
8083
|
+
premounting,
|
|
8084
|
+
postmounting,
|
|
8085
|
+
premountDisplay: premountDisplay ?? null,
|
|
8086
|
+
postmountDisplay: postmountDisplay ?? null
|
|
7821
8087
|
};
|
|
7822
|
-
}, [
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
8088
|
+
}, [
|
|
8089
|
+
cumulatedFrom,
|
|
8090
|
+
from,
|
|
8091
|
+
actualDurationInFrames,
|
|
8092
|
+
parentSequence,
|
|
8093
|
+
id,
|
|
8094
|
+
height,
|
|
8095
|
+
width,
|
|
8096
|
+
premounting,
|
|
8097
|
+
postmounting,
|
|
8098
|
+
premountDisplay,
|
|
8099
|
+
postmountDisplay
|
|
8100
|
+
]);
|
|
8101
|
+
const timelineClipName = useMemo14(() => {
|
|
8102
|
+
return name ?? "";
|
|
8103
|
+
}, [name]);
|
|
8104
|
+
const env = useRemotionEnvironment();
|
|
8105
|
+
const inheritedStack = other?.stack ?? null;
|
|
8106
|
+
const [stackDoesntChange] = useState5(() => stack ?? inheritedStack);
|
|
8107
|
+
useEffect3(() => {
|
|
8108
|
+
if (!env.isStudio) {
|
|
8109
|
+
return;
|
|
8110
|
+
}
|
|
8111
|
+
if (isMedia) {
|
|
8112
|
+
registerSequence({
|
|
8113
|
+
type: isMedia.type,
|
|
8114
|
+
controls: controls ?? null,
|
|
8115
|
+
effects: _experimentalEffects ?? [],
|
|
8116
|
+
displayName: timelineClipName,
|
|
8117
|
+
doesVolumeChange: isMedia.data.doesVolumeChange,
|
|
8118
|
+
duration: actualDurationInFrames,
|
|
8119
|
+
from,
|
|
8120
|
+
id,
|
|
8121
|
+
loopDisplay,
|
|
8122
|
+
nonce: nonce.get(),
|
|
8123
|
+
parent: parentSequence?.id ?? null,
|
|
8124
|
+
playbackRate: isMedia.data.playbackRate,
|
|
8125
|
+
postmountDisplay: postmountDisplay ?? null,
|
|
8126
|
+
premountDisplay: premountDisplay ?? null,
|
|
8127
|
+
rootId,
|
|
8128
|
+
showInTimeline,
|
|
8129
|
+
src: isMedia.data.src,
|
|
8130
|
+
stack: stackDoesntChange,
|
|
8131
|
+
startMediaFrom: isMedia.data.startMediaFrom,
|
|
8132
|
+
volume: isMedia.data.volumes
|
|
8133
|
+
});
|
|
8134
|
+
return () => {
|
|
8135
|
+
unregisterSequence(id);
|
|
8136
|
+
};
|
|
8137
|
+
}
|
|
8138
|
+
registerSequence({
|
|
8139
|
+
from,
|
|
8140
|
+
duration: actualDurationInFrames,
|
|
8141
|
+
id,
|
|
8142
|
+
displayName: timelineClipName,
|
|
8143
|
+
parent: parentSequence?.id ?? null,
|
|
8144
|
+
type: "sequence",
|
|
8145
|
+
rootId,
|
|
8146
|
+
showInTimeline,
|
|
8147
|
+
nonce: nonce.get(),
|
|
8148
|
+
loopDisplay,
|
|
8149
|
+
stack: stackDoesntChange,
|
|
8150
|
+
premountDisplay: premountDisplay ?? null,
|
|
8151
|
+
postmountDisplay: postmountDisplay ?? null,
|
|
8152
|
+
controls: controls ?? null,
|
|
8153
|
+
effects: _experimentalEffects ?? []
|
|
8154
|
+
});
|
|
8155
|
+
return () => {
|
|
8156
|
+
unregisterSequence(id);
|
|
7832
8157
|
};
|
|
7833
|
-
}, [
|
|
7834
|
-
|
|
8158
|
+
}, [
|
|
8159
|
+
durationInFrames,
|
|
8160
|
+
id,
|
|
8161
|
+
name,
|
|
8162
|
+
registerSequence,
|
|
8163
|
+
timelineClipName,
|
|
8164
|
+
unregisterSequence,
|
|
8165
|
+
parentSequence?.id,
|
|
8166
|
+
actualDurationInFrames,
|
|
8167
|
+
rootId,
|
|
8168
|
+
from,
|
|
8169
|
+
showInTimeline,
|
|
8170
|
+
nonce,
|
|
8171
|
+
loopDisplay,
|
|
8172
|
+
stackDoesntChange,
|
|
8173
|
+
premountDisplay,
|
|
8174
|
+
postmountDisplay,
|
|
8175
|
+
env.isStudio,
|
|
8176
|
+
controls,
|
|
8177
|
+
_experimentalEffects,
|
|
8178
|
+
isMedia
|
|
8179
|
+
]);
|
|
8180
|
+
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
8181
|
+
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
8182
|
+
const styleIfThere = other.layout === "none" ? undefined : other.style;
|
|
8183
|
+
const defaultStyle = useMemo14(() => {
|
|
7835
8184
|
return {
|
|
7836
|
-
|
|
8185
|
+
flexDirection: undefined,
|
|
8186
|
+
...width ? { width } : {},
|
|
8187
|
+
...height ? { height } : {},
|
|
8188
|
+
...styleIfThere ?? {}
|
|
7837
8189
|
};
|
|
7838
|
-
}, [
|
|
7839
|
-
|
|
8190
|
+
}, [height, styleIfThere, width]);
|
|
8191
|
+
if (ref !== null && layout === "none") {
|
|
8192
|
+
throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');
|
|
8193
|
+
}
|
|
8194
|
+
if (hidden) {
|
|
8195
|
+
return null;
|
|
8196
|
+
}
|
|
8197
|
+
return /* @__PURE__ */ jsx112(SequenceContext.Provider, {
|
|
8198
|
+
value: contextValue,
|
|
8199
|
+
children: content === null ? null : other.layout === "none" ? content : /* @__PURE__ */ jsx112(AbsoluteFill, {
|
|
8200
|
+
ref,
|
|
8201
|
+
style: defaultStyle,
|
|
8202
|
+
className: other.className,
|
|
8203
|
+
children: content
|
|
8204
|
+
})
|
|
8205
|
+
});
|
|
8206
|
+
};
|
|
8207
|
+
var RegularSequence = forwardRef3(RegularSequenceRefForwardingFunction);
|
|
8208
|
+
var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
8209
|
+
const parentPremountContext = useContext17(PremountContext);
|
|
8210
|
+
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
8211
|
+
if (props.layout === "none") {
|
|
8212
|
+
throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
|
|
8213
|
+
}
|
|
8214
|
+
const {
|
|
8215
|
+
style: passedStyle,
|
|
8216
|
+
from = 0,
|
|
8217
|
+
durationInFrames = Infinity,
|
|
8218
|
+
premountFor = 0,
|
|
8219
|
+
postmountFor = 0,
|
|
8220
|
+
styleWhilePremounted,
|
|
8221
|
+
styleWhilePostmounted,
|
|
8222
|
+
...otherProps
|
|
8223
|
+
} = props;
|
|
8224
|
+
const endThreshold = Math.ceil(from + durationInFrames - 1);
|
|
8225
|
+
const premountingActive = frame < from && frame >= from - premountFor;
|
|
8226
|
+
const postmountingActive = frame > endThreshold && frame <= endThreshold + postmountFor;
|
|
8227
|
+
const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
|
|
8228
|
+
const isFreezingActive = premountingActive || postmountingActive;
|
|
8229
|
+
const style = useMemo14(() => {
|
|
7840
8230
|
return {
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
8231
|
+
...passedStyle,
|
|
8232
|
+
opacity: premountingActive || postmountingActive ? 0 : 1,
|
|
8233
|
+
pointerEvents: premountingActive || postmountingActive ? "none" : passedStyle?.pointerEvents ?? undefined,
|
|
8234
|
+
...premountingActive ? styleWhilePremounted : {},
|
|
8235
|
+
...postmountingActive ? styleWhilePostmounted : {}
|
|
7844
8236
|
};
|
|
7845
|
-
}, [
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
8237
|
+
}, [
|
|
8238
|
+
passedStyle,
|
|
8239
|
+
premountingActive,
|
|
8240
|
+
postmountingActive,
|
|
8241
|
+
styleWhilePremounted,
|
|
8242
|
+
styleWhilePostmounted
|
|
8243
|
+
]);
|
|
8244
|
+
return /* @__PURE__ */ jsx112(Freeze, {
|
|
8245
|
+
frame: freezeFrame,
|
|
8246
|
+
active: isFreezingActive,
|
|
8247
|
+
children: /* @__PURE__ */ jsx112(SequenceInner, {
|
|
8248
|
+
ref,
|
|
8249
|
+
from,
|
|
8250
|
+
durationInFrames,
|
|
8251
|
+
style,
|
|
8252
|
+
_remotionInternalPremountDisplay: premountFor,
|
|
8253
|
+
_remotionInternalPostmountDisplay: postmountFor,
|
|
8254
|
+
_remotionInternalIsPremounting: premountingActive,
|
|
8255
|
+
_remotionInternalIsPostmounting: postmountingActive,
|
|
8256
|
+
...otherProps
|
|
7860
8257
|
})
|
|
7861
8258
|
});
|
|
7862
8259
|
};
|
|
7863
|
-
var
|
|
7864
|
-
var
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
}
|
|
7876
|
-
current = next;
|
|
7877
|
-
parents.push(current);
|
|
7878
|
-
}
|
|
7879
|
-
if (current === null) {
|
|
7880
|
-
continue;
|
|
7881
|
-
}
|
|
7882
|
-
delete current[parts[parts.length - 1]];
|
|
7883
|
-
for (let i = parents.length - 1;i > 0; i--) {
|
|
7884
|
-
const parent = parents[i];
|
|
7885
|
-
if (Object.keys(parent).length === 0) {
|
|
7886
|
-
const parentKey = parts[i - 1];
|
|
7887
|
-
delete parents[i - 1][parentKey];
|
|
7888
|
-
} else {
|
|
7889
|
-
break;
|
|
7890
|
-
}
|
|
8260
|
+
var PremountedPostmountedSequence = forwardRef3(PremountedPostmountedSequenceRefForwardingFunction);
|
|
8261
|
+
var SequenceRefForwardingFunction = (props, ref) => {
|
|
8262
|
+
const env = useRemotionEnvironment();
|
|
8263
|
+
const { fps } = useVideoConfig();
|
|
8264
|
+
if (props.layout !== "none" && !env.isRendering) {
|
|
8265
|
+
const effectivePremountFor = ENABLE_V5_BREAKING_CHANGES ? props.premountFor ?? fps : props.premountFor;
|
|
8266
|
+
if (effectivePremountFor || props.postmountFor) {
|
|
8267
|
+
return /* @__PURE__ */ jsx112(PremountedPostmountedSequence, {
|
|
8268
|
+
ref,
|
|
8269
|
+
...props,
|
|
8270
|
+
premountFor: effectivePremountFor
|
|
8271
|
+
});
|
|
7891
8272
|
}
|
|
7892
8273
|
}
|
|
7893
|
-
return
|
|
8274
|
+
return /* @__PURE__ */ jsx112(RegularSequence, {
|
|
8275
|
+
...props,
|
|
8276
|
+
ref
|
|
8277
|
+
});
|
|
7894
8278
|
};
|
|
7895
|
-
var
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
Object.assign(out, flattenActiveSchema(variant, resolve));
|
|
7907
|
-
}
|
|
7908
|
-
} else {
|
|
7909
|
-
out[key] = field;
|
|
7910
|
-
}
|
|
8279
|
+
var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
|
|
8280
|
+
var Sequence = wrapInSchema(SequenceInner, sequenceSchema);
|
|
8281
|
+
|
|
8282
|
+
class CanvasPool {
|
|
8283
|
+
width;
|
|
8284
|
+
height;
|
|
8285
|
+
pairs = new Map;
|
|
8286
|
+
lostContexts = new Set;
|
|
8287
|
+
constructor(width, height) {
|
|
8288
|
+
this.width = width;
|
|
8289
|
+
this.height = height;
|
|
7911
8290
|
}
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
const addKey = (key, field) => {
|
|
7917
|
-
if (key in out) {
|
|
7918
|
-
throw new Error(`Duplicate key "${key}" in schema: discriminated union variants must not share keys`);
|
|
7919
|
-
}
|
|
7920
|
-
out[key] = field;
|
|
7921
|
-
};
|
|
7922
|
-
for (const key of Object.keys(schema)) {
|
|
7923
|
-
const field = schema[key];
|
|
7924
|
-
addKey(key, field);
|
|
7925
|
-
if (field.type === "enum") {
|
|
7926
|
-
for (const variant of Object.values(field.variants)) {
|
|
7927
|
-
const flatVariant = getFlatSchemaWithAllKeys(variant);
|
|
7928
|
-
for (const variantKey of Object.keys(flatVariant)) {
|
|
7929
|
-
addKey(variantKey, flatVariant[variantKey]);
|
|
7930
|
-
}
|
|
7931
|
-
}
|
|
8291
|
+
getPair(backend) {
|
|
8292
|
+
const existing = this.pairs.get(backend);
|
|
8293
|
+
if (existing) {
|
|
8294
|
+
return existing;
|
|
7932
8295
|
}
|
|
8296
|
+
const pair = [
|
|
8297
|
+
this.allocateCanvas(backend),
|
|
8298
|
+
this.allocateCanvas(backend)
|
|
8299
|
+
];
|
|
8300
|
+
this.pairs.set(backend, pair);
|
|
8301
|
+
return pair;
|
|
7933
8302
|
}
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
overrideIdToNodePathMappings: {}
|
|
7938
|
-
});
|
|
7939
|
-
var OverrideIdsToNodePathsSettersContext = createContext15({
|
|
7940
|
-
setOverrideIdToNodePath: () => {
|
|
7941
|
-
throw new Error("OverrideIdsToNodePathsSettersContext not initialized");
|
|
7942
|
-
}
|
|
7943
|
-
});
|
|
7944
|
-
var findPropsToDelete = ({
|
|
7945
|
-
schema,
|
|
7946
|
-
key,
|
|
7947
|
-
value
|
|
7948
|
-
}) => {
|
|
7949
|
-
const fieldSchema = schema[key];
|
|
7950
|
-
if (!fieldSchema) {
|
|
7951
|
-
throw new Error("Key " + JSON.stringify(key) + " not found in schema");
|
|
7952
|
-
}
|
|
7953
|
-
if (typeof value !== "string") {
|
|
7954
|
-
throw new Error("Value must be a string, but is " + JSON.stringify(value));
|
|
7955
|
-
}
|
|
7956
|
-
if (fieldSchema.type !== "enum") {
|
|
7957
|
-
throw new Error("Key " + JSON.stringify(key) + " is not an enum");
|
|
7958
|
-
}
|
|
7959
|
-
const currentVariant = fieldSchema.variants[value];
|
|
7960
|
-
if (!currentVariant) {
|
|
7961
|
-
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));
|
|
7962
|
-
}
|
|
7963
|
-
const otherVariants = Object.keys(fieldSchema.variants).filter((v) => v !== value);
|
|
7964
|
-
const otherKeys = new Set;
|
|
7965
|
-
for (const variant of otherVariants) {
|
|
7966
|
-
const otherVariant = fieldSchema.variants[variant];
|
|
7967
|
-
const keys = Object.keys(otherVariant);
|
|
7968
|
-
for (const k of keys) {
|
|
7969
|
-
otherKeys.add(k);
|
|
8303
|
+
assertContextNotLost(canvas) {
|
|
8304
|
+
if (this.lostContexts.has(canvas)) {
|
|
8305
|
+
throw new Error("WebGL context was lost during canvas effect rendering. " + "This typically happens in headless or memory-constrained environments (e.g. Remotion Lambda). " + "Try reducing concurrency or increasing the Lambda function memory.");
|
|
7970
8306
|
}
|
|
7971
8307
|
}
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
})
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
}
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8308
|
+
allocateCanvas(backend) {
|
|
8309
|
+
const canvas = document.createElement("canvas");
|
|
8310
|
+
canvas.width = this.width;
|
|
8311
|
+
canvas.height = this.height;
|
|
8312
|
+
switch (backend) {
|
|
8313
|
+
case "2d": {
|
|
8314
|
+
const ctx = canvas.getContext("2d", {
|
|
8315
|
+
colorSpace: "srgb"
|
|
8316
|
+
});
|
|
8317
|
+
if (!ctx) {
|
|
8318
|
+
throw new Error("Failed to acquire 2D context for canvas effect");
|
|
8319
|
+
}
|
|
8320
|
+
return canvas;
|
|
8321
|
+
}
|
|
8322
|
+
case "webgl2": {
|
|
8323
|
+
const ctx = canvas.getContext("webgl2", {
|
|
8324
|
+
premultipliedAlpha: true,
|
|
8325
|
+
alpha: true,
|
|
8326
|
+
preserveDrawingBuffer: true
|
|
8327
|
+
});
|
|
8328
|
+
if (!ctx) {
|
|
8329
|
+
throw new Error("Failed to acquire WebGL2 context for canvas effect");
|
|
8330
|
+
}
|
|
8331
|
+
canvas.addEventListener("webglcontextlost", (e) => {
|
|
8332
|
+
e.preventDefault();
|
|
8333
|
+
this.lostContexts.add(canvas);
|
|
8334
|
+
});
|
|
8335
|
+
canvas.addEventListener("webglcontextrestored", () => {
|
|
8336
|
+
this.lostContexts.delete(canvas);
|
|
8337
|
+
});
|
|
8338
|
+
ctx.pixelStorei(ctx.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
|
|
8339
|
+
return canvas;
|
|
8340
|
+
}
|
|
8341
|
+
case "webgpu": {
|
|
8342
|
+
if (typeof navigator === "undefined" || !("gpu" in navigator)) {
|
|
8343
|
+
throw new Error("WebGPU is not available in this environment for canvas effect");
|
|
8344
|
+
}
|
|
8345
|
+
return canvas;
|
|
8346
|
+
}
|
|
8347
|
+
default: {
|
|
8348
|
+
const exhaustive = backend;
|
|
8349
|
+
throw new Error(`Unknown effect backend: ${exhaustive}`);
|
|
8007
8350
|
}
|
|
8008
8351
|
}
|
|
8009
8352
|
}
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
continue;
|
|
8025
|
-
}
|
|
8026
|
-
const value = getEffectiveVisualModeValue({
|
|
8027
|
-
codeValue: codeValueStatus,
|
|
8028
|
-
runtimeValue: currentValue[key],
|
|
8029
|
-
dragOverrideValue: overrideValues[key],
|
|
8030
|
-
defaultValue: field?.default,
|
|
8031
|
-
shouldResortToDefaultValueIfUndefined: false
|
|
8032
|
-
});
|
|
8033
|
-
if (value === undefined) {
|
|
8034
|
-
propsToDelete.add(key);
|
|
8353
|
+
}
|
|
8354
|
+
var groupByBackend = (effects) => {
|
|
8355
|
+
const runs = [];
|
|
8356
|
+
let current = [];
|
|
8357
|
+
let currentBackend = null;
|
|
8358
|
+
for (const eff of effects) {
|
|
8359
|
+
const { backend } = eff.definition;
|
|
8360
|
+
if (currentBackend === null || backend === currentBackend) {
|
|
8361
|
+
current.push(eff);
|
|
8362
|
+
currentBackend = backend;
|
|
8363
|
+
} else {
|
|
8364
|
+
runs.push({ backend: currentBackend, effects: current });
|
|
8365
|
+
current = [eff];
|
|
8366
|
+
currentBackend = backend;
|
|
8035
8367
|
}
|
|
8036
|
-
merged[key] = value;
|
|
8037
8368
|
}
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
const propsToDeleteForKey = findPropsToDelete({
|
|
8041
|
-
schema,
|
|
8042
|
-
key,
|
|
8043
|
-
value: merged[key]
|
|
8044
|
-
});
|
|
8045
|
-
for (const propToDelete of propsToDeleteForKey) {
|
|
8046
|
-
propsToDelete.add(propToDelete);
|
|
8047
|
-
}
|
|
8048
|
-
}
|
|
8369
|
+
if (currentBackend !== null && current.length > 0) {
|
|
8370
|
+
runs.push({ backend: currentBackend, effects: current });
|
|
8049
8371
|
}
|
|
8050
|
-
return
|
|
8372
|
+
return runs;
|
|
8051
8373
|
};
|
|
8052
|
-
var
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
if (current === null || current === undefined || typeof current !== "object")
|
|
8057
|
-
return;
|
|
8058
|
-
current = current[part];
|
|
8374
|
+
var devicePromise = null;
|
|
8375
|
+
var getGpuDevice = () => {
|
|
8376
|
+
if (devicePromise) {
|
|
8377
|
+
return devicePromise;
|
|
8059
8378
|
}
|
|
8060
|
-
|
|
8379
|
+
devicePromise = (async () => {
|
|
8380
|
+
if (typeof navigator === "undefined" || !("gpu" in navigator)) {
|
|
8381
|
+
throw new Error("WebGPU is not available in this environment");
|
|
8382
|
+
}
|
|
8383
|
+
const { gpu } = navigator;
|
|
8384
|
+
const adapter = await gpu.requestAdapter();
|
|
8385
|
+
if (!adapter) {
|
|
8386
|
+
throw new Error("No WebGPU adapter available");
|
|
8387
|
+
}
|
|
8388
|
+
return adapter.requestDevice();
|
|
8389
|
+
})();
|
|
8390
|
+
return devicePromise;
|
|
8061
8391
|
};
|
|
8062
|
-
var
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8392
|
+
var createEffectChainState = (width, height) => ({
|
|
8393
|
+
pool: new CanvasPool(width, height),
|
|
8394
|
+
setupCache: new WeakMap,
|
|
8395
|
+
cleanupRegistry: [],
|
|
8396
|
+
currentRunId: 0
|
|
8397
|
+
});
|
|
8398
|
+
var cleanupEffectChainState = (state) => {
|
|
8399
|
+
state.currentRunId++;
|
|
8400
|
+
for (const entry of state.cleanupRegistry) {
|
|
8401
|
+
entry.definition.cleanup(entry.state);
|
|
8066
8402
|
}
|
|
8067
|
-
return out;
|
|
8068
8403
|
};
|
|
8069
|
-
var
|
|
8070
|
-
|
|
8404
|
+
var ensureSetup = (state, def, target) => {
|
|
8405
|
+
const widened = def;
|
|
8406
|
+
if (state.setupCache.has(widened)) {
|
|
8407
|
+
return state.setupCache.get(widened);
|
|
8408
|
+
}
|
|
8409
|
+
const setupState = def.setup(target);
|
|
8410
|
+
state.setupCache.set(widened, setupState);
|
|
8411
|
+
state.cleanupRegistry.push({ definition: widened, state: setupState });
|
|
8412
|
+
return setupState;
|
|
8071
8413
|
};
|
|
8072
|
-
var
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8414
|
+
var runEffectChain = async ({
|
|
8415
|
+
state,
|
|
8416
|
+
source,
|
|
8417
|
+
effects,
|
|
8418
|
+
output,
|
|
8419
|
+
width,
|
|
8420
|
+
height
|
|
8077
8421
|
}) => {
|
|
8078
|
-
const
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8422
|
+
const runId = ++state.currentRunId;
|
|
8423
|
+
const isCancelled = () => state.currentRunId !== runId;
|
|
8424
|
+
const enabledEffects = effects.filter((e) => !e.params.disabled);
|
|
8425
|
+
const runs = groupByBackend(enabledEffects);
|
|
8426
|
+
let currentImage = source;
|
|
8427
|
+
let lastTarget = null;
|
|
8428
|
+
if (runs.length === 0) {
|
|
8429
|
+
if (source === output) {
|
|
8430
|
+
return true;
|
|
8085
8431
|
}
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
if (typeof current[part] === "object" && current[part] !== null) {
|
|
8090
|
-
current[part] = { ...current[part] };
|
|
8091
|
-
} else {
|
|
8092
|
-
current[part] = {};
|
|
8093
|
-
}
|
|
8094
|
-
current = current[part];
|
|
8432
|
+
const ctx = output.getContext("2d");
|
|
8433
|
+
if (!ctx) {
|
|
8434
|
+
throw new Error("Failed to acquire 2D context for output canvas");
|
|
8095
8435
|
}
|
|
8096
|
-
|
|
8436
|
+
ctx.clearRect(0, 0, width, height);
|
|
8437
|
+
ctx.drawImage(currentImage, 0, 0, width, height);
|
|
8438
|
+
return true;
|
|
8097
8439
|
}
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
const flatSchema = getFlatSchemaWithAllKeys(schema);
|
|
8104
|
-
const flatKeys = Object.keys(flatSchema);
|
|
8105
|
-
const Wrapped = forwardRef2((props, ref) => {
|
|
8106
|
-
const env = useRemotionEnvironment();
|
|
8107
|
-
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
|
|
8108
|
-
return React13.createElement(Component, {
|
|
8109
|
-
...props,
|
|
8110
|
-
_experimentalControls: null,
|
|
8111
|
-
ref
|
|
8112
|
-
});
|
|
8113
|
-
}
|
|
8114
|
-
const { getCodeValues } = useContext15(VisualModeCodeValuesContext);
|
|
8115
|
-
const { getDragOverrides } = useContext15(VisualModeDragOverridesContext);
|
|
8116
|
-
const nodePathMapping = useContext15(OverrideIdsToNodePathsGettersContext);
|
|
8117
|
-
if (props._experimentalControls) {
|
|
8118
|
-
return React13.createElement(Component, {
|
|
8119
|
-
...props,
|
|
8120
|
-
ref
|
|
8121
|
-
});
|
|
8440
|
+
let needsGpuDevice = false;
|
|
8441
|
+
for (const run of runs) {
|
|
8442
|
+
if (run.backend === "webgpu") {
|
|
8443
|
+
needsGpuDevice = true;
|
|
8444
|
+
break;
|
|
8122
8445
|
}
|
|
8123
|
-
const [overrideId] = useState5(() => {
|
|
8124
|
-
const { stack } = props;
|
|
8125
|
-
if (!stack) {
|
|
8126
|
-
return String(Math.random());
|
|
8127
|
-
}
|
|
8128
|
-
const existingOverrideId = stackToOverrideMap[stack];
|
|
8129
|
-
if (existingOverrideId) {
|
|
8130
|
-
return existingOverrideId;
|
|
8131
|
-
}
|
|
8132
|
-
const newOverrideId = String(Math.random());
|
|
8133
|
-
stackToOverrideMap[stack] = newOverrideId;
|
|
8134
|
-
return newOverrideId;
|
|
8135
|
-
});
|
|
8136
|
-
const nodePath = nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
|
|
8137
|
-
const runtimeValues = flatKeys.map((k) => getNestedValue(props, k));
|
|
8138
|
-
const currentRuntimeValueDotNotation = useMemo15(() => readValuesFromProps(props, flatKeys), runtimeValues);
|
|
8139
|
-
const controls = useMemo15(() => {
|
|
8140
|
-
return {
|
|
8141
|
-
schema,
|
|
8142
|
-
currentRuntimeValueDotNotation,
|
|
8143
|
-
overrideId
|
|
8144
|
-
};
|
|
8145
|
-
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
8146
|
-
const { merged: valuesDotNotation, propsToDelete } = useMemo15(() => {
|
|
8147
|
-
return computeEffectiveSchemaValuesDotNotation({
|
|
8148
|
-
schema,
|
|
8149
|
-
currentValue: currentRuntimeValueDotNotation,
|
|
8150
|
-
overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
|
|
8151
|
-
propStatus: nodePath === null ? undefined : getCodeValues(nodePath)
|
|
8152
|
-
});
|
|
8153
|
-
}, [
|
|
8154
|
-
currentRuntimeValueDotNotation,
|
|
8155
|
-
getDragOverrides,
|
|
8156
|
-
nodePath,
|
|
8157
|
-
getCodeValues
|
|
8158
|
-
]);
|
|
8159
|
-
const activeKeys = selectActiveKeys(schema, valuesDotNotation);
|
|
8160
|
-
const mergedProps = mergeValues({
|
|
8161
|
-
props,
|
|
8162
|
-
valuesDotNotation,
|
|
8163
|
-
schemaKeys: activeKeys,
|
|
8164
|
-
propsToDelete
|
|
8165
|
-
});
|
|
8166
|
-
return React13.createElement(Component, {
|
|
8167
|
-
...mergedProps,
|
|
8168
|
-
_experimentalControls: controls,
|
|
8169
|
-
ref
|
|
8170
|
-
});
|
|
8171
|
-
});
|
|
8172
|
-
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
8173
|
-
return Wrapped;
|
|
8174
|
-
};
|
|
8175
|
-
var RegularSequenceRefForwardingFunction = ({
|
|
8176
|
-
from = 0,
|
|
8177
|
-
durationInFrames = Infinity,
|
|
8178
|
-
children,
|
|
8179
|
-
name,
|
|
8180
|
-
height,
|
|
8181
|
-
width,
|
|
8182
|
-
showInTimeline = true,
|
|
8183
|
-
_experimentalControls: controls,
|
|
8184
|
-
_experimentalEffects,
|
|
8185
|
-
_remotionInternalLoopDisplay: loopDisplay,
|
|
8186
|
-
_remotionInternalStack: stack,
|
|
8187
|
-
_remotionInternalPremountDisplay: premountDisplay,
|
|
8188
|
-
_remotionInternalPostmountDisplay: postmountDisplay,
|
|
8189
|
-
_remotionInternalIsMedia: isMedia,
|
|
8190
|
-
...other
|
|
8191
|
-
}, ref) => {
|
|
8192
|
-
const { layout = "absolute-fill" } = other;
|
|
8193
|
-
const [id] = useState6(() => String(Math.random()));
|
|
8194
|
-
const parentSequence = useContext16(SequenceContext);
|
|
8195
|
-
const { rootId } = useTimelineContext();
|
|
8196
|
-
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
8197
|
-
const nonce = useNonce();
|
|
8198
|
-
if (layout !== "absolute-fill" && layout !== "none") {
|
|
8199
|
-
throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${layout}`);
|
|
8200
|
-
}
|
|
8201
|
-
if (layout === "none" && typeof other.style !== "undefined") {
|
|
8202
|
-
throw new TypeError('If layout="none", you may not pass a style. Passed: ' + JSON.stringify(other.style));
|
|
8203
8446
|
}
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
if (durationInFrames <= 0) {
|
|
8208
|
-
throw new TypeError(`durationInFrames must be positive, but got ${durationInFrames}`);
|
|
8447
|
+
const gpuDevice = needsGpuDevice ? await getGpuDevice() : null;
|
|
8448
|
+
if (isCancelled()) {
|
|
8449
|
+
return false;
|
|
8209
8450
|
}
|
|
8210
|
-
|
|
8211
|
-
|
|
8451
|
+
for (let runIndex = 0;runIndex < runs.length; runIndex++) {
|
|
8452
|
+
const run = runs[runIndex];
|
|
8453
|
+
const [a, b] = state.pool.getPair(run.backend);
|
|
8454
|
+
let dst = a;
|
|
8455
|
+
for (const eff of run.effects) {
|
|
8456
|
+
const def = eff.definition;
|
|
8457
|
+
const setupState = ensureSetup(state, def, dst);
|
|
8458
|
+
def.apply({
|
|
8459
|
+
source: currentImage,
|
|
8460
|
+
target: dst,
|
|
8461
|
+
state: setupState,
|
|
8462
|
+
params: eff.params,
|
|
8463
|
+
width,
|
|
8464
|
+
height,
|
|
8465
|
+
gpuDevice
|
|
8466
|
+
});
|
|
8467
|
+
if (run.backend === "webgl2") {
|
|
8468
|
+
state.pool.assertContextNotLost(dst);
|
|
8469
|
+
}
|
|
8470
|
+
currentImage = dst;
|
|
8471
|
+
dst = dst === a ? b : a;
|
|
8472
|
+
}
|
|
8473
|
+
lastTarget = currentImage ?? lastTarget;
|
|
8474
|
+
const nextRun = runs[runIndex + 1];
|
|
8475
|
+
if (nextRun && nextRun.backend !== run.backend && lastTarget) {
|
|
8476
|
+
const bitmap = await createImageBitmap(lastTarget);
|
|
8477
|
+
if (isCancelled()) {
|
|
8478
|
+
bitmap.close();
|
|
8479
|
+
return false;
|
|
8480
|
+
}
|
|
8481
|
+
currentImage = bitmap;
|
|
8482
|
+
}
|
|
8212
8483
|
}
|
|
8213
|
-
if (!
|
|
8214
|
-
|
|
8484
|
+
if (!lastTarget) {
|
|
8485
|
+
return true;
|
|
8215
8486
|
}
|
|
8216
|
-
const
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
const
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
durationInFrames: actualDurationInFrames,
|
|
8233
|
-
parentFrom: parentSequence?.relativeFrom ?? 0,
|
|
8234
|
-
id,
|
|
8235
|
-
height: height ?? parentSequence?.height ?? null,
|
|
8236
|
-
width: width ?? parentSequence?.width ?? null,
|
|
8237
|
-
premounting,
|
|
8238
|
-
postmounting,
|
|
8239
|
-
premountDisplay: premountDisplay ?? null,
|
|
8240
|
-
postmountDisplay: postmountDisplay ?? null
|
|
8487
|
+
const outCtx = output.getContext("2d");
|
|
8488
|
+
if (!outCtx) {
|
|
8489
|
+
throw new Error("Failed to acquire 2D context for output canvas");
|
|
8490
|
+
}
|
|
8491
|
+
outCtx.clearRect(0, 0, width, height);
|
|
8492
|
+
outCtx.drawImage(lastTarget, 0, 0, width, height);
|
|
8493
|
+
return true;
|
|
8494
|
+
};
|
|
8495
|
+
var useEffectChainState = () => {
|
|
8496
|
+
const chainStateRef = useRef6(null);
|
|
8497
|
+
const sizeRef = useRef6(null);
|
|
8498
|
+
useEffect4(() => {
|
|
8499
|
+
return () => {
|
|
8500
|
+
if (chainStateRef.current) {
|
|
8501
|
+
cleanupEffectChainState(chainStateRef.current);
|
|
8502
|
+
}
|
|
8241
8503
|
};
|
|
8242
|
-
}, [
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
]);
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8504
|
+
}, []);
|
|
8505
|
+
return useMemo15(() => ({
|
|
8506
|
+
get: (width, height) => {
|
|
8507
|
+
if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
|
|
8508
|
+
if (chainStateRef.current) {
|
|
8509
|
+
cleanupEffectChainState(chainStateRef.current);
|
|
8510
|
+
}
|
|
8511
|
+
chainStateRef.current = createEffectChainState(width, height);
|
|
8512
|
+
sizeRef.current = { width, height };
|
|
8513
|
+
}
|
|
8514
|
+
return chainStateRef.current;
|
|
8515
|
+
}
|
|
8516
|
+
}), []);
|
|
8517
|
+
};
|
|
8518
|
+
var solidSchema = {
|
|
8519
|
+
color: {
|
|
8520
|
+
type: "color",
|
|
8521
|
+
default: "#ffffff",
|
|
8522
|
+
description: "Color"
|
|
8523
|
+
},
|
|
8524
|
+
width: {
|
|
8525
|
+
type: "number",
|
|
8526
|
+
min: 1,
|
|
8527
|
+
step: 1,
|
|
8528
|
+
default: 1920,
|
|
8529
|
+
description: "Width"
|
|
8530
|
+
},
|
|
8531
|
+
height: {
|
|
8532
|
+
type: "number",
|
|
8533
|
+
min: 1,
|
|
8534
|
+
step: 1,
|
|
8535
|
+
default: 1080,
|
|
8536
|
+
description: "Height"
|
|
8537
|
+
},
|
|
8538
|
+
...sequenceStyleSchema
|
|
8539
|
+
};
|
|
8540
|
+
var SolidInner = ({
|
|
8541
|
+
color,
|
|
8542
|
+
width,
|
|
8543
|
+
height,
|
|
8544
|
+
_experimentalEffects: experimentalEffects = [],
|
|
8545
|
+
className,
|
|
8546
|
+
style,
|
|
8547
|
+
overrideId,
|
|
8548
|
+
ref
|
|
8549
|
+
}) => {
|
|
8550
|
+
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
8551
|
+
const [outputCanvas, setOutputCanvas] = useState6(null);
|
|
8552
|
+
const memoizedEffects = useMemoizedEffects({
|
|
8553
|
+
effects: experimentalEffects,
|
|
8554
|
+
overrideId: overrideId ?? null
|
|
8555
|
+
});
|
|
8556
|
+
const sourceCanvas = useMemo16(() => {
|
|
8557
|
+
if (typeof document === "undefined") {
|
|
8558
|
+
return null;
|
|
8559
|
+
}
|
|
8560
|
+
const canvas = document.createElement("canvas");
|
|
8561
|
+
canvas.width = 1;
|
|
8562
|
+
canvas.height = 1;
|
|
8563
|
+
return canvas;
|
|
8564
|
+
}, []);
|
|
8565
|
+
const chainState = useEffectChainState();
|
|
8566
|
+
const canvasRef = useCallback6((canvas) => {
|
|
8567
|
+
setOutputCanvas(canvas);
|
|
8568
|
+
if (typeof ref === "function") {
|
|
8569
|
+
ref(canvas);
|
|
8570
|
+
} else if (ref) {
|
|
8571
|
+
ref.current = canvas;
|
|
8572
|
+
}
|
|
8573
|
+
}, [ref]);
|
|
8260
8574
|
useEffect5(() => {
|
|
8261
|
-
if (!
|
|
8575
|
+
if (!outputCanvas || !sourceCanvas) {
|
|
8262
8576
|
return;
|
|
8263
8577
|
}
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
controls: controls ?? null,
|
|
8268
|
-
effects: _experimentalEffects ?? [],
|
|
8269
|
-
displayName: timelineClipName,
|
|
8270
|
-
doesVolumeChange: isMedia.data.doesVolumeChange,
|
|
8271
|
-
duration: actualDurationInFrames,
|
|
8272
|
-
from,
|
|
8273
|
-
id,
|
|
8274
|
-
loopDisplay,
|
|
8275
|
-
nonce: nonce.get(),
|
|
8276
|
-
parent: parentSequence?.id ?? null,
|
|
8277
|
-
playbackRate: isMedia.data.playbackRate,
|
|
8278
|
-
postmountDisplay: postmountDisplay ?? null,
|
|
8279
|
-
premountDisplay: premountDisplay ?? null,
|
|
8280
|
-
rootId,
|
|
8281
|
-
showInTimeline,
|
|
8282
|
-
src: isMedia.data.src,
|
|
8283
|
-
stack: stack ?? inheritedStack,
|
|
8284
|
-
startMediaFrom: isMedia.data.startMediaFrom,
|
|
8285
|
-
volume: isMedia.data.volumes
|
|
8286
|
-
});
|
|
8578
|
+
const handle = delayRender2("Solid effect chain");
|
|
8579
|
+
if (!chainState) {
|
|
8580
|
+
continueRender2(handle);
|
|
8287
8581
|
return () => {
|
|
8288
|
-
|
|
8582
|
+
continueRender2(handle);
|
|
8289
8583
|
};
|
|
8290
8584
|
}
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8585
|
+
const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
|
|
8586
|
+
if (!ctx) {
|
|
8587
|
+
cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
|
|
8588
|
+
return;
|
|
8589
|
+
}
|
|
8590
|
+
ctx.fillStyle = color;
|
|
8591
|
+
ctx.fillRect(0, 0, 1, 1);
|
|
8592
|
+
runEffectChain({
|
|
8593
|
+
state: chainState.get(width, height),
|
|
8594
|
+
source: sourceCanvas,
|
|
8595
|
+
effects: memoizedEffects,
|
|
8596
|
+
output: outputCanvas,
|
|
8597
|
+
width,
|
|
8598
|
+
height
|
|
8599
|
+
}).then((completed) => {
|
|
8600
|
+
if (completed) {
|
|
8601
|
+
continueRender2(handle);
|
|
8602
|
+
}
|
|
8603
|
+
}).catch((err) => {
|
|
8604
|
+
cancelRender2(err);
|
|
8307
8605
|
});
|
|
8308
8606
|
return () => {
|
|
8309
|
-
|
|
8310
|
-
};
|
|
8311
|
-
}, [
|
|
8312
|
-
durationInFrames,
|
|
8313
|
-
id,
|
|
8314
|
-
name,
|
|
8315
|
-
registerSequence,
|
|
8316
|
-
timelineClipName,
|
|
8317
|
-
unregisterSequence,
|
|
8318
|
-
parentSequence?.id,
|
|
8319
|
-
actualDurationInFrames,
|
|
8320
|
-
rootId,
|
|
8321
|
-
from,
|
|
8322
|
-
showInTimeline,
|
|
8323
|
-
nonce,
|
|
8324
|
-
loopDisplay,
|
|
8325
|
-
stack,
|
|
8326
|
-
premountDisplay,
|
|
8327
|
-
postmountDisplay,
|
|
8328
|
-
env.isStudio,
|
|
8329
|
-
inheritedStack,
|
|
8330
|
-
controls,
|
|
8331
|
-
_experimentalEffects,
|
|
8332
|
-
isMedia
|
|
8333
|
-
]);
|
|
8334
|
-
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
8335
|
-
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
8336
|
-
const styleIfThere = other.layout === "none" ? undefined : other.style;
|
|
8337
|
-
const defaultStyle = useMemo16(() => {
|
|
8338
|
-
return {
|
|
8339
|
-
flexDirection: undefined,
|
|
8340
|
-
...width ? { width } : {},
|
|
8341
|
-
...height ? { height } : {},
|
|
8342
|
-
...styleIfThere ?? {}
|
|
8343
|
-
};
|
|
8344
|
-
}, [height, styleIfThere, width]);
|
|
8345
|
-
if (ref !== null && layout === "none") {
|
|
8346
|
-
throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');
|
|
8347
|
-
}
|
|
8348
|
-
const isSequenceHidden = hidden[id] ?? false;
|
|
8349
|
-
if (isSequenceHidden) {
|
|
8350
|
-
return null;
|
|
8351
|
-
}
|
|
8352
|
-
return /* @__PURE__ */ jsx12(SequenceContext.Provider, {
|
|
8353
|
-
value: contextValue,
|
|
8354
|
-
children: content === null ? null : other.layout === "none" ? content : /* @__PURE__ */ jsx12(AbsoluteFill, {
|
|
8355
|
-
ref,
|
|
8356
|
-
style: defaultStyle,
|
|
8357
|
-
className: other.className,
|
|
8358
|
-
children: content
|
|
8359
|
-
})
|
|
8360
|
-
});
|
|
8361
|
-
};
|
|
8362
|
-
var RegularSequence = forwardRef3(RegularSequenceRefForwardingFunction);
|
|
8363
|
-
var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
8364
|
-
const parentPremountContext = useContext16(PremountContext);
|
|
8365
|
-
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
8366
|
-
if (props.layout === "none") {
|
|
8367
|
-
throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
|
|
8368
|
-
}
|
|
8369
|
-
const {
|
|
8370
|
-
style: passedStyle,
|
|
8371
|
-
from = 0,
|
|
8372
|
-
durationInFrames = Infinity,
|
|
8373
|
-
premountFor = 0,
|
|
8374
|
-
postmountFor = 0,
|
|
8375
|
-
styleWhilePremounted,
|
|
8376
|
-
styleWhilePostmounted,
|
|
8377
|
-
...otherProps
|
|
8378
|
-
} = props;
|
|
8379
|
-
const endThreshold = Math.ceil(from + durationInFrames - 1);
|
|
8380
|
-
const premountingActive = frame < from && frame >= from - premountFor;
|
|
8381
|
-
const postmountingActive = frame > endThreshold && frame <= endThreshold + postmountFor;
|
|
8382
|
-
const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
|
|
8383
|
-
const isFreezingActive = premountingActive || postmountingActive;
|
|
8384
|
-
const style = useMemo16(() => {
|
|
8385
|
-
return {
|
|
8386
|
-
...passedStyle,
|
|
8387
|
-
opacity: premountingActive || postmountingActive ? 0 : 1,
|
|
8388
|
-
pointerEvents: premountingActive || postmountingActive ? "none" : passedStyle?.pointerEvents ?? undefined,
|
|
8389
|
-
...premountingActive ? styleWhilePremounted : {},
|
|
8390
|
-
...postmountingActive ? styleWhilePostmounted : {}
|
|
8607
|
+
continueRender2(handle);
|
|
8391
8608
|
};
|
|
8392
8609
|
}, [
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8610
|
+
color,
|
|
8611
|
+
outputCanvas,
|
|
8612
|
+
sourceCanvas,
|
|
8613
|
+
chainState,
|
|
8614
|
+
width,
|
|
8615
|
+
height,
|
|
8616
|
+
delayRender2,
|
|
8617
|
+
continueRender2,
|
|
8618
|
+
cancelRender2,
|
|
8619
|
+
memoizedEffects
|
|
8398
8620
|
]);
|
|
8399
|
-
return /* @__PURE__ */ jsx12(
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8621
|
+
return /* @__PURE__ */ jsx12("canvas", {
|
|
8622
|
+
ref: canvasRef,
|
|
8623
|
+
width,
|
|
8624
|
+
height,
|
|
8625
|
+
className,
|
|
8626
|
+
style
|
|
8627
|
+
});
|
|
8628
|
+
};
|
|
8629
|
+
var SolidOuter = forwardRef4(({
|
|
8630
|
+
_experimentalEffects = [],
|
|
8631
|
+
_experimentalControls: controls,
|
|
8632
|
+
color,
|
|
8633
|
+
height,
|
|
8634
|
+
width,
|
|
8635
|
+
className,
|
|
8636
|
+
durationInFrames,
|
|
8637
|
+
style,
|
|
8638
|
+
name,
|
|
8639
|
+
from,
|
|
8640
|
+
hidden,
|
|
8641
|
+
showInTimeline,
|
|
8642
|
+
...props
|
|
8643
|
+
}, ref) => {
|
|
8644
|
+
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
|
|
8645
|
+
return /* @__PURE__ */ jsx12(Sequence, {
|
|
8646
|
+
layout: "none",
|
|
8647
|
+
from,
|
|
8648
|
+
hidden,
|
|
8649
|
+
showInTimeline,
|
|
8650
|
+
_experimentalControls: controls,
|
|
8651
|
+
_experimentalEffects: memoizedEffectDefinitions,
|
|
8652
|
+
durationInFrames,
|
|
8653
|
+
name: name ?? "<Solid>",
|
|
8654
|
+
...props,
|
|
8655
|
+
children: /* @__PURE__ */ jsx12(SolidInner, {
|
|
8403
8656
|
ref,
|
|
8404
|
-
|
|
8405
|
-
|
|
8657
|
+
overrideId: controls?.overrideId ?? null,
|
|
8658
|
+
color,
|
|
8659
|
+
height,
|
|
8660
|
+
width,
|
|
8661
|
+
className,
|
|
8406
8662
|
style,
|
|
8407
|
-
|
|
8408
|
-
_remotionInternalPostmountDisplay: postmountFor,
|
|
8409
|
-
_remotionInternalIsPremounting: premountingActive,
|
|
8410
|
-
_remotionInternalIsPostmounting: postmountingActive,
|
|
8411
|
-
...otherProps
|
|
8663
|
+
_experimentalEffects
|
|
8412
8664
|
})
|
|
8413
8665
|
});
|
|
8414
|
-
};
|
|
8415
|
-
var
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8666
|
+
});
|
|
8667
|
+
var Solid = wrapInSchema(SolidOuter, solidSchema);
|
|
8668
|
+
Solid.displayName = "Solid";
|
|
8669
|
+
addSequenceStackTraces(Solid);
|
|
8670
|
+
var VERSION = "4.0.463";
|
|
8671
|
+
var checkMultipleRemotionVersions = () => {
|
|
8672
|
+
if (typeof globalThis === "undefined") {
|
|
8673
|
+
return;
|
|
8674
|
+
}
|
|
8675
|
+
const set = () => {
|
|
8676
|
+
globalThis.remotion_imported = VERSION;
|
|
8677
|
+
if (typeof window !== "undefined") {
|
|
8678
|
+
window.remotion_imported = VERSION;
|
|
8679
|
+
}
|
|
8680
|
+
};
|
|
8681
|
+
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
8682
|
+
if (alreadyImported) {
|
|
8683
|
+
if (alreadyImported === VERSION) {
|
|
8684
|
+
return;
|
|
8685
|
+
}
|
|
8686
|
+
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
8687
|
+
set();
|
|
8688
|
+
return;
|
|
8427
8689
|
}
|
|
8690
|
+
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
8691
|
+
VERSION,
|
|
8692
|
+
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
8693
|
+
].filter(truthy2).join(" and ")}. This will cause things to break in an unexpected way.
|
|
8694
|
+
Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
|
|
8428
8695
|
}
|
|
8429
|
-
|
|
8430
|
-
...props,
|
|
8431
|
-
ref
|
|
8432
|
-
});
|
|
8696
|
+
set();
|
|
8433
8697
|
};
|
|
8434
|
-
var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
|
|
8435
|
-
var Sequence = wrapInSchema(SequenceInner, sequenceSchema);
|
|
8436
8698
|
var calcArgs = (fit, frameSize, canvasSize) => {
|
|
8437
8699
|
switch (fit) {
|
|
8438
8700
|
case "fill": {
|
|
@@ -8483,7 +8745,7 @@ var calcArgs = (fit, frameSize, canvasSize) => {
|
|
|
8483
8745
|
};
|
|
8484
8746
|
var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
|
|
8485
8747
|
const canvasRef = useRef7(null);
|
|
8486
|
-
const draw =
|
|
8748
|
+
const draw = useCallback7((imageData) => {
|
|
8487
8749
|
const canvas = canvasRef.current;
|
|
8488
8750
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
8489
8751
|
const canvasHeight = height ?? imageData.displayHeight;
|
|
@@ -8675,7 +8937,19 @@ var resolveAnimatedImageSource = (src) => {
|
|
|
8675
8937
|
}
|
|
8676
8938
|
return new URL(src, window.origin).href;
|
|
8677
8939
|
};
|
|
8678
|
-
var
|
|
8940
|
+
var animatedImageSchema = {
|
|
8941
|
+
playbackRate: {
|
|
8942
|
+
type: "number",
|
|
8943
|
+
min: 0,
|
|
8944
|
+
max: 10,
|
|
8945
|
+
step: 0.1,
|
|
8946
|
+
default: 1,
|
|
8947
|
+
description: "Playback Rate"
|
|
8948
|
+
},
|
|
8949
|
+
...sequenceStyleSchema,
|
|
8950
|
+
hidden: hiddenField
|
|
8951
|
+
};
|
|
8952
|
+
var AnimatedImageContent = forwardRef5(({
|
|
8679
8953
|
src,
|
|
8680
8954
|
width,
|
|
8681
8955
|
height,
|
|
@@ -8782,6 +9056,52 @@ var AnimatedImage = forwardRef4(({
|
|
|
8782
9056
|
...props
|
|
8783
9057
|
});
|
|
8784
9058
|
});
|
|
9059
|
+
AnimatedImageContent.displayName = "AnimatedImageContent";
|
|
9060
|
+
var AnimatedImageInner = ({
|
|
9061
|
+
src,
|
|
9062
|
+
width,
|
|
9063
|
+
height,
|
|
9064
|
+
onError,
|
|
9065
|
+
fit,
|
|
9066
|
+
playbackRate,
|
|
9067
|
+
loopBehavior,
|
|
9068
|
+
id,
|
|
9069
|
+
className,
|
|
9070
|
+
style,
|
|
9071
|
+
durationInFrames,
|
|
9072
|
+
_experimentalControls: controls,
|
|
9073
|
+
ref,
|
|
9074
|
+
...sequenceProps
|
|
9075
|
+
}) => {
|
|
9076
|
+
const { durationInFrames: videoDuration } = useVideoConfig();
|
|
9077
|
+
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
9078
|
+
const animatedImageProps = {
|
|
9079
|
+
src,
|
|
9080
|
+
width,
|
|
9081
|
+
height,
|
|
9082
|
+
onError,
|
|
9083
|
+
fit,
|
|
9084
|
+
playbackRate,
|
|
9085
|
+
loopBehavior,
|
|
9086
|
+
id,
|
|
9087
|
+
className,
|
|
9088
|
+
style
|
|
9089
|
+
};
|
|
9090
|
+
return /* @__PURE__ */ jsx14(Sequence, {
|
|
9091
|
+
layout: "none",
|
|
9092
|
+
durationInFrames: resolvedDuration,
|
|
9093
|
+
name: "<AnimatedImage>",
|
|
9094
|
+
_experimentalControls: controls,
|
|
9095
|
+
...sequenceProps,
|
|
9096
|
+
children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
|
|
9097
|
+
...animatedImageProps,
|
|
9098
|
+
ref
|
|
9099
|
+
})
|
|
9100
|
+
});
|
|
9101
|
+
};
|
|
9102
|
+
var AnimatedImage = wrapInSchema(AnimatedImageInner, animatedImageSchema);
|
|
9103
|
+
AnimatedImage.displayName = "AnimatedImage";
|
|
9104
|
+
addSequenceStackTraces(AnimatedImage);
|
|
8785
9105
|
var cachedSupport = null;
|
|
8786
9106
|
var isHtmlInCanvasSupported = () => {
|
|
8787
9107
|
if (cachedSupport !== null) {
|
|
@@ -8795,6 +9115,7 @@ var isHtmlInCanvasSupported = () => {
|
|
|
8795
9115
|
cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function";
|
|
8796
9116
|
return cachedSupport;
|
|
8797
9117
|
};
|
|
9118
|
+
var HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";
|
|
8798
9119
|
function assertHtmlInCanvasDimensions(width, height) {
|
|
8799
9120
|
if (typeof width !== "number" || typeof height !== "number") {
|
|
8800
9121
|
throw new Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(width)}, height=${String(height)}.`);
|
|
@@ -8820,30 +9141,16 @@ var defaultOnPaint = ({
|
|
|
8820
9141
|
element.style.transform = transform.toString();
|
|
8821
9142
|
};
|
|
8822
9143
|
var HtmlInCanvasAncestorContext = createContext16(false);
|
|
8823
|
-
var
|
|
8824
|
-
|
|
8825
|
-
height,
|
|
8826
|
-
_experimentalEffects: effects = [],
|
|
8827
|
-
children,
|
|
8828
|
-
onPaint,
|
|
8829
|
-
onInit,
|
|
8830
|
-
_experimentalControls: controls,
|
|
8831
|
-
style,
|
|
8832
|
-
durationInFrames,
|
|
8833
|
-
...sequenceProps
|
|
8834
|
-
}, ref) => {
|
|
8835
|
-
const isInsideAncestorHtmlInCanvas = useContext17(HtmlInCanvasAncestorContext);
|
|
9144
|
+
var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPaint, onInit, controls, style }, ref) => {
|
|
9145
|
+
const isInsideAncestorHtmlInCanvas = useContext18(HtmlInCanvasAncestorContext);
|
|
8836
9146
|
assertHtmlInCanvasDimensions(width, height);
|
|
8837
9147
|
const { continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
8838
9148
|
if (!isHtmlInCanvasSupported()) {
|
|
8839
|
-
cancelRender2(new Error(
|
|
9149
|
+
cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
|
|
8840
9150
|
}
|
|
8841
|
-
const { durationInFrames: videoDuration } = useVideoConfig();
|
|
8842
|
-
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
8843
|
-
const frame = useCurrentFrame();
|
|
8844
9151
|
const canvas2dRef = useRef9(null);
|
|
8845
9152
|
const divRef = useRef9(null);
|
|
8846
|
-
const setLayoutCanvasRef =
|
|
9153
|
+
const setLayoutCanvasRef = useCallback8((node) => {
|
|
8847
9154
|
canvas2dRef.current = node;
|
|
8848
9155
|
if (typeof ref === "function") {
|
|
8849
9156
|
ref(node);
|
|
@@ -8853,11 +9160,12 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
8853
9160
|
}, [ref]);
|
|
8854
9161
|
const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
|
|
8855
9162
|
const chainState = useEffectChainState();
|
|
8856
|
-
const memoizedEffects = useMemoizedEffects(
|
|
9163
|
+
const memoizedEffects = useMemoizedEffects({
|
|
9164
|
+
effects,
|
|
9165
|
+
overrideId: controls?.overrideId ?? null
|
|
9166
|
+
});
|
|
8857
9167
|
const effectsRef = useRef9(memoizedEffects);
|
|
8858
9168
|
effectsRef.current = memoizedEffects;
|
|
8859
|
-
const frameRef = useRef9(frame);
|
|
8860
|
-
frameRef.current = frame;
|
|
8861
9169
|
const onPaintRef = useRef9(onPaint);
|
|
8862
9170
|
onPaintRef.current = onPaint;
|
|
8863
9171
|
const onInitRef = useRef9(onInit);
|
|
@@ -8865,7 +9173,7 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
8865
9173
|
const initializedRef = useRef9(false);
|
|
8866
9174
|
const onInitCleanupRef = useRef9(null);
|
|
8867
9175
|
const unmountedRef = useRef9(false);
|
|
8868
|
-
const onPaintCb =
|
|
9176
|
+
const onPaintCb = useCallback8(async () => {
|
|
8869
9177
|
const element = divRef.current;
|
|
8870
9178
|
if (!element) {
|
|
8871
9179
|
throw new Error("Canvas or scene element not found");
|
|
@@ -8914,7 +9222,6 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
8914
9222
|
source: offscreenCanvas,
|
|
8915
9223
|
effects: effectsRef.current,
|
|
8916
9224
|
output: canvas2dRef.current,
|
|
8917
|
-
frame: frameRef.current,
|
|
8918
9225
|
width,
|
|
8919
9226
|
height
|
|
8920
9227
|
});
|
|
@@ -8978,31 +9285,64 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
8978
9285
|
if (isInsideAncestorHtmlInCanvas) {
|
|
8979
9286
|
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.");
|
|
8980
9287
|
}
|
|
9288
|
+
return /* @__PURE__ */ jsx15(HtmlInCanvasAncestorContext.Provider, {
|
|
9289
|
+
value: true,
|
|
9290
|
+
children: /* @__PURE__ */ jsx15("canvas", {
|
|
9291
|
+
ref: setLayoutCanvasRef,
|
|
9292
|
+
width,
|
|
9293
|
+
height,
|
|
9294
|
+
style,
|
|
9295
|
+
children: /* @__PURE__ */ jsx15("div", {
|
|
9296
|
+
ref: divRef,
|
|
9297
|
+
style: innerStyle,
|
|
9298
|
+
children
|
|
9299
|
+
})
|
|
9300
|
+
})
|
|
9301
|
+
});
|
|
9302
|
+
});
|
|
9303
|
+
HtmlInCanvasContent.displayName = "HtmlInCanvasContent";
|
|
9304
|
+
var HtmlInCanvasInner = forwardRef6(({
|
|
9305
|
+
width,
|
|
9306
|
+
height,
|
|
9307
|
+
_experimentalEffects: effects = [],
|
|
9308
|
+
children,
|
|
9309
|
+
onPaint,
|
|
9310
|
+
onInit,
|
|
9311
|
+
_experimentalControls: controls,
|
|
9312
|
+
style,
|
|
9313
|
+
durationInFrames,
|
|
9314
|
+
name,
|
|
9315
|
+
...sequenceProps
|
|
9316
|
+
}, ref) => {
|
|
9317
|
+
const { durationInFrames: videoDuration } = useVideoConfig();
|
|
9318
|
+
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
9319
|
+
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
8981
9320
|
return /* @__PURE__ */ jsx15(Sequence, {
|
|
8982
9321
|
durationInFrames: resolvedDuration,
|
|
8983
|
-
name: "<HtmlInCanvas>",
|
|
9322
|
+
name: name ?? "<HtmlInCanvas>",
|
|
8984
9323
|
_experimentalControls: controls,
|
|
8985
|
-
_experimentalEffects:
|
|
9324
|
+
_experimentalEffects: memoizedEffectDefinitions,
|
|
8986
9325
|
layout: "none",
|
|
8987
9326
|
...sequenceProps,
|
|
8988
|
-
children: /* @__PURE__ */ jsx15(
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
children
|
|
8999
|
-
})
|
|
9000
|
-
})
|
|
9327
|
+
children: /* @__PURE__ */ jsx15(HtmlInCanvasContent, {
|
|
9328
|
+
ref,
|
|
9329
|
+
width,
|
|
9330
|
+
height,
|
|
9331
|
+
effects,
|
|
9332
|
+
onPaint,
|
|
9333
|
+
onInit,
|
|
9334
|
+
controls,
|
|
9335
|
+
style,
|
|
9336
|
+
children
|
|
9001
9337
|
})
|
|
9002
9338
|
});
|
|
9003
9339
|
});
|
|
9004
9340
|
HtmlInCanvasInner.displayName = "HtmlInCanvas";
|
|
9005
|
-
var
|
|
9341
|
+
var htmlInCanvasSchema = {
|
|
9342
|
+
...sequenceStyleSchema,
|
|
9343
|
+
hidden: hiddenField
|
|
9344
|
+
};
|
|
9345
|
+
var HtmlInCanvasWrapped = wrapInSchema(HtmlInCanvasInner, htmlInCanvasSchema);
|
|
9006
9346
|
var HtmlInCanvas = Object.assign(HtmlInCanvasWrapped, {
|
|
9007
9347
|
isSupported: isHtmlInCanvasSupported
|
|
9008
9348
|
});
|
|
@@ -9049,7 +9389,7 @@ var RenderAssetManager = createContext17({
|
|
|
9049
9389
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
9050
9390
|
const [renderAssets, setRenderAssets] = useState9([]);
|
|
9051
9391
|
const renderAssetsRef = useRef10([]);
|
|
9052
|
-
const registerRenderAsset =
|
|
9392
|
+
const registerRenderAsset = useCallback9((renderAsset) => {
|
|
9053
9393
|
validateRenderAsset(renderAsset);
|
|
9054
9394
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
9055
9395
|
setRenderAssets(renderAssetsRef.current);
|
|
@@ -9066,7 +9406,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
9066
9406
|
};
|
|
9067
9407
|
}, []);
|
|
9068
9408
|
}
|
|
9069
|
-
const unregisterRenderAsset =
|
|
9409
|
+
const unregisterRenderAsset = useCallback9((id) => {
|
|
9070
9410
|
renderAssetsRef.current = renderAssetsRef.current.filter((a) => a.id !== id);
|
|
9071
9411
|
setRenderAssets(renderAssetsRef.current);
|
|
9072
9412
|
}, []);
|
|
@@ -9094,7 +9434,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
9094
9434
|
};
|
|
9095
9435
|
var ArtifactThumbnail = Symbol("Thumbnail");
|
|
9096
9436
|
var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
9097
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
9437
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext19(RenderAssetManager);
|
|
9098
9438
|
const env = useRemotionEnvironment();
|
|
9099
9439
|
const frame = useCurrentFrame();
|
|
9100
9440
|
const [id] = useState10(() => {
|
|
@@ -9284,7 +9624,7 @@ var getSrcWithoutHash = (src) => {
|
|
|
9284
9624
|
return src.slice(0, hashIndex);
|
|
9285
9625
|
};
|
|
9286
9626
|
var usePreload = (src) => {
|
|
9287
|
-
const preloads2 =
|
|
9627
|
+
const preloads2 = useContext20(PreloadContext);
|
|
9288
9628
|
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
9289
9629
|
const withoutHashFragment = getSrcWithoutHash(src);
|
|
9290
9630
|
if (!preloads2[withoutHashFragment]) {
|
|
@@ -9466,6 +9806,9 @@ var validateMediaProps = (props, component) => {
|
|
|
9466
9806
|
if (typeof props.playbackRate === "number" && (isNaN(props.playbackRate) || !Number.isFinite(props.playbackRate) || props.playbackRate <= 0)) {
|
|
9467
9807
|
throw new TypeError(`You have passed a playbackRate of ${props.playbackRate} to your <${component} /> component. Playback rate must be a real number above 0.`);
|
|
9468
9808
|
}
|
|
9809
|
+
if (typeof props.preservePitch !== "boolean" && typeof props.preservePitch !== "undefined") {
|
|
9810
|
+
throw new TypeError(`'preservePitch' must be a boolean or undefined but got '${typeof props.preservePitch}' instead`);
|
|
9811
|
+
}
|
|
9469
9812
|
};
|
|
9470
9813
|
var validateStartFromProps = (startFrom, endAt) => {
|
|
9471
9814
|
if (typeof startFrom !== "undefined") {
|
|
@@ -9811,7 +10154,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9811
10154
|
}, []);
|
|
9812
10155
|
const prevEndTimes = useRef11({ scheduledEndTime: null, mediaEndTime: null });
|
|
9813
10156
|
const nodesToResume = useRef11(new Map);
|
|
9814
|
-
const unscheduleAudioNode =
|
|
10157
|
+
const unscheduleAudioNode = useCallback10((node) => {
|
|
9815
10158
|
nodesToResume.current.delete(node);
|
|
9816
10159
|
}, []);
|
|
9817
10160
|
const scheduleAudioNode = useMemo22(() => {
|
|
@@ -9859,7 +10202,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9859
10202
|
};
|
|
9860
10203
|
};
|
|
9861
10204
|
}, [ctxAndGain, logLevel]);
|
|
9862
|
-
const resume =
|
|
10205
|
+
const resume = useCallback10(() => {
|
|
9863
10206
|
if (!ctxAndGain) {
|
|
9864
10207
|
return Promise.resolve();
|
|
9865
10208
|
}
|
|
@@ -9886,10 +10229,10 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9886
10229
|
});
|
|
9887
10230
|
return resumePromise.catch(() => {});
|
|
9888
10231
|
}, [ctxAndGain, logLevel]);
|
|
9889
|
-
const getIsResumingAudioContext =
|
|
10232
|
+
const getIsResumingAudioContext = useCallback10(() => {
|
|
9890
10233
|
return isResuming.current;
|
|
9891
10234
|
}, []);
|
|
9892
|
-
const suspend =
|
|
10235
|
+
const suspend = useCallback10(() => {
|
|
9893
10236
|
if (!ctxAndGain) {
|
|
9894
10237
|
return;
|
|
9895
10238
|
}
|
|
@@ -9935,7 +10278,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
9935
10278
|
const logLevel = useLogLevel();
|
|
9936
10279
|
const mountTime = useMountTime();
|
|
9937
10280
|
const env = useRemotionEnvironment();
|
|
9938
|
-
const audioCtx =
|
|
10281
|
+
const audioCtx = useContext21(SharedAudioContext);
|
|
9939
10282
|
const audioContext = audioCtx?.audioContext ?? null;
|
|
9940
10283
|
const resume = audioCtx?.resume;
|
|
9941
10284
|
const refs = useMemo22(() => {
|
|
@@ -9962,7 +10305,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
9962
10305
|
};
|
|
9963
10306
|
}, [refs]);
|
|
9964
10307
|
const takenAudios = useRef11(new Array(numberOfAudioTags).fill(false));
|
|
9965
|
-
const rerenderAudios =
|
|
10308
|
+
const rerenderAudios = useCallback10(() => {
|
|
9966
10309
|
refs.forEach(({ ref, id }) => {
|
|
9967
10310
|
const data = audios.current?.find((a) => a.id === id);
|
|
9968
10311
|
const { current } = ref;
|
|
@@ -9983,7 +10326,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
9983
10326
|
});
|
|
9984
10327
|
});
|
|
9985
10328
|
}, [refs]);
|
|
9986
|
-
const registerAudio =
|
|
10329
|
+
const registerAudio = useCallback10((options) => {
|
|
9987
10330
|
const { aud, audioId, premounting, postmounting } = options;
|
|
9988
10331
|
const found = audios.current?.find((a) => a.audioId === audioId);
|
|
9989
10332
|
if (found) {
|
|
@@ -10012,7 +10355,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
10012
10355
|
rerenderAudios();
|
|
10013
10356
|
return newElem;
|
|
10014
10357
|
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
10015
|
-
const unregisterAudio =
|
|
10358
|
+
const unregisterAudio = useCallback10((id) => {
|
|
10016
10359
|
const cloned = [...takenAudios.current];
|
|
10017
10360
|
const index = refs.findIndex((r2) => r2.id === id);
|
|
10018
10361
|
if (index === -1) {
|
|
@@ -10023,7 +10366,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
10023
10366
|
audios.current = audios.current?.filter((a) => a.id !== id);
|
|
10024
10367
|
rerenderAudios();
|
|
10025
10368
|
}, [refs, rerenderAudios]);
|
|
10026
|
-
const updateAudio =
|
|
10369
|
+
const updateAudio = useCallback10(({
|
|
10027
10370
|
aud,
|
|
10028
10371
|
audioId,
|
|
10029
10372
|
id,
|
|
@@ -10057,7 +10400,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
10057
10400
|
rerenderAudios();
|
|
10058
10401
|
}
|
|
10059
10402
|
}, [rerenderAudios]);
|
|
10060
|
-
const playAllAudios =
|
|
10403
|
+
const playAllAudios = useCallback10(() => {
|
|
10061
10404
|
refs.forEach((ref) => {
|
|
10062
10405
|
const audio = audios.current.find((a) => a.el === ref.ref);
|
|
10063
10406
|
if (audio?.premounting) {
|
|
@@ -10110,8 +10453,8 @@ var useSharedAudio = ({
|
|
|
10110
10453
|
premounting,
|
|
10111
10454
|
postmounting
|
|
10112
10455
|
}) => {
|
|
10113
|
-
const audioCtx =
|
|
10114
|
-
const tagsCtx =
|
|
10456
|
+
const audioCtx = useContext21(SharedAudioContext);
|
|
10457
|
+
const tagsCtx = useContext21(SharedAudioTagsContext);
|
|
10115
10458
|
const [elem] = useState12(() => {
|
|
10116
10459
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
10117
10460
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
@@ -10290,7 +10633,7 @@ var useVolume = ({
|
|
|
10290
10633
|
const audioStuffRef = useRef13(null);
|
|
10291
10634
|
const currentVolumeRef = useRef13(volume);
|
|
10292
10635
|
currentVolumeRef.current = volume;
|
|
10293
|
-
const sharedAudioContext =
|
|
10636
|
+
const sharedAudioContext = useContext22(SharedAudioContext);
|
|
10294
10637
|
if (!sharedAudioContext) {
|
|
10295
10638
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
10296
10639
|
}
|
|
@@ -10355,7 +10698,7 @@ var useVolume = ({
|
|
|
10355
10698
|
return audioStuffRef;
|
|
10356
10699
|
};
|
|
10357
10700
|
var useMediaStartsAt = () => {
|
|
10358
|
-
const parentSequence =
|
|
10701
|
+
const parentSequence = useContext23(SequenceContext);
|
|
10359
10702
|
const startsAt = Math.min(0, parentSequence?.relativeFrom ?? 0);
|
|
10360
10703
|
return startsAt;
|
|
10361
10704
|
};
|
|
@@ -10444,7 +10787,7 @@ var useBasicMediaInTimeline = ({
|
|
|
10444
10787
|
if (!src) {
|
|
10445
10788
|
throw new Error("No src passed");
|
|
10446
10789
|
}
|
|
10447
|
-
const parentSequence =
|
|
10790
|
+
const parentSequence = useContext24(SequenceContext);
|
|
10448
10791
|
const [initialVolume] = useState13(() => volume);
|
|
10449
10792
|
const duration = getTimelineDuration({
|
|
10450
10793
|
compositionDurationInFrames: sequenceDurationInFrames,
|
|
@@ -10511,8 +10854,8 @@ var useImageInTimeline = ({
|
|
|
10511
10854
|
loopDisplay,
|
|
10512
10855
|
controls
|
|
10513
10856
|
}) => {
|
|
10514
|
-
const parentSequence =
|
|
10515
|
-
const { registerSequence, unregisterSequence } =
|
|
10857
|
+
const parentSequence = useContext24(SequenceContext);
|
|
10858
|
+
const { registerSequence, unregisterSequence } = useContext24(SequenceManager);
|
|
10516
10859
|
const { durationInFrames } = useVideoConfig();
|
|
10517
10860
|
const mediaStartsAt = useMediaStartsAt();
|
|
10518
10861
|
const { duration, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
|
|
@@ -10593,9 +10936,9 @@ var useMediaInTimeline = ({
|
|
|
10593
10936
|
postmountDisplay,
|
|
10594
10937
|
loopDisplay
|
|
10595
10938
|
}) => {
|
|
10596
|
-
const parentSequence =
|
|
10939
|
+
const parentSequence = useContext24(SequenceContext);
|
|
10597
10940
|
const startsAt = useMediaStartsAt();
|
|
10598
|
-
const { registerSequence, unregisterSequence } =
|
|
10941
|
+
const { registerSequence, unregisterSequence } = useContext24(SequenceManager);
|
|
10599
10942
|
const { durationInFrames } = useVideoConfig();
|
|
10600
10943
|
const mediaStartsAt = useMediaStartsAt();
|
|
10601
10944
|
const { volumes, duration, doesVolumeChange, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
|
|
@@ -10677,7 +11020,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
10677
11020
|
const env = useRemotionEnvironment();
|
|
10678
11021
|
const rendering = env.isRendering;
|
|
10679
11022
|
const buffering = useRef14(false);
|
|
10680
|
-
const addBlock =
|
|
11023
|
+
const addBlock = useCallback11((block) => {
|
|
10681
11024
|
if (rendering) {
|
|
10682
11025
|
return {
|
|
10683
11026
|
unblock: () => {
|
|
@@ -10703,7 +11046,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
10703
11046
|
}
|
|
10704
11047
|
};
|
|
10705
11048
|
}, [rendering]);
|
|
10706
|
-
const listenForBuffering =
|
|
11049
|
+
const listenForBuffering = useCallback11((callback) => {
|
|
10707
11050
|
setOnBufferingCallbacks((c) => [...c, callback]);
|
|
10708
11051
|
return {
|
|
10709
11052
|
remove: () => {
|
|
@@ -10711,7 +11054,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
10711
11054
|
}
|
|
10712
11055
|
};
|
|
10713
11056
|
}, []);
|
|
10714
|
-
const listenForResume =
|
|
11057
|
+
const listenForResume = useCallback11((callback) => {
|
|
10715
11058
|
setOnResumeCallbacks((c) => [...c, callback]);
|
|
10716
11059
|
return {
|
|
10717
11060
|
remove: () => {
|
|
@@ -10755,7 +11098,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
10755
11098
|
};
|
|
10756
11099
|
var BufferingContextReact = React21.createContext(null);
|
|
10757
11100
|
var BufferingProvider = ({ children }) => {
|
|
10758
|
-
const { logLevel, mountTime } =
|
|
11101
|
+
const { logLevel, mountTime } = useContext25(LogLevelContext);
|
|
10759
11102
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
|
|
10760
11103
|
return /* @__PURE__ */ jsx21(BufferingContextReact.Provider, {
|
|
10761
11104
|
value: bufferManager,
|
|
@@ -10785,7 +11128,7 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
10785
11128
|
return isBuffering;
|
|
10786
11129
|
};
|
|
10787
11130
|
var useBufferState = () => {
|
|
10788
|
-
const buffer =
|
|
11131
|
+
const buffer = useContext26(BufferingContextReact);
|
|
10789
11132
|
const logLevel = useLogLevel();
|
|
10790
11133
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
10791
11134
|
return useMemo25(() => ({
|
|
@@ -10825,7 +11168,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
10825
11168
|
}) => {
|
|
10826
11169
|
const bufferingRef = useRef15(false);
|
|
10827
11170
|
const { delayPlayback } = useBufferState();
|
|
10828
|
-
const bufferUntilFirstFrame =
|
|
11171
|
+
const bufferUntilFirstFrame = useCallback12((requestedTime) => {
|
|
10829
11172
|
if (mediaType !== "video") {
|
|
10830
11173
|
return;
|
|
10831
11174
|
}
|
|
@@ -11196,6 +11539,23 @@ function checkInfiniteRange(name, arr) {
|
|
|
11196
11539
|
}
|
|
11197
11540
|
}
|
|
11198
11541
|
}
|
|
11542
|
+
function assertValidInterpolateEasingOption(easing, inputRangeLength) {
|
|
11543
|
+
if (easing === undefined) {
|
|
11544
|
+
return;
|
|
11545
|
+
}
|
|
11546
|
+
if (typeof easing === "function") {
|
|
11547
|
+
return;
|
|
11548
|
+
}
|
|
11549
|
+
const expectedLength = inputRangeLength - 1;
|
|
11550
|
+
if (easing.length !== expectedLength) {
|
|
11551
|
+
throw new Error(`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${expectedLength}), but got length ${easing.length}`);
|
|
11552
|
+
}
|
|
11553
|
+
for (let i = 0;i < easing.length; i++) {
|
|
11554
|
+
if (typeof easing[i] !== "function") {
|
|
11555
|
+
throw new Error(`easing[${i}] must be a function`);
|
|
11556
|
+
}
|
|
11557
|
+
}
|
|
11558
|
+
}
|
|
11199
11559
|
function interpolate2(input, inputRange, outputRange, options) {
|
|
11200
11560
|
if (typeof input === "undefined") {
|
|
11201
11561
|
throw new Error("input can not be undefined");
|
|
@@ -11212,7 +11572,18 @@ function interpolate2(input, inputRange, outputRange, options) {
|
|
|
11212
11572
|
checkInfiniteRange("inputRange", inputRange);
|
|
11213
11573
|
checkInfiniteRange("outputRange", outputRange);
|
|
11214
11574
|
checkValidInputRange(inputRange);
|
|
11215
|
-
|
|
11575
|
+
assertValidInterpolateEasingOption(options?.easing, inputRange.length);
|
|
11576
|
+
const easingOption = options?.easing;
|
|
11577
|
+
const defaultEasing = (num) => num;
|
|
11578
|
+
const resolveEasingForSegment = (segmentIndex) => {
|
|
11579
|
+
if (easingOption === undefined) {
|
|
11580
|
+
return defaultEasing;
|
|
11581
|
+
}
|
|
11582
|
+
if (typeof easingOption === "function") {
|
|
11583
|
+
return easingOption;
|
|
11584
|
+
}
|
|
11585
|
+
return easingOption[segmentIndex];
|
|
11586
|
+
};
|
|
11216
11587
|
let extrapolateLeft = "extend";
|
|
11217
11588
|
if (options?.extrapolateLeft !== undefined) {
|
|
11218
11589
|
extrapolateLeft = options.extrapolateLeft;
|
|
@@ -11226,7 +11597,7 @@ function interpolate2(input, inputRange, outputRange, options) {
|
|
|
11226
11597
|
}
|
|
11227
11598
|
const range = findRange(input, inputRange);
|
|
11228
11599
|
return interpolateFunction(input, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
|
|
11229
|
-
easing,
|
|
11600
|
+
easing: resolveEasingForSegment(range),
|
|
11230
11601
|
extrapolateLeft,
|
|
11231
11602
|
extrapolateRight
|
|
11232
11603
|
});
|
|
@@ -11291,6 +11662,7 @@ var useMediaPlayback = ({
|
|
|
11291
11662
|
src,
|
|
11292
11663
|
mediaType,
|
|
11293
11664
|
playbackRate: localPlaybackRate,
|
|
11665
|
+
preservePitch = true,
|
|
11294
11666
|
onlyWarnForMediaSeekingError,
|
|
11295
11667
|
acceptableTimeshift,
|
|
11296
11668
|
pauseWhenBuffering,
|
|
@@ -11302,7 +11674,7 @@ var useMediaPlayback = ({
|
|
|
11302
11674
|
const frame = useCurrentFrame();
|
|
11303
11675
|
const absoluteFrame = useTimelinePosition();
|
|
11304
11676
|
const [playing] = usePlayingState();
|
|
11305
|
-
const buffering =
|
|
11677
|
+
const buffering = useContext27(BufferingContextReact);
|
|
11306
11678
|
const { fps } = useVideoConfig();
|
|
11307
11679
|
const mediaStartsAt = useMediaStartsAt();
|
|
11308
11680
|
const lastSeekDueToShift = useRef17(null);
|
|
@@ -11313,7 +11685,7 @@ var useMediaPlayback = ({
|
|
|
11313
11685
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
11314
11686
|
}
|
|
11315
11687
|
const isVariableFpsVideoMap = useRef17({});
|
|
11316
|
-
const onVariableFpsVideoDetected =
|
|
11688
|
+
const onVariableFpsVideoDetected = useCallback13(() => {
|
|
11317
11689
|
if (!src) {
|
|
11318
11690
|
return;
|
|
11319
11691
|
}
|
|
@@ -11408,7 +11780,10 @@ var useMediaPlayback = ({
|
|
|
11408
11780
|
if (mediaRef.current && mediaRef.current.playbackRate !== playbackRateToSet) {
|
|
11409
11781
|
mediaRef.current.playbackRate = playbackRateToSet;
|
|
11410
11782
|
}
|
|
11411
|
-
|
|
11783
|
+
if (mediaRef.current && mediaRef.current.preservesPitch !== preservePitch) {
|
|
11784
|
+
mediaRef.current.preservesPitch = preservePitch;
|
|
11785
|
+
}
|
|
11786
|
+
}, [mediaRef, playbackRate, preservePitch]);
|
|
11412
11787
|
useEffect12(() => {
|
|
11413
11788
|
const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
|
|
11414
11789
|
if (!mediaRef.current) {
|
|
@@ -11590,15 +11965,15 @@ var SetMediaVolumeContext = createContext22({
|
|
|
11590
11965
|
}
|
|
11591
11966
|
});
|
|
11592
11967
|
var useMediaVolumeState = () => {
|
|
11593
|
-
const { mediaVolume } =
|
|
11594
|
-
const { setMediaVolume } =
|
|
11968
|
+
const { mediaVolume } = useContext28(MediaVolumeContext);
|
|
11969
|
+
const { setMediaVolume } = useContext28(SetMediaVolumeContext);
|
|
11595
11970
|
return useMemo27(() => {
|
|
11596
11971
|
return [mediaVolume, setMediaVolume];
|
|
11597
11972
|
}, [mediaVolume, setMediaVolume]);
|
|
11598
11973
|
};
|
|
11599
11974
|
var useMediaMutedState = () => {
|
|
11600
|
-
const { mediaMuted } =
|
|
11601
|
-
const { setMediaMuted } =
|
|
11975
|
+
const { mediaMuted } = useContext28(MediaVolumeContext);
|
|
11976
|
+
const { setMediaMuted } = useContext28(SetMediaVolumeContext);
|
|
11602
11977
|
return useMemo27(() => {
|
|
11603
11978
|
return [mediaMuted, setMediaMuted];
|
|
11604
11979
|
}, [mediaMuted, setMediaMuted]);
|
|
@@ -11618,6 +11993,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11618
11993
|
volume,
|
|
11619
11994
|
muted,
|
|
11620
11995
|
playbackRate,
|
|
11996
|
+
preservePitch,
|
|
11621
11997
|
shouldPreMountAudioTags,
|
|
11622
11998
|
src,
|
|
11623
11999
|
onDuration,
|
|
@@ -11648,14 +12024,12 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11648
12024
|
const [mediaVolume] = useMediaVolumeState();
|
|
11649
12025
|
const [mediaMuted] = useMediaMutedState();
|
|
11650
12026
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
11651
|
-
const { hidden } = useContext28(SequenceVisibilityToggleContext);
|
|
11652
12027
|
if (!src) {
|
|
11653
12028
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
11654
12029
|
}
|
|
11655
12030
|
const preloadedSrc = usePreload(src);
|
|
11656
|
-
const sequenceContext =
|
|
12031
|
+
const sequenceContext = useContext29(SequenceContext);
|
|
11657
12032
|
const [timelineId] = useState16(() => String(Math.random()));
|
|
11658
|
-
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
11659
12033
|
const userPreferredVolume = evaluateVolume({
|
|
11660
12034
|
frame: volumePropFrame,
|
|
11661
12035
|
volume,
|
|
@@ -11669,7 +12043,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11669
12043
|
});
|
|
11670
12044
|
const propsToPass = useMemo28(() => {
|
|
11671
12045
|
return {
|
|
11672
|
-
muted: muted || mediaMuted ||
|
|
12046
|
+
muted: muted || mediaMuted || userPreferredVolume <= 0,
|
|
11673
12047
|
src: preloadedSrc,
|
|
11674
12048
|
loop: _remotionInternalNativeLoopPassed,
|
|
11675
12049
|
crossOrigin: crossOriginValue,
|
|
@@ -11677,7 +12051,6 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11677
12051
|
};
|
|
11678
12052
|
}, [
|
|
11679
12053
|
_remotionInternalNativeLoopPassed,
|
|
11680
|
-
isSequenceHidden,
|
|
11681
12054
|
mediaMuted,
|
|
11682
12055
|
muted,
|
|
11683
12056
|
nativeProps,
|
|
@@ -11722,6 +12095,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11722
12095
|
src,
|
|
11723
12096
|
mediaType: "audio",
|
|
11724
12097
|
playbackRate: playbackRate ?? 1,
|
|
12098
|
+
preservePitch,
|
|
11725
12099
|
onlyWarnForMediaSeekingError: false,
|
|
11726
12100
|
acceptableTimeshift: acceptableTimeShiftInSeconds ?? null,
|
|
11727
12101
|
isPremounting: Boolean(sequenceContext?.premounting),
|
|
@@ -11784,7 +12158,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11784
12158
|
...propsToPass
|
|
11785
12159
|
});
|
|
11786
12160
|
};
|
|
11787
|
-
var AudioForPreview =
|
|
12161
|
+
var AudioForPreview = forwardRef7(AudioForDevelopmentForwardRefFunction);
|
|
11788
12162
|
var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
11789
12163
|
const audioRef = useRef19(null);
|
|
11790
12164
|
const {
|
|
@@ -11803,13 +12177,14 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
11803
12177
|
loopVolumeCurveBehavior,
|
|
11804
12178
|
pauseWhenBuffering,
|
|
11805
12179
|
audioStreamIndex,
|
|
12180
|
+
preservePitch: _preservePitch,
|
|
11806
12181
|
...nativeProps
|
|
11807
12182
|
} = props;
|
|
11808
12183
|
const absoluteFrame = useTimelinePosition();
|
|
11809
12184
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
11810
12185
|
const frame = useCurrentFrame();
|
|
11811
|
-
const sequenceContext =
|
|
11812
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
12186
|
+
const sequenceContext = useContext30(SequenceContext);
|
|
12187
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
|
|
11813
12188
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
11814
12189
|
const id = useMemo29(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
11815
12190
|
props.src,
|
|
@@ -11916,9 +12291,9 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
11916
12291
|
onError: onNativeError
|
|
11917
12292
|
});
|
|
11918
12293
|
};
|
|
11919
|
-
var AudioForRendering =
|
|
12294
|
+
var AudioForRendering = forwardRef8(AudioForRenderingRefForwardingFunction);
|
|
11920
12295
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
11921
|
-
const audioTagsContext =
|
|
12296
|
+
const audioTagsContext = useContext31(SharedAudioTagsContext);
|
|
11922
12297
|
const {
|
|
11923
12298
|
startFrom,
|
|
11924
12299
|
endAt,
|
|
@@ -11937,12 +12312,12 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11937
12312
|
if (environment.isClientSideRendering) {
|
|
11938
12313
|
throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
11939
12314
|
}
|
|
11940
|
-
const { durations, setDurations } =
|
|
12315
|
+
const { durations, setDurations } = useContext31(DurationsContext);
|
|
11941
12316
|
if (typeof props.src !== "string") {
|
|
11942
12317
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
11943
12318
|
}
|
|
11944
12319
|
const preloadedSrc = usePreload(props.src);
|
|
11945
|
-
const onError =
|
|
12320
|
+
const onError = useCallback14((e) => {
|
|
11946
12321
|
console.log(e.currentTarget.error);
|
|
11947
12322
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
11948
12323
|
if (loop) {
|
|
@@ -11956,7 +12331,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11956
12331
|
console.warn(errMessage);
|
|
11957
12332
|
}
|
|
11958
12333
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
11959
|
-
const onDuration =
|
|
12334
|
+
const onDuration = useCallback14((src, durationInSeconds) => {
|
|
11960
12335
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
11961
12336
|
}, [setDurations]);
|
|
11962
12337
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -12006,7 +12381,11 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
12006
12381
|
})
|
|
12007
12382
|
});
|
|
12008
12383
|
}
|
|
12009
|
-
validateMediaProps({
|
|
12384
|
+
validateMediaProps({
|
|
12385
|
+
playbackRate: props.playbackRate,
|
|
12386
|
+
preservePitch: props.preservePitch,
|
|
12387
|
+
volume: props.volume
|
|
12388
|
+
}, "Html5Audio");
|
|
12010
12389
|
if (environment.isRendering) {
|
|
12011
12390
|
return /* @__PURE__ */ jsx24(AudioForRendering, {
|
|
12012
12391
|
onDuration,
|
|
@@ -12029,7 +12408,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
12029
12408
|
showInTimeline: showInTimeline ?? true
|
|
12030
12409
|
});
|
|
12031
12410
|
};
|
|
12032
|
-
var Html5Audio =
|
|
12411
|
+
var Html5Audio = forwardRef9(AudioRefForwardingFunction);
|
|
12033
12412
|
addSequenceStackTraces(Html5Audio);
|
|
12034
12413
|
var Audio = Html5Audio;
|
|
12035
12414
|
var kSplineTableSize = 11;
|
|
@@ -12046,11 +12425,11 @@ var IFrameRefForwarding = ({
|
|
|
12046
12425
|
retries: delayRenderRetries ?? undefined,
|
|
12047
12426
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
12048
12427
|
}));
|
|
12049
|
-
const didLoad =
|
|
12428
|
+
const didLoad = useCallback15((e) => {
|
|
12050
12429
|
continueRender2(handle);
|
|
12051
12430
|
onLoad?.(e);
|
|
12052
12431
|
}, [handle, onLoad, continueRender2]);
|
|
12053
|
-
const didGetError =
|
|
12432
|
+
const didGetError = useCallback15((e) => {
|
|
12054
12433
|
continueRender2(handle);
|
|
12055
12434
|
if (onError) {
|
|
12056
12435
|
onError(e);
|
|
@@ -12066,7 +12445,7 @@ var IFrameRefForwarding = ({
|
|
|
12066
12445
|
onLoad: didLoad
|
|
12067
12446
|
});
|
|
12068
12447
|
};
|
|
12069
|
-
var IFrame =
|
|
12448
|
+
var IFrame = forwardRef10(IFrameRefForwarding);
|
|
12070
12449
|
function exponentialBackoff(errorCount) {
|
|
12071
12450
|
return 1000 * 2 ** (errorCount - 1);
|
|
12072
12451
|
}
|
|
@@ -12076,7 +12455,7 @@ function truncateSrcForLabel(src) {
|
|
|
12076
12455
|
}
|
|
12077
12456
|
return src;
|
|
12078
12457
|
}
|
|
12079
|
-
var
|
|
12458
|
+
var ImgContent = ({
|
|
12080
12459
|
onError,
|
|
12081
12460
|
maxRetries = 2,
|
|
12082
12461
|
src,
|
|
@@ -12085,21 +12464,13 @@ var ImgInner = ({
|
|
|
12085
12464
|
delayRenderTimeoutInMilliseconds,
|
|
12086
12465
|
onImageFrame,
|
|
12087
12466
|
crossOrigin,
|
|
12088
|
-
showInTimeline,
|
|
12089
|
-
name,
|
|
12090
|
-
stack,
|
|
12091
12467
|
ref,
|
|
12092
|
-
_experimentalControls: controls,
|
|
12093
12468
|
...props2
|
|
12094
12469
|
}) => {
|
|
12095
12470
|
const imageRef = useRef20(null);
|
|
12096
12471
|
const errors = useRef20({});
|
|
12097
12472
|
const { delayPlayback } = useBufferState();
|
|
12098
|
-
const sequenceContext =
|
|
12099
|
-
const [timelineId] = useState18(() => String(Math.random()));
|
|
12100
|
-
if (!src) {
|
|
12101
|
-
throw new Error('No "src" prop was passed to <Img>.');
|
|
12102
|
-
}
|
|
12473
|
+
const sequenceContext = useContext32(SequenceContext);
|
|
12103
12474
|
const _propsValid = true;
|
|
12104
12475
|
if (!_propsValid) {
|
|
12105
12476
|
throw new Error("typecheck error");
|
|
@@ -12107,19 +12478,8 @@ var ImgInner = ({
|
|
|
12107
12478
|
useImperativeHandle6(ref, () => {
|
|
12108
12479
|
return imageRef.current;
|
|
12109
12480
|
}, []);
|
|
12110
|
-
useImageInTimeline({
|
|
12111
|
-
src,
|
|
12112
|
-
displayName: name ?? null,
|
|
12113
|
-
id: timelineId,
|
|
12114
|
-
stack: stack ?? null,
|
|
12115
|
-
showInTimeline: showInTimeline ?? true,
|
|
12116
|
-
premountDisplay: sequenceContext?.premountDisplay ?? null,
|
|
12117
|
-
postmountDisplay: sequenceContext?.postmountDisplay ?? null,
|
|
12118
|
-
loopDisplay: undefined,
|
|
12119
|
-
controls: controls ?? null
|
|
12120
|
-
});
|
|
12121
12481
|
const actualSrc = usePreload(src);
|
|
12122
|
-
const retryIn =
|
|
12482
|
+
const retryIn = useCallback16((timeout) => {
|
|
12123
12483
|
if (!imageRef.current) {
|
|
12124
12484
|
return;
|
|
12125
12485
|
}
|
|
@@ -12137,7 +12497,7 @@ var ImgInner = ({
|
|
|
12137
12497
|
}, timeout);
|
|
12138
12498
|
}, []);
|
|
12139
12499
|
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
12140
|
-
const didGetError =
|
|
12500
|
+
const didGetError = useCallback16((e) => {
|
|
12141
12501
|
if (!errors.current) {
|
|
12142
12502
|
return;
|
|
12143
12503
|
}
|
|
@@ -12239,7 +12599,44 @@ var ImgInner = ({
|
|
|
12239
12599
|
decoding: "sync"
|
|
12240
12600
|
});
|
|
12241
12601
|
};
|
|
12242
|
-
var
|
|
12602
|
+
var ImgInner = ({
|
|
12603
|
+
hidden,
|
|
12604
|
+
name,
|
|
12605
|
+
stack,
|
|
12606
|
+
showInTimeline,
|
|
12607
|
+
src,
|
|
12608
|
+
_experimentalControls: controls,
|
|
12609
|
+
...props2
|
|
12610
|
+
}) => {
|
|
12611
|
+
const sequenceContext = useContext32(SequenceContext);
|
|
12612
|
+
const [timelineId] = useState18(() => String(Math.random()));
|
|
12613
|
+
if (!src) {
|
|
12614
|
+
throw new Error('No "src" prop was passed to <Img>.');
|
|
12615
|
+
}
|
|
12616
|
+
useImageInTimeline({
|
|
12617
|
+
src,
|
|
12618
|
+
displayName: name ?? null,
|
|
12619
|
+
id: timelineId,
|
|
12620
|
+
stack: stack ?? null,
|
|
12621
|
+
showInTimeline: showInTimeline ?? true,
|
|
12622
|
+
premountDisplay: sequenceContext?.premountDisplay ?? null,
|
|
12623
|
+
postmountDisplay: sequenceContext?.postmountDisplay ?? null,
|
|
12624
|
+
loopDisplay: undefined,
|
|
12625
|
+
controls: controls ?? null
|
|
12626
|
+
});
|
|
12627
|
+
if (hidden) {
|
|
12628
|
+
return null;
|
|
12629
|
+
}
|
|
12630
|
+
return /* @__PURE__ */ jsx26(ImgContent, {
|
|
12631
|
+
src,
|
|
12632
|
+
...props2
|
|
12633
|
+
});
|
|
12634
|
+
};
|
|
12635
|
+
var imgSchema = {
|
|
12636
|
+
...sequenceStyleSchema,
|
|
12637
|
+
hidden: hiddenField
|
|
12638
|
+
};
|
|
12639
|
+
var Img = wrapInSchema(ImgInner, imgSchema);
|
|
12243
12640
|
addSequenceStackTraces(Img);
|
|
12244
12641
|
var compositionsRef = React28.createRef();
|
|
12245
12642
|
var CompositionManagerProvider = ({
|
|
@@ -12253,14 +12650,14 @@ var CompositionManagerProvider = ({
|
|
|
12253
12650
|
const [canvasContent, setCanvasContent] = useState19(initialCanvasContent);
|
|
12254
12651
|
const [compositions, setCompositions] = useState19(initialCompositions);
|
|
12255
12652
|
const currentcompositionsRef = useRef21(compositions);
|
|
12256
|
-
const updateCompositions =
|
|
12653
|
+
const updateCompositions = useCallback17((updateComps) => {
|
|
12257
12654
|
setCompositions((comps) => {
|
|
12258
12655
|
const updated = updateComps(comps);
|
|
12259
12656
|
currentcompositionsRef.current = updated;
|
|
12260
12657
|
return updated;
|
|
12261
12658
|
});
|
|
12262
12659
|
}, []);
|
|
12263
|
-
const registerComposition =
|
|
12660
|
+
const registerComposition = useCallback17((comp) => {
|
|
12264
12661
|
updateCompositions((comps) => {
|
|
12265
12662
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
12266
12663
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
@@ -12268,12 +12665,12 @@ var CompositionManagerProvider = ({
|
|
|
12268
12665
|
return [...comps, comp];
|
|
12269
12666
|
});
|
|
12270
12667
|
}, [updateCompositions]);
|
|
12271
|
-
const unregisterComposition =
|
|
12668
|
+
const unregisterComposition = useCallback17((id) => {
|
|
12272
12669
|
setCompositions((comps) => {
|
|
12273
12670
|
return comps.filter((c2) => c2.id !== id);
|
|
12274
12671
|
});
|
|
12275
12672
|
}, []);
|
|
12276
|
-
const registerFolder =
|
|
12673
|
+
const registerFolder = useCallback17((name, parent, nonce) => {
|
|
12277
12674
|
setFolders((prevFolders) => {
|
|
12278
12675
|
return [
|
|
12279
12676
|
...prevFolders,
|
|
@@ -12285,7 +12682,7 @@ var CompositionManagerProvider = ({
|
|
|
12285
12682
|
];
|
|
12286
12683
|
});
|
|
12287
12684
|
}, []);
|
|
12288
|
-
const unregisterFolder =
|
|
12685
|
+
const unregisterFolder = useCallback17((name, parent) => {
|
|
12289
12686
|
setFolders((prevFolders) => {
|
|
12290
12687
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
12291
12688
|
});
|
|
@@ -12385,16 +12782,31 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
12385
12782
|
}
|
|
12386
12783
|
`;
|
|
12387
12784
|
};
|
|
12388
|
-
var
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12785
|
+
var disabledEffectField = {
|
|
12786
|
+
type: "boolean",
|
|
12787
|
+
default: false,
|
|
12788
|
+
description: "Disabled"
|
|
12789
|
+
};
|
|
12790
|
+
var createEffect = (definition) => {
|
|
12791
|
+
const userCalculateKey = definition.calculateKey;
|
|
12792
|
+
const widened = {
|
|
12793
|
+
...definition,
|
|
12794
|
+
calculateKey: (params) => {
|
|
12795
|
+
const disabled = params.disabled ?? false;
|
|
12796
|
+
return `${userCalculateKey(params)}-disabled-${disabled}`;
|
|
12797
|
+
},
|
|
12798
|
+
schema: {
|
|
12799
|
+
disabled: disabledEffectField,
|
|
12800
|
+
...definition.schema
|
|
12801
|
+
}
|
|
12802
|
+
};
|
|
12803
|
+
const factory = (params = {}) => ({
|
|
12392
12804
|
definition: widened,
|
|
12393
12805
|
params,
|
|
12394
|
-
stack: new Error().stack,
|
|
12395
12806
|
effectKey: widened.calculateKey(params),
|
|
12396
12807
|
memoized: false
|
|
12397
|
-
};
|
|
12808
|
+
});
|
|
12809
|
+
return factory;
|
|
12398
12810
|
};
|
|
12399
12811
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
12400
12812
|
var getPreviewDomElement = () => {
|
|
@@ -12420,7 +12832,7 @@ var waitForRoot = (fn) => {
|
|
|
12420
12832
|
};
|
|
12421
12833
|
var MediaEnabledContext = createContext23(null);
|
|
12422
12834
|
var useVideoEnabled = () => {
|
|
12423
|
-
const context =
|
|
12835
|
+
const context = useContext33(MediaEnabledContext);
|
|
12424
12836
|
if (!context) {
|
|
12425
12837
|
return window.remotion_videoEnabled;
|
|
12426
12838
|
}
|
|
@@ -12430,7 +12842,7 @@ var useVideoEnabled = () => {
|
|
|
12430
12842
|
return context.videoEnabled;
|
|
12431
12843
|
};
|
|
12432
12844
|
var useAudioEnabled = () => {
|
|
12433
|
-
const context =
|
|
12845
|
+
const context = useContext33(MediaEnabledContext);
|
|
12434
12846
|
if (!context) {
|
|
12435
12847
|
return window.remotion_audioEnabled;
|
|
12436
12848
|
}
|
|
@@ -12746,15 +13158,16 @@ var OffthreadVideoForRendering = ({
|
|
|
12746
13158
|
onVideoFrame,
|
|
12747
13159
|
crossOrigin,
|
|
12748
13160
|
audioStreamIndex,
|
|
13161
|
+
preservePitch: _preservePitch,
|
|
12749
13162
|
...props2
|
|
12750
13163
|
}) => {
|
|
12751
13164
|
const absoluteFrame = useTimelinePosition();
|
|
12752
13165
|
const frame = useCurrentFrame();
|
|
12753
13166
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
|
|
12754
13167
|
const videoConfig = useUnsafeVideoConfig();
|
|
12755
|
-
const sequenceContext =
|
|
13168
|
+
const sequenceContext = useContext34(SequenceContext);
|
|
12756
13169
|
const mediaStartsAt = useMediaStartsAt();
|
|
12757
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
13170
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext34(RenderAssetManager);
|
|
12758
13171
|
if (!src) {
|
|
12759
13172
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
12760
13173
|
}
|
|
@@ -12901,7 +13314,7 @@ var OffthreadVideoForRendering = ({
|
|
|
12901
13314
|
continueRender2,
|
|
12902
13315
|
delayRender2
|
|
12903
13316
|
]);
|
|
12904
|
-
const onErr =
|
|
13317
|
+
const onErr = useCallback18(() => {
|
|
12905
13318
|
if (onError) {
|
|
12906
13319
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
12907
13320
|
} else {
|
|
@@ -12911,7 +13324,7 @@ var OffthreadVideoForRendering = ({
|
|
|
12911
13324
|
const className = useMemo33(() => {
|
|
12912
13325
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy2).join(" ");
|
|
12913
13326
|
}, [props2.className]);
|
|
12914
|
-
const onImageFrame =
|
|
13327
|
+
const onImageFrame = useCallback18((img) => {
|
|
12915
13328
|
if (onVideoFrame) {
|
|
12916
13329
|
onVideoFrame(img);
|
|
12917
13330
|
}
|
|
@@ -12966,7 +13379,7 @@ class MediaPlaybackError extends Error {
|
|
|
12966
13379
|
}
|
|
12967
13380
|
}
|
|
12968
13381
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
12969
|
-
const context =
|
|
13382
|
+
const context = useContext35(SharedAudioContext);
|
|
12970
13383
|
if (!context) {
|
|
12971
13384
|
throw new Error("SharedAudioContext not found");
|
|
12972
13385
|
}
|
|
@@ -12992,6 +13405,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
12992
13405
|
volume,
|
|
12993
13406
|
muted,
|
|
12994
13407
|
playbackRate,
|
|
13408
|
+
preservePitch,
|
|
12995
13409
|
onlyWarnForMediaSeekingError,
|
|
12996
13410
|
src,
|
|
12997
13411
|
onDuration,
|
|
@@ -13022,12 +13436,10 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
13022
13436
|
}
|
|
13023
13437
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
13024
13438
|
const { fps, durationInFrames } = useVideoConfig();
|
|
13025
|
-
const parentSequence =
|
|
13026
|
-
const { hidden } = useContext34(SequenceVisibilityToggleContext);
|
|
13439
|
+
const parentSequence = useContext35(SequenceContext);
|
|
13027
13440
|
const logLevel = useLogLevel();
|
|
13028
13441
|
const mountTime = useMountTime();
|
|
13029
13442
|
const [timelineId] = useState21(() => String(Math.random()));
|
|
13030
|
-
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
13031
13443
|
if (typeof acceptableTimeShift !== "undefined") {
|
|
13032
13444
|
throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
|
|
13033
13445
|
}
|
|
@@ -13058,6 +13470,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
13058
13470
|
src,
|
|
13059
13471
|
mediaType: "video",
|
|
13060
13472
|
playbackRate: props2.playbackRate ?? 1,
|
|
13473
|
+
preservePitch,
|
|
13061
13474
|
onlyWarnForMediaSeekingError,
|
|
13062
13475
|
acceptableTimeshift: acceptableTimeShiftInSeconds ?? null,
|
|
13063
13476
|
isPremounting: Boolean(parentSequence?.premounting),
|
|
@@ -13171,10 +13584,9 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
13171
13584
|
}, []);
|
|
13172
13585
|
const actualStyle = useMemo34(() => {
|
|
13173
13586
|
return {
|
|
13174
|
-
...style
|
|
13175
|
-
opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
|
|
13587
|
+
...style
|
|
13176
13588
|
};
|
|
13177
|
-
}, [
|
|
13589
|
+
}, [style]);
|
|
13178
13590
|
const crossOriginValue = getCrossOriginValue({
|
|
13179
13591
|
crossOrigin,
|
|
13180
13592
|
requestsVideoFrame: Boolean(onVideoFrame),
|
|
@@ -13182,7 +13594,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
13182
13594
|
});
|
|
13183
13595
|
return /* @__PURE__ */ jsx31("video", {
|
|
13184
13596
|
ref: videoRef,
|
|
13185
|
-
muted: muted || mediaMuted ||
|
|
13597
|
+
muted: muted || mediaMuted || userPreferredVolume <= 0,
|
|
13186
13598
|
playsInline: true,
|
|
13187
13599
|
src: actualSrc,
|
|
13188
13600
|
loop: _remotionInternalNativeLoopPassed,
|
|
@@ -13192,7 +13604,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
13192
13604
|
...nativeProps
|
|
13193
13605
|
});
|
|
13194
13606
|
};
|
|
13195
|
-
var VideoForPreview =
|
|
13607
|
+
var VideoForPreview = forwardRef11(VideoForDevelopmentRefForwardingFunction);
|
|
13196
13608
|
var InnerOffthreadVideo = (props2) => {
|
|
13197
13609
|
const {
|
|
13198
13610
|
startFrom,
|
|
@@ -13209,7 +13621,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
13209
13621
|
if (environment.isClientSideRendering) {
|
|
13210
13622
|
throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
13211
13623
|
}
|
|
13212
|
-
const onDuration =
|
|
13624
|
+
const onDuration = useCallback19(() => {
|
|
13213
13625
|
return;
|
|
13214
13626
|
}, []);
|
|
13215
13627
|
if (typeof props2.src !== "string") {
|
|
@@ -13297,6 +13709,7 @@ var OffthreadVideo = ({
|
|
|
13297
13709
|
onVideoFrame,
|
|
13298
13710
|
pauseWhenBuffering,
|
|
13299
13711
|
playbackRate,
|
|
13712
|
+
preservePitch,
|
|
13300
13713
|
showInTimeline,
|
|
13301
13714
|
style,
|
|
13302
13715
|
toneFrequency,
|
|
@@ -13332,6 +13745,7 @@ var OffthreadVideo = ({
|
|
|
13332
13745
|
onVideoFrame,
|
|
13333
13746
|
pauseWhenBuffering: pauseWhenBuffering ?? true,
|
|
13334
13747
|
playbackRate: playbackRate ?? 1,
|
|
13748
|
+
preservePitch,
|
|
13335
13749
|
toneFrequency: toneFrequency ?? 1,
|
|
13336
13750
|
showInTimeline: showInTimeline ?? true,
|
|
13337
13751
|
src,
|
|
@@ -13452,7 +13866,6 @@ var Internals = {
|
|
|
13452
13866
|
VisualModeSettersContext,
|
|
13453
13867
|
SequenceManager,
|
|
13454
13868
|
SequenceStackTracesUpdateContext,
|
|
13455
|
-
SequenceVisibilityToggleContext,
|
|
13456
13869
|
wrapInSchema,
|
|
13457
13870
|
sequenceSchema,
|
|
13458
13871
|
sequenceStyleSchema,
|
|
@@ -13548,13 +13961,16 @@ var Internals = {
|
|
|
13548
13961
|
useEffectChainState,
|
|
13549
13962
|
runEffectChain,
|
|
13550
13963
|
useMemoizedEffects,
|
|
13551
|
-
|
|
13552
|
-
|
|
13964
|
+
useMemoizedEffectDefinitions,
|
|
13965
|
+
createEffect,
|
|
13553
13966
|
computeEffectiveSchemaValuesDotNotation,
|
|
13554
13967
|
OverrideIdsToNodePathsGettersContext,
|
|
13555
13968
|
OverrideIdsToNodePathsSettersContext,
|
|
13556
13969
|
findPropsToDelete,
|
|
13557
|
-
|
|
13970
|
+
makeSequencePropsSubscriptionKey,
|
|
13971
|
+
getCodeValuesCtx,
|
|
13972
|
+
getEffectCodeValuesCtx,
|
|
13973
|
+
hiddenField
|
|
13558
13974
|
};
|
|
13559
13975
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
13560
13976
|
var PERCENTAGE = NUMBER + "%";
|
|
@@ -13617,7 +14033,7 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
|
13617
14033
|
children
|
|
13618
14034
|
});
|
|
13619
14035
|
};
|
|
13620
|
-
var SeriesSequence =
|
|
14036
|
+
var SeriesSequence = forwardRef12(SeriesSequenceRefForwardingFunction);
|
|
13621
14037
|
var SeriesInner = (props2) => {
|
|
13622
14038
|
const childrenValue = useMemo36(() => {
|
|
13623
14039
|
let startFrame = 0;
|
|
@@ -14142,6 +14558,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
14142
14558
|
loopVolumeCurveBehavior,
|
|
14143
14559
|
audioStreamIndex,
|
|
14144
14560
|
onVideoFrame,
|
|
14561
|
+
preservePitch: _preservePitch,
|
|
14145
14562
|
...props2
|
|
14146
14563
|
}, ref) => {
|
|
14147
14564
|
const absoluteFrame = useTimelinePosition();
|
|
@@ -14149,13 +14566,13 @@ var VideoForRenderingForwardFunction = ({
|
|
|
14149
14566
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
14150
14567
|
const videoConfig = useUnsafeVideoConfig();
|
|
14151
14568
|
const videoRef = useRef23(null);
|
|
14152
|
-
const sequenceContext =
|
|
14569
|
+
const sequenceContext = useContext36(SequenceContext);
|
|
14153
14570
|
const mediaStartsAt = useMediaStartsAt();
|
|
14154
14571
|
const environment = useRemotionEnvironment();
|
|
14155
14572
|
const logLevel = useLogLevel();
|
|
14156
14573
|
const mountTime = useMountTime();
|
|
14157
14574
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
14158
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
14575
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
|
|
14159
14576
|
const id = useMemo37(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
14160
14577
|
props2.src,
|
|
14161
14578
|
sequenceContext?.cumulatedFrom,
|
|
@@ -14344,7 +14761,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
14344
14761
|
...props2
|
|
14345
14762
|
});
|
|
14346
14763
|
};
|
|
14347
|
-
var VideoForRendering =
|
|
14764
|
+
var VideoForRendering = forwardRef13(VideoForRenderingForwardFunction);
|
|
14348
14765
|
var VideoForwardingFunction = (props2, ref) => {
|
|
14349
14766
|
const {
|
|
14350
14767
|
startFrom,
|
|
@@ -14365,7 +14782,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
14365
14782
|
if (environment.isClientSideRendering) {
|
|
14366
14783
|
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");
|
|
14367
14784
|
}
|
|
14368
|
-
const { durations, setDurations } =
|
|
14785
|
+
const { durations, setDurations } = useContext37(DurationsContext);
|
|
14369
14786
|
if (typeof ref === "string") {
|
|
14370
14787
|
throw new Error("string refs are not supported");
|
|
14371
14788
|
}
|
|
@@ -14373,10 +14790,10 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
14373
14790
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
14374
14791
|
}
|
|
14375
14792
|
const preloadedSrc = usePreload(props2.src);
|
|
14376
|
-
const onDuration =
|
|
14793
|
+
const onDuration = useCallback20((src, durationInSeconds) => {
|
|
14377
14794
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
14378
14795
|
}, [setDurations]);
|
|
14379
|
-
const onVideoFrame =
|
|
14796
|
+
const onVideoFrame = useCallback20(() => {}, []);
|
|
14380
14797
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
14381
14798
|
validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
|
|
14382
14799
|
const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
|
|
@@ -14428,7 +14845,11 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
14428
14845
|
})
|
|
14429
14846
|
});
|
|
14430
14847
|
}
|
|
14431
|
-
validateMediaProps({
|
|
14848
|
+
validateMediaProps({
|
|
14849
|
+
playbackRate: props2.playbackRate,
|
|
14850
|
+
preservePitch: props2.preservePitch,
|
|
14851
|
+
volume: props2.volume
|
|
14852
|
+
}, "Html5Video");
|
|
14432
14853
|
if (environment.isRendering) {
|
|
14433
14854
|
return /* @__PURE__ */ jsx37(VideoForRendering, {
|
|
14434
14855
|
onDuration,
|
|
@@ -14450,7 +14871,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
14450
14871
|
onAutoPlayError: onAutoPlayError ?? undefined
|
|
14451
14872
|
});
|
|
14452
14873
|
};
|
|
14453
|
-
var Html5Video =
|
|
14874
|
+
var Html5Video = forwardRef14(VideoForwardingFunction);
|
|
14454
14875
|
addSequenceStackTraces(Html5Video);
|
|
14455
14876
|
checkMultipleRemotionVersions();
|
|
14456
14877
|
var proxyObj = {};
|
|
@@ -14494,7 +14915,7 @@ import { jsx as jsx113 } from "react/jsx-runtime";
|
|
|
14494
14915
|
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
14495
14916
|
import * as React362 from "react";
|
|
14496
14917
|
import * as ReactDOM4 from "react-dom";
|
|
14497
|
-
import
|
|
14918
|
+
import React112 from "react";
|
|
14498
14919
|
import * as React8 from "react";
|
|
14499
14920
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
14500
14921
|
import * as React9 from "react";
|
|
@@ -14504,7 +14925,7 @@ import { jsx as jsx152 } from "react/jsx-runtime";
|
|
|
14504
14925
|
import * as React122 from "react";
|
|
14505
14926
|
import { jsx as jsx162 } from "react/jsx-runtime";
|
|
14506
14927
|
import * as React16 from "react";
|
|
14507
|
-
import * as
|
|
14928
|
+
import * as React13 from "react";
|
|
14508
14929
|
import * as ReactDOM from "react-dom";
|
|
14509
14930
|
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
14510
14931
|
import * as React14 from "react";
|
|
@@ -14532,8 +14953,8 @@ import * as React282 from "react";
|
|
|
14532
14953
|
import { jsx as jsx232 } from "react/jsx-runtime";
|
|
14533
14954
|
import * as React35 from "react";
|
|
14534
14955
|
import * as React312 from "react";
|
|
14535
|
-
import { useState as useState112 } from "react";
|
|
14536
14956
|
import * as React292 from "react";
|
|
14957
|
+
import { useState as useState112 } from "react";
|
|
14537
14958
|
import * as React30 from "react";
|
|
14538
14959
|
import * as React342 from "react";
|
|
14539
14960
|
import * as React332 from "react";
|
|
@@ -15476,13 +15897,13 @@ function createCollection(name) {
|
|
|
15476
15897
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map });
|
|
15477
15898
|
const CollectionProvider = (props) => {
|
|
15478
15899
|
const { scope, children } = props;
|
|
15479
|
-
const ref =
|
|
15480
|
-
const itemMap =
|
|
15900
|
+
const ref = React112.useRef(null);
|
|
15901
|
+
const itemMap = React112.useRef(/* @__PURE__ */ new Map).current;
|
|
15481
15902
|
return /* @__PURE__ */ jsx152(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
15482
15903
|
};
|
|
15483
15904
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
15484
15905
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
15485
|
-
const CollectionSlot =
|
|
15906
|
+
const CollectionSlot = React112.forwardRef((props, forwardedRef) => {
|
|
15486
15907
|
const { scope, children } = props;
|
|
15487
15908
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
15488
15909
|
const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);
|
|
@@ -15491,12 +15912,12 @@ function createCollection(name) {
|
|
|
15491
15912
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
15492
15913
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
15493
15914
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
15494
|
-
const CollectionItemSlot =
|
|
15915
|
+
const CollectionItemSlot = React112.forwardRef((props, forwardedRef) => {
|
|
15495
15916
|
const { scope, children, ...itemData } = props;
|
|
15496
|
-
const ref =
|
|
15917
|
+
const ref = React112.useRef(null);
|
|
15497
15918
|
const composedRefs = useComposedRefs2(forwardedRef, ref);
|
|
15498
15919
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
15499
|
-
|
|
15920
|
+
React112.useEffect(() => {
|
|
15500
15921
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
15501
15922
|
return () => void context.itemMap.delete(ref);
|
|
15502
15923
|
});
|
|
@@ -15505,7 +15926,7 @@ function createCollection(name) {
|
|
|
15505
15926
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
15506
15927
|
function useCollection(scope) {
|
|
15507
15928
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
15508
|
-
const getItems =
|
|
15929
|
+
const getItems = React112.useCallback(() => {
|
|
15509
15930
|
const collectionNode = context.collectionRef.current;
|
|
15510
15931
|
if (!collectionNode)
|
|
15511
15932
|
return [];
|
|
@@ -15546,7 +15967,7 @@ var NODES = [
|
|
|
15546
15967
|
"ul"
|
|
15547
15968
|
];
|
|
15548
15969
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
15549
|
-
const Node2 =
|
|
15970
|
+
const Node2 = React13.forwardRef((props, forwardedRef) => {
|
|
15550
15971
|
const { asChild, ...primitiveProps } = props;
|
|
15551
15972
|
const Comp = asChild ? Slot2 : node;
|
|
15552
15973
|
if (typeof window !== "undefined") {
|
|
@@ -18288,7 +18709,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
|
18288
18709
|
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
18289
18710
|
};
|
|
18290
18711
|
var __assign = function() {
|
|
18291
|
-
__assign = Object.assign || function
|
|
18712
|
+
__assign = Object.assign || function __assign2(t) {
|
|
18292
18713
|
for (var s, i = 1, n = arguments.length;i < n; i++) {
|
|
18293
18714
|
s = arguments[i];
|
|
18294
18715
|
for (var p in s)
|
|
@@ -20075,17 +20496,17 @@ function createContextScope2(scopeName, createContextScopeDeps = []) {
|
|
|
20075
20496
|
let defaultContexts = [];
|
|
20076
20497
|
function createContext32(rootComponentName, defaultContext) {
|
|
20077
20498
|
const BaseContext = React382.createContext(defaultContext);
|
|
20078
|
-
const
|
|
20499
|
+
const index3 = defaultContexts.length;
|
|
20079
20500
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
20080
20501
|
const Provider = (props) => {
|
|
20081
20502
|
const { scope, children, ...context } = props;
|
|
20082
|
-
const Context = scope?.[scopeName]?.[
|
|
20503
|
+
const Context = scope?.[scopeName]?.[index3] || BaseContext;
|
|
20083
20504
|
const value = React382.useMemo(() => context, Object.values(context));
|
|
20084
20505
|
return /* @__PURE__ */ jsx272(Context.Provider, { value, children });
|
|
20085
20506
|
};
|
|
20086
20507
|
Provider.displayName = rootComponentName + "Provider";
|
|
20087
20508
|
function useContext222(consumerName, scope) {
|
|
20088
|
-
const Context = scope?.[scopeName]?.[
|
|
20509
|
+
const Context = scope?.[scopeName]?.[index3] || BaseContext;
|
|
20089
20510
|
const context = React382.useContext(Context);
|
|
20090
20511
|
if (context)
|
|
20091
20512
|
return context;
|
|
@@ -20282,10 +20703,10 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
20282
20703
|
super.set(key, value);
|
|
20283
20704
|
return this;
|
|
20284
20705
|
}
|
|
20285
|
-
insert(
|
|
20706
|
+
insert(index3, key, value) {
|
|
20286
20707
|
const has = this.has(key);
|
|
20287
20708
|
const length2 = this.#keys.length;
|
|
20288
|
-
const relativeIndex = toSafeInteger(
|
|
20709
|
+
const relativeIndex = toSafeInteger(index3);
|
|
20289
20710
|
let actualIndex = relativeIndex >= 0 ? relativeIndex : length2 + relativeIndex;
|
|
20290
20711
|
const safeIndex = actualIndex < 0 || actualIndex >= length2 ? -1 : actualIndex;
|
|
20291
20712
|
if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {
|
|
@@ -20323,39 +20744,39 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
20323
20744
|
}
|
|
20324
20745
|
return this;
|
|
20325
20746
|
}
|
|
20326
|
-
with(
|
|
20747
|
+
with(index3, key, value) {
|
|
20327
20748
|
const copy = new _OrderedDict(this);
|
|
20328
|
-
copy.insert(
|
|
20749
|
+
copy.insert(index3, key, value);
|
|
20329
20750
|
return copy;
|
|
20330
20751
|
}
|
|
20331
20752
|
before(key) {
|
|
20332
|
-
const
|
|
20333
|
-
if (
|
|
20753
|
+
const index3 = this.#keys.indexOf(key) - 1;
|
|
20754
|
+
if (index3 < 0) {
|
|
20334
20755
|
return;
|
|
20335
20756
|
}
|
|
20336
|
-
return this.entryAt(
|
|
20757
|
+
return this.entryAt(index3);
|
|
20337
20758
|
}
|
|
20338
20759
|
setBefore(key, newKey, value) {
|
|
20339
|
-
const
|
|
20340
|
-
if (
|
|
20760
|
+
const index3 = this.#keys.indexOf(key);
|
|
20761
|
+
if (index3 === -1) {
|
|
20341
20762
|
return this;
|
|
20342
20763
|
}
|
|
20343
|
-
return this.insert(
|
|
20764
|
+
return this.insert(index3, newKey, value);
|
|
20344
20765
|
}
|
|
20345
20766
|
after(key) {
|
|
20346
|
-
let
|
|
20347
|
-
|
|
20348
|
-
if (
|
|
20767
|
+
let index3 = this.#keys.indexOf(key);
|
|
20768
|
+
index3 = index3 === -1 || index3 === this.size - 1 ? -1 : index3 + 1;
|
|
20769
|
+
if (index3 === -1) {
|
|
20349
20770
|
return;
|
|
20350
20771
|
}
|
|
20351
|
-
return this.entryAt(
|
|
20772
|
+
return this.entryAt(index3);
|
|
20352
20773
|
}
|
|
20353
20774
|
setAfter(key, newKey, value) {
|
|
20354
|
-
const
|
|
20355
|
-
if (
|
|
20775
|
+
const index3 = this.#keys.indexOf(key);
|
|
20776
|
+
if (index3 === -1) {
|
|
20356
20777
|
return this;
|
|
20357
20778
|
}
|
|
20358
|
-
return this.insert(
|
|
20779
|
+
return this.insert(index3 + 1, newKey, value);
|
|
20359
20780
|
}
|
|
20360
20781
|
first() {
|
|
20361
20782
|
return this.entryAt(0);
|
|
@@ -20374,21 +20795,21 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
20374
20795
|
}
|
|
20375
20796
|
return deleted;
|
|
20376
20797
|
}
|
|
20377
|
-
deleteAt(
|
|
20378
|
-
const key = this.keyAt(
|
|
20798
|
+
deleteAt(index3) {
|
|
20799
|
+
const key = this.keyAt(index3);
|
|
20379
20800
|
if (key !== undefined) {
|
|
20380
20801
|
return this.delete(key);
|
|
20381
20802
|
}
|
|
20382
20803
|
return false;
|
|
20383
20804
|
}
|
|
20384
|
-
at(
|
|
20385
|
-
const key = at(this.#keys,
|
|
20805
|
+
at(index3) {
|
|
20806
|
+
const key = at(this.#keys, index3);
|
|
20386
20807
|
if (key !== undefined) {
|
|
20387
20808
|
return this.get(key);
|
|
20388
20809
|
}
|
|
20389
20810
|
}
|
|
20390
|
-
entryAt(
|
|
20391
|
-
const key = at(this.#keys,
|
|
20811
|
+
entryAt(index3) {
|
|
20812
|
+
const key = at(this.#keys, index3);
|
|
20392
20813
|
if (key !== undefined) {
|
|
20393
20814
|
return [key, this.get(key)];
|
|
20394
20815
|
}
|
|
@@ -20396,15 +20817,15 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
20396
20817
|
indexOf(key) {
|
|
20397
20818
|
return this.#keys.indexOf(key);
|
|
20398
20819
|
}
|
|
20399
|
-
keyAt(
|
|
20400
|
-
return at(this.#keys,
|
|
20820
|
+
keyAt(index3) {
|
|
20821
|
+
return at(this.#keys, index3);
|
|
20401
20822
|
}
|
|
20402
20823
|
from(key, offset4) {
|
|
20403
|
-
const
|
|
20404
|
-
if (
|
|
20824
|
+
const index3 = this.indexOf(key);
|
|
20825
|
+
if (index3 === -1) {
|
|
20405
20826
|
return;
|
|
20406
20827
|
}
|
|
20407
|
-
let dest =
|
|
20828
|
+
let dest = index3 + offset4;
|
|
20408
20829
|
if (dest < 0)
|
|
20409
20830
|
dest = 0;
|
|
20410
20831
|
if (dest >= this.size)
|
|
@@ -20412,11 +20833,11 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
20412
20833
|
return this.at(dest);
|
|
20413
20834
|
}
|
|
20414
20835
|
keyFrom(key, offset4) {
|
|
20415
|
-
const
|
|
20416
|
-
if (
|
|
20836
|
+
const index3 = this.indexOf(key);
|
|
20837
|
+
if (index3 === -1) {
|
|
20417
20838
|
return;
|
|
20418
20839
|
}
|
|
20419
|
-
let dest =
|
|
20840
|
+
let dest = index3 + offset4;
|
|
20420
20841
|
if (dest < 0)
|
|
20421
20842
|
dest = 0;
|
|
20422
20843
|
if (dest >= this.size)
|
|
@@ -20424,68 +20845,68 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
20424
20845
|
return this.keyAt(dest);
|
|
20425
20846
|
}
|
|
20426
20847
|
find(predicate, thisArg) {
|
|
20427
|
-
let
|
|
20848
|
+
let index3 = 0;
|
|
20428
20849
|
for (const entry of this) {
|
|
20429
|
-
if (Reflect.apply(predicate, thisArg, [entry,
|
|
20850
|
+
if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
|
|
20430
20851
|
return entry;
|
|
20431
20852
|
}
|
|
20432
|
-
|
|
20853
|
+
index3++;
|
|
20433
20854
|
}
|
|
20434
20855
|
return;
|
|
20435
20856
|
}
|
|
20436
20857
|
findIndex(predicate, thisArg) {
|
|
20437
|
-
let
|
|
20858
|
+
let index3 = 0;
|
|
20438
20859
|
for (const entry of this) {
|
|
20439
|
-
if (Reflect.apply(predicate, thisArg, [entry,
|
|
20440
|
-
return
|
|
20860
|
+
if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
|
|
20861
|
+
return index3;
|
|
20441
20862
|
}
|
|
20442
|
-
|
|
20863
|
+
index3++;
|
|
20443
20864
|
}
|
|
20444
20865
|
return -1;
|
|
20445
20866
|
}
|
|
20446
20867
|
filter(predicate, thisArg) {
|
|
20447
20868
|
const entries = [];
|
|
20448
|
-
let
|
|
20869
|
+
let index3 = 0;
|
|
20449
20870
|
for (const entry of this) {
|
|
20450
|
-
if (Reflect.apply(predicate, thisArg, [entry,
|
|
20871
|
+
if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
|
|
20451
20872
|
entries.push(entry);
|
|
20452
20873
|
}
|
|
20453
|
-
|
|
20874
|
+
index3++;
|
|
20454
20875
|
}
|
|
20455
20876
|
return new _OrderedDict(entries);
|
|
20456
20877
|
}
|
|
20457
20878
|
map(callbackfn, thisArg) {
|
|
20458
20879
|
const entries = [];
|
|
20459
|
-
let
|
|
20880
|
+
let index3 = 0;
|
|
20460
20881
|
for (const entry of this) {
|
|
20461
|
-
entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry,
|
|
20462
|
-
|
|
20882
|
+
entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index3, this])]);
|
|
20883
|
+
index3++;
|
|
20463
20884
|
}
|
|
20464
20885
|
return new _OrderedDict(entries);
|
|
20465
20886
|
}
|
|
20466
20887
|
reduce(...args) {
|
|
20467
20888
|
const [callbackfn, initialValue] = args;
|
|
20468
|
-
let
|
|
20889
|
+
let index3 = 0;
|
|
20469
20890
|
let accumulator = initialValue ?? this.at(0);
|
|
20470
20891
|
for (const entry of this) {
|
|
20471
|
-
if (
|
|
20892
|
+
if (index3 === 0 && args.length === 1) {
|
|
20472
20893
|
accumulator = entry;
|
|
20473
20894
|
} else {
|
|
20474
|
-
accumulator = Reflect.apply(callbackfn, this, [accumulator, entry,
|
|
20895
|
+
accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index3, this]);
|
|
20475
20896
|
}
|
|
20476
|
-
|
|
20897
|
+
index3++;
|
|
20477
20898
|
}
|
|
20478
20899
|
return accumulator;
|
|
20479
20900
|
}
|
|
20480
20901
|
reduceRight(...args) {
|
|
20481
20902
|
const [callbackfn, initialValue] = args;
|
|
20482
20903
|
let accumulator = initialValue ?? this.at(-1);
|
|
20483
|
-
for (let
|
|
20484
|
-
const entry = this.at(
|
|
20485
|
-
if (
|
|
20904
|
+
for (let index3 = this.size - 1;index3 >= 0; index3--) {
|
|
20905
|
+
const entry = this.at(index3);
|
|
20906
|
+
if (index3 === this.size - 1 && args.length === 1) {
|
|
20486
20907
|
accumulator = entry;
|
|
20487
20908
|
} else {
|
|
20488
|
-
accumulator = Reflect.apply(callbackfn, this, [accumulator, entry,
|
|
20909
|
+
accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index3, this]);
|
|
20489
20910
|
}
|
|
20490
20911
|
}
|
|
20491
20912
|
return accumulator;
|
|
@@ -20496,8 +20917,8 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
20496
20917
|
}
|
|
20497
20918
|
toReversed() {
|
|
20498
20919
|
const reversed = new _OrderedDict;
|
|
20499
|
-
for (let
|
|
20500
|
-
const key = this.keyAt(
|
|
20920
|
+
for (let index3 = this.size - 1;index3 >= 0; index3--) {
|
|
20921
|
+
const key = this.keyAt(index3);
|
|
20501
20922
|
const element = this.get(key);
|
|
20502
20923
|
reversed.set(key, element);
|
|
20503
20924
|
}
|
|
@@ -20520,44 +20941,44 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
20520
20941
|
if (end !== undefined && end > 0) {
|
|
20521
20942
|
stop = end - 1;
|
|
20522
20943
|
}
|
|
20523
|
-
for (let
|
|
20524
|
-
const key = this.keyAt(
|
|
20944
|
+
for (let index3 = start;index3 <= stop; index3++) {
|
|
20945
|
+
const key = this.keyAt(index3);
|
|
20525
20946
|
const element = this.get(key);
|
|
20526
20947
|
result.set(key, element);
|
|
20527
20948
|
}
|
|
20528
20949
|
return result;
|
|
20529
20950
|
}
|
|
20530
20951
|
every(predicate, thisArg) {
|
|
20531
|
-
let
|
|
20952
|
+
let index3 = 0;
|
|
20532
20953
|
for (const entry of this) {
|
|
20533
|
-
if (!Reflect.apply(predicate, thisArg, [entry,
|
|
20954
|
+
if (!Reflect.apply(predicate, thisArg, [entry, index3, this])) {
|
|
20534
20955
|
return false;
|
|
20535
20956
|
}
|
|
20536
|
-
|
|
20957
|
+
index3++;
|
|
20537
20958
|
}
|
|
20538
20959
|
return true;
|
|
20539
20960
|
}
|
|
20540
20961
|
some(predicate, thisArg) {
|
|
20541
|
-
let
|
|
20962
|
+
let index3 = 0;
|
|
20542
20963
|
for (const entry of this) {
|
|
20543
|
-
if (Reflect.apply(predicate, thisArg, [entry,
|
|
20964
|
+
if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
|
|
20544
20965
|
return true;
|
|
20545
20966
|
}
|
|
20546
|
-
|
|
20967
|
+
index3++;
|
|
20547
20968
|
}
|
|
20548
20969
|
return false;
|
|
20549
20970
|
}
|
|
20550
20971
|
};
|
|
20551
|
-
function at(array,
|
|
20972
|
+
function at(array, index3) {
|
|
20552
20973
|
if ("at" in Array.prototype) {
|
|
20553
|
-
return Array.prototype.at.call(array,
|
|
20974
|
+
return Array.prototype.at.call(array, index3);
|
|
20554
20975
|
}
|
|
20555
|
-
const actualIndex = toSafeIndex(array,
|
|
20976
|
+
const actualIndex = toSafeIndex(array, index3);
|
|
20556
20977
|
return actualIndex === -1 ? undefined : array[actualIndex];
|
|
20557
20978
|
}
|
|
20558
|
-
function toSafeIndex(array,
|
|
20979
|
+
function toSafeIndex(array, index3) {
|
|
20559
20980
|
const length2 = array.length;
|
|
20560
|
-
const relativeIndex = toSafeInteger(
|
|
20981
|
+
const relativeIndex = toSafeInteger(index3);
|
|
20561
20982
|
const actualIndex = relativeIndex >= 0 ? relativeIndex : length2 + relativeIndex;
|
|
20562
20983
|
return actualIndex < 0 || actualIndex >= length2 ? -1 : actualIndex;
|
|
20563
20984
|
}
|
|
@@ -20609,7 +21030,7 @@ var Primitive2 = NODES2.reduce((primitive, node) => {
|
|
|
20609
21030
|
Node2.displayName = `Primitive.${node}`;
|
|
20610
21031
|
return { ...primitive, [node]: Node2 };
|
|
20611
21032
|
}, {});
|
|
20612
|
-
function
|
|
21033
|
+
function useCallbackRef4(callback) {
|
|
20613
21034
|
const callbackRef = React44.useRef(callback);
|
|
20614
21035
|
React44.useEffect(() => {
|
|
20615
21036
|
callbackRef.current = callback;
|
|
@@ -20713,7 +21134,7 @@ var RovingFocusGroupImpl = React47.forwardRef((props, forwardedRef) => {
|
|
|
20713
21134
|
caller: GROUP_NAME2
|
|
20714
21135
|
});
|
|
20715
21136
|
const [isTabbingBackOut, setIsTabbingBackOut] = React47.useState(false);
|
|
20716
|
-
const handleEntryFocus =
|
|
21137
|
+
const handleEntryFocus = useCallbackRef4(onEntryFocus);
|
|
20717
21138
|
const getItems = useCollection2(__scopeRovingFocusGroup);
|
|
20718
21139
|
const isClickFocusRef = React47.useRef(false);
|
|
20719
21140
|
const [focusableItemsCount, setFocusableItemsCount] = React47.useState(0);
|
|
@@ -20866,7 +21287,7 @@ function focusFirst2(candidates, preventScroll = false) {
|
|
|
20866
21287
|
}
|
|
20867
21288
|
}
|
|
20868
21289
|
function wrapArray2(array, startIndex) {
|
|
20869
|
-
return array.map((_,
|
|
21290
|
+
return array.map((_, index3) => array[(startIndex + index3) % array.length]);
|
|
20870
21291
|
}
|
|
20871
21292
|
var Root3 = RovingFocusGroup;
|
|
20872
21293
|
var Item2 = RovingFocusGroupItem;
|
|
@@ -21181,10 +21602,10 @@ var Triangle2 = (props) => {
|
|
|
21181
21602
|
};
|
|
21182
21603
|
|
|
21183
21604
|
// src/components/design.tsx
|
|
21184
|
-
import { useCallback as
|
|
21605
|
+
import { useCallback as useCallback33, useState as useState41 } from "react";
|
|
21185
21606
|
|
|
21186
21607
|
// src/components/ManageTeamMembers.tsx
|
|
21187
|
-
import React53, { useCallback as
|
|
21608
|
+
import React53, { useCallback as useCallback32, useState as useState40 } from "react";
|
|
21188
21609
|
import { jsx as jsx40, jsxs as jsxs6, Fragment as Fragment9 } from "react/jsx-runtime";
|
|
21189
21610
|
function generateId() {
|
|
21190
21611
|
return Math.random().toString(36).substr(2, 9);
|
|
@@ -21230,7 +21651,7 @@ var Row = ({ value, onChange, onDelete, disableDelete }) => {
|
|
|
21230
21651
|
var ManageTeamMembers = () => {
|
|
21231
21652
|
const [members, setMembers] = useState40(initialMembers);
|
|
21232
21653
|
const displayedMembers = [...members, { id: "NEW", name: "" }];
|
|
21233
|
-
const updateMember =
|
|
21654
|
+
const updateMember = useCallback32((idx, value) => {
|
|
21234
21655
|
if (idx === members.length) {
|
|
21235
21656
|
if (value.trim() !== "") {
|
|
21236
21657
|
setMembers((prev) => [...prev, { id: generateId(), name: value }]);
|
|
@@ -21239,11 +21660,11 @@ var ManageTeamMembers = () => {
|
|
|
21239
21660
|
setMembers((prev) => prev.map((m, i) => i === idx ? { ...m, name: value } : m));
|
|
21240
21661
|
}
|
|
21241
21662
|
}, [members.length]);
|
|
21242
|
-
const deleteMember =
|
|
21663
|
+
const deleteMember = useCallback32((idx) => {
|
|
21243
21664
|
setMembers((prev) => prev.filter((_, i) => i !== idx));
|
|
21244
21665
|
}, []);
|
|
21245
21666
|
const [loading, setLoading] = useState40(false);
|
|
21246
|
-
const save =
|
|
21667
|
+
const save = useCallback32(() => {
|
|
21247
21668
|
setLoading(true);
|
|
21248
21669
|
setTimeout(() => {
|
|
21249
21670
|
setLoading(false);
|
|
@@ -21302,20 +21723,20 @@ var DesignPage = () => {
|
|
|
21302
21723
|
const [active, setActive] = useState41(false);
|
|
21303
21724
|
const [submitButtonActive, setSubmitButtonActive] = useState41(true);
|
|
21304
21725
|
const [submitButtonPrimaryActive, setSubmitButtonPrimaryActive] = useState41(true);
|
|
21305
|
-
const onClick =
|
|
21726
|
+
const onClick = useCallback33(() => {
|
|
21306
21727
|
setSubmitButtonActive(false);
|
|
21307
21728
|
setTimeout(() => {
|
|
21308
21729
|
setSubmitButtonActive(true);
|
|
21309
21730
|
}, 1000);
|
|
21310
21731
|
}, []);
|
|
21311
|
-
const onClickPrimary =
|
|
21732
|
+
const onClickPrimary = useCallback33(() => {
|
|
21312
21733
|
setSubmitButtonPrimaryActive(false);
|
|
21313
21734
|
setTimeout(() => {
|
|
21314
21735
|
setSubmitButtonPrimaryActive(true);
|
|
21315
21736
|
}, 1000);
|
|
21316
21737
|
}, []);
|
|
21317
21738
|
const [saving, setSaving] = useState41(false);
|
|
21318
|
-
const save =
|
|
21739
|
+
const save = useCallback33(() => {
|
|
21319
21740
|
setSaving(true);
|
|
21320
21741
|
setTimeout(() => {
|
|
21321
21742
|
setSaving(false);
|