@remotion/promo-pages 4.0.431 → 4.0.433
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 +4671 -2145
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/Homepage.js +4671 -2145
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/design.js +1154 -907
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/experts.js +1084 -838
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/homepage/Pricing.js +1147 -900
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsGallery.js +1152 -905
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsShow.js +1231 -984
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsSubmit.js +1237 -990
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/template-modal-content.js +1151 -904
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/templates.js +1141 -894
- package/dist/design.js +1154 -907
- package/dist/experts.js +1084 -838
- package/dist/homepage/Pricing.js +1147 -900
- package/dist/prompts/PromptsGallery.js +1152 -905
- package/dist/prompts/PromptsShow.js +1231 -984
- package/dist/prompts/PromptsSubmit.js +1237 -990
- package/dist/template-modal-content.js +1151 -904
- package/dist/templates.js +1141 -894
- package/package.json +18 -14
- 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 -263
- 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 -134
- 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 -112
- package/dist/components/homepage/IfYouKnowReact.d.ts +0 -3
- package/dist/components/homepage/IfYouKnowReact.js +0 -23
- package/dist/components/homepage/InfoTooltip.d.ts +0 -6
- package/dist/components/homepage/InfoTooltip.js +0 -6
- 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/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/tts.d.ts +0 -3
- package/dist/components/icons/tts.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.d.ts +0 -3
- package/dist/components/team.js +0 -14
- package/dist/components/template-modal-content.d.ts +0 -5
- package/dist/components/template-modal-content.js +0 -73
- package/dist/components/templates.d.ts +0 -2
- package/dist/components/templates.js +0 -27
- package/dist/helpers/mobile-layout.d.ts +0 -1
- package/dist/helpers/mobile-layout.js +0 -6
- package/dist/helpers/use-el-size.d.ts +0 -5
- package/dist/helpers/use-el-size.js +0 -40
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -6
- package/dist/prompts-show.d.ts +0 -1
- package/dist/prompts-show.js +0 -20
- package/dist/prompts-submit.d.ts +0 -1
- package/dist/prompts-submit.js +0 -6
- package/dist/prompts.d.ts +0 -1
- package/dist/prompts.js +0 -6
- package/dist/team.d.ts +0 -1
|
@@ -33,7 +33,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
// ../design/dist/esm/index.mjs
|
|
36
|
-
import { useCallback as
|
|
36
|
+
import { useCallback as useCallback18, useRef as useRef22, useState as useState22 } from "react";
|
|
37
37
|
|
|
38
38
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
39
39
|
function r(e) {
|
|
@@ -1375,7 +1375,7 @@ var getDefaultConfig = () => {
|
|
|
1375
1375
|
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
1376
1376
|
|
|
1377
1377
|
// ../design/dist/esm/index.mjs
|
|
1378
|
-
import
|
|
1378
|
+
import React4, { useEffect as useEffect18, useMemo as useMemo36, useState as useState19 } from "react";
|
|
1379
1379
|
|
|
1380
1380
|
// ../paths/dist/esm/index.mjs
|
|
1381
1381
|
var cutLInstruction = ({
|
|
@@ -4152,46 +4152,7 @@ import { jsx as jsx6 } from "react/jsx-runtime";
|
|
|
4152
4152
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
4153
4153
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
4154
4154
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
4155
|
-
|
|
4156
|
-
const instructions = [
|
|
4157
|
-
{
|
|
4158
|
-
type: "M",
|
|
4159
|
-
x: radius,
|
|
4160
|
-
y: 0
|
|
4161
|
-
},
|
|
4162
|
-
{
|
|
4163
|
-
type: "a",
|
|
4164
|
-
rx: radius,
|
|
4165
|
-
ry: radius,
|
|
4166
|
-
xAxisRotation: 0,
|
|
4167
|
-
largeArcFlag: true,
|
|
4168
|
-
sweepFlag: true,
|
|
4169
|
-
dx: 0,
|
|
4170
|
-
dy: radius * 2
|
|
4171
|
-
},
|
|
4172
|
-
{
|
|
4173
|
-
type: "a",
|
|
4174
|
-
rx: radius,
|
|
4175
|
-
ry: radius,
|
|
4176
|
-
xAxisRotation: 0,
|
|
4177
|
-
largeArcFlag: true,
|
|
4178
|
-
sweepFlag: true,
|
|
4179
|
-
dx: 0,
|
|
4180
|
-
dy: -radius * 2
|
|
4181
|
-
},
|
|
4182
|
-
{
|
|
4183
|
-
type: "Z"
|
|
4184
|
-
}
|
|
4185
|
-
];
|
|
4186
|
-
const path = serializeInstructions(instructions);
|
|
4187
|
-
return {
|
|
4188
|
-
height: radius * 2,
|
|
4189
|
-
width: radius * 2,
|
|
4190
|
-
path,
|
|
4191
|
-
instructions,
|
|
4192
|
-
transformOrigin: `${radius} ${radius}`
|
|
4193
|
-
};
|
|
4194
|
-
};
|
|
4155
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
4195
4156
|
var doesReactSupportTransformOriginProperty = (version2) => {
|
|
4196
4157
|
if (version2.includes("canary") || version2.includes("experimental")) {
|
|
4197
4158
|
const last8Chars = parseInt(version2.slice(-8), 10);
|
|
@@ -4285,6 +4246,46 @@ var RenderSvg = ({
|
|
|
4285
4246
|
]
|
|
4286
4247
|
});
|
|
4287
4248
|
};
|
|
4249
|
+
var makeCircle = ({ radius }) => {
|
|
4250
|
+
const instructions = [
|
|
4251
|
+
{
|
|
4252
|
+
type: "M",
|
|
4253
|
+
x: radius,
|
|
4254
|
+
y: 0
|
|
4255
|
+
},
|
|
4256
|
+
{
|
|
4257
|
+
type: "a",
|
|
4258
|
+
rx: radius,
|
|
4259
|
+
ry: radius,
|
|
4260
|
+
xAxisRotation: 0,
|
|
4261
|
+
largeArcFlag: true,
|
|
4262
|
+
sweepFlag: true,
|
|
4263
|
+
dx: 0,
|
|
4264
|
+
dy: radius * 2
|
|
4265
|
+
},
|
|
4266
|
+
{
|
|
4267
|
+
type: "a",
|
|
4268
|
+
rx: radius,
|
|
4269
|
+
ry: radius,
|
|
4270
|
+
xAxisRotation: 0,
|
|
4271
|
+
largeArcFlag: true,
|
|
4272
|
+
sweepFlag: true,
|
|
4273
|
+
dx: 0,
|
|
4274
|
+
dy: -radius * 2
|
|
4275
|
+
},
|
|
4276
|
+
{
|
|
4277
|
+
type: "Z"
|
|
4278
|
+
}
|
|
4279
|
+
];
|
|
4280
|
+
const path = serializeInstructions(instructions);
|
|
4281
|
+
return {
|
|
4282
|
+
height: radius * 2,
|
|
4283
|
+
width: radius * 2,
|
|
4284
|
+
path,
|
|
4285
|
+
instructions,
|
|
4286
|
+
transformOrigin: `${radius} ${radius}`
|
|
4287
|
+
};
|
|
4288
|
+
};
|
|
4288
4289
|
var makeHeart = ({
|
|
4289
4290
|
height,
|
|
4290
4291
|
aspectRatio = 1.1,
|
|
@@ -4381,7 +4382,7 @@ var Heart = ({
|
|
|
4381
4382
|
depthAdjustment = 0,
|
|
4382
4383
|
...props
|
|
4383
4384
|
}) => {
|
|
4384
|
-
return /* @__PURE__ */
|
|
4385
|
+
return /* @__PURE__ */ jsx5(RenderSvg, {
|
|
4385
4386
|
...makeHeart({
|
|
4386
4387
|
aspectRatio,
|
|
4387
4388
|
height,
|
|
@@ -5714,41 +5715,41 @@ var extrudeAndTransformElement = (options) => {
|
|
|
5714
5715
|
// ../core/dist/esm/index.mjs
|
|
5715
5716
|
import { createContext } from "react";
|
|
5716
5717
|
import { createContext as createContext2, useContext } from "react";
|
|
5717
|
-
import { jsx as
|
|
5718
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
5718
5719
|
import {
|
|
5719
5720
|
forwardRef as forwardRef2,
|
|
5720
5721
|
useContext as useContext13,
|
|
5721
|
-
useEffect
|
|
5722
|
-
useMemo as
|
|
5723
|
-
useState as
|
|
5722
|
+
useEffect,
|
|
5723
|
+
useMemo as useMemo11,
|
|
5724
|
+
useState as useState4
|
|
5724
5725
|
} from "react";
|
|
5725
5726
|
import { forwardRef, useMemo as useMemo2 } from "react";
|
|
5726
5727
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
5727
5728
|
import { useContext as useContext11, useMemo as useMemo8 } from "react";
|
|
5728
5729
|
import { createContext as createContext3 } from "react";
|
|
5730
|
+
import { useContext as useContext7, useMemo as useMemo6 } from "react";
|
|
5729
5731
|
import {
|
|
5730
|
-
createContext as
|
|
5732
|
+
createContext as createContext6,
|
|
5731
5733
|
useLayoutEffect,
|
|
5732
|
-
useMemo as
|
|
5734
|
+
useMemo as useMemo22,
|
|
5733
5735
|
useRef,
|
|
5734
5736
|
useState as useState2
|
|
5735
5737
|
} from "react";
|
|
5736
|
-
import {
|
|
5737
|
-
import { useContext as useContext2, useState } from "react";
|
|
5738
|
-
import React2 from "react";
|
|
5739
|
-
import { useContext as useContext4, useMemo as useMemo4 } from "react";
|
|
5738
|
+
import { createContext as createContext5, useCallback, useContext as useContext4 } from "react";
|
|
5740
5739
|
import { createContext as createContext4 } from "react";
|
|
5741
|
-
import
|
|
5742
|
-
import
|
|
5743
|
-
|
|
5744
|
-
useCallback,
|
|
5745
|
-
useImperativeHandle,
|
|
5746
|
-
useMemo as useMemo22
|
|
5747
|
-
} from "react";
|
|
5740
|
+
import * as React2 from "react";
|
|
5741
|
+
import { useContext as useContext3, useState } from "react";
|
|
5742
|
+
import React3 from "react";
|
|
5748
5743
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
5749
|
-
import {
|
|
5744
|
+
import { useContext as useContext6, useMemo as useMemo5 } from "react";
|
|
5750
5745
|
import { createContext as createContext7 } from "react";
|
|
5751
|
-
import
|
|
5746
|
+
import { createContext as createContext9, createRef, useContext as useContext5, useMemo as useMemo4 } from "react";
|
|
5747
|
+
import React5, {
|
|
5748
|
+
createContext as createContext8,
|
|
5749
|
+
useCallback as useCallback2,
|
|
5750
|
+
useImperativeHandle,
|
|
5751
|
+
useMemo as useMemo3
|
|
5752
|
+
} from "react";
|
|
5752
5753
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
5753
5754
|
import { useContext as useContext8 } from "react";
|
|
5754
5755
|
import { createContext as createContext10 } from "react";
|
|
@@ -5756,114 +5757,114 @@ import { jsx as jsx52 } from "react/jsx-runtime";
|
|
|
5756
5757
|
import { useContext as useContext10 } from "react";
|
|
5757
5758
|
import { useContext as useContext9, useMemo as useMemo7 } from "react";
|
|
5758
5759
|
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
5759
|
-
import { createContext as createContext11, useContext as useContext12,
|
|
5760
|
+
import { createContext as createContext11, useCallback as useCallback3, useContext as useContext12, useMemo as useMemo9, useRef as useRef2 } from "react";
|
|
5760
5761
|
import { createContext as createContext12 } from "react";
|
|
5761
|
-
import React8, { useCallback as
|
|
5762
|
+
import React8, { useCallback as useCallback4, useMemo as useMemo10, useRef as useRef3, useState as useState3 } from "react";
|
|
5762
5763
|
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
5763
5764
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
5764
5765
|
import {
|
|
5765
5766
|
forwardRef as forwardRef3,
|
|
5766
|
-
useEffect as
|
|
5767
|
+
useEffect as useEffect2,
|
|
5767
5768
|
useImperativeHandle as useImperativeHandle3,
|
|
5768
5769
|
useLayoutEffect as useLayoutEffect2,
|
|
5769
5770
|
useRef as useRef5,
|
|
5770
|
-
useState as
|
|
5771
|
+
useState as useState5
|
|
5771
5772
|
} from "react";
|
|
5772
|
-
import React10, { useCallback as
|
|
5773
|
+
import React10, { useCallback as useCallback5, useImperativeHandle as useImperativeHandle2, useRef as useRef4 } from "react";
|
|
5773
5774
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5774
5775
|
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
5775
|
-
import { useContext as useContext14, useLayoutEffect as useLayoutEffect4, useState as
|
|
5776
|
+
import { useContext as useContext14, useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
|
|
5776
5777
|
import {
|
|
5777
5778
|
createContext as createContext13,
|
|
5778
|
-
useCallback as
|
|
5779
|
+
useCallback as useCallback6,
|
|
5779
5780
|
useImperativeHandle as useImperativeHandle4,
|
|
5780
5781
|
useLayoutEffect as useLayoutEffect3,
|
|
5781
|
-
useMemo as
|
|
5782
|
+
useMemo as useMemo12,
|
|
5782
5783
|
useRef as useRef6,
|
|
5783
|
-
useState as
|
|
5784
|
+
useState as useState6
|
|
5784
5785
|
} from "react";
|
|
5785
|
-
import { jsx as
|
|
5786
|
-
import { forwardRef as forwardRef6, useCallback as
|
|
5787
|
-
import React11, { createContext as createContext14, useMemo as
|
|
5786
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
5787
|
+
import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext26 } from "react";
|
|
5788
|
+
import React11, { createContext as createContext14, useMemo as useMemo13 } from "react";
|
|
5788
5789
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5789
5790
|
import { useContext as useContext15 } from "react";
|
|
5790
|
-
import { createContext as createContext15, useEffect as
|
|
5791
|
+
import { createContext as createContext15, useEffect as useEffect3, useState as useState8 } from "react";
|
|
5791
5792
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
5792
|
-
import { createContext as createContext16, useMemo as
|
|
5793
|
+
import { createContext as createContext16, useMemo as useMemo14, useReducer } from "react";
|
|
5793
5794
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
5794
5795
|
import React17, {
|
|
5795
5796
|
forwardRef as forwardRef4,
|
|
5796
|
-
useContext as
|
|
5797
|
-
useEffect as
|
|
5797
|
+
useContext as useContext24,
|
|
5798
|
+
useEffect as useEffect10,
|
|
5798
5799
|
useImperativeHandle as useImperativeHandle5,
|
|
5799
|
-
useMemo as
|
|
5800
|
+
useMemo as useMemo222,
|
|
5800
5801
|
useRef as useRef14,
|
|
5801
|
-
useState as
|
|
5802
|
+
useState as useState13
|
|
5802
5803
|
} from "react";
|
|
5803
5804
|
import { useContext as useContext17, useLayoutEffect as useLayoutEffect5, useRef as useRef9 } from "react";
|
|
5804
5805
|
import React14, {
|
|
5805
5806
|
createContext as createContext17,
|
|
5806
5807
|
createRef as createRef2,
|
|
5807
|
-
useCallback as
|
|
5808
|
+
useCallback as useCallback7,
|
|
5808
5809
|
useContext as useContext16,
|
|
5809
|
-
useMemo as
|
|
5810
|
+
useMemo as useMemo16,
|
|
5810
5811
|
useRef as useRef7,
|
|
5811
|
-
useState as
|
|
5812
|
+
useState as useState9
|
|
5812
5813
|
} from "react";
|
|
5813
|
-
import { useMemo as
|
|
5814
|
+
import { useMemo as useMemo15 } from "react";
|
|
5814
5815
|
import { jsx as jsx15, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
5815
5816
|
import { useRef as useRef8 } from "react";
|
|
5816
|
-
import { useContext as useContext19, useEffect as
|
|
5817
|
+
import { useContext as useContext19, useEffect as useEffect4, useMemo as useMemo17, useState as useState10 } from "react";
|
|
5817
5818
|
import { useContext as useContext18 } from "react";
|
|
5818
5819
|
import {
|
|
5819
|
-
useCallback as
|
|
5820
|
+
useCallback as useCallback10,
|
|
5820
5821
|
useContext as useContext22,
|
|
5821
|
-
useEffect as
|
|
5822
|
+
useEffect as useEffect8,
|
|
5822
5823
|
useLayoutEffect as useLayoutEffect7,
|
|
5823
5824
|
useRef as useRef13
|
|
5824
5825
|
} from "react";
|
|
5825
|
-
import { useCallback as
|
|
5826
|
-
import { useContext as useContext21, useMemo as
|
|
5826
|
+
import { useCallback as useCallback9, useMemo as useMemo20, useRef as useRef11 } from "react";
|
|
5827
|
+
import { useContext as useContext21, useMemo as useMemo19 } from "react";
|
|
5827
5828
|
import React15, {
|
|
5828
|
-
useCallback as
|
|
5829
|
+
useCallback as useCallback8,
|
|
5829
5830
|
useContext as useContext20,
|
|
5830
|
-
useEffect as
|
|
5831
|
+
useEffect as useEffect5,
|
|
5831
5832
|
useLayoutEffect as useLayoutEffect6,
|
|
5832
|
-
useMemo as
|
|
5833
|
+
useMemo as useMemo18,
|
|
5833
5834
|
useRef as useRef10,
|
|
5834
|
-
useState as
|
|
5835
|
+
useState as useState11
|
|
5835
5836
|
} from "react";
|
|
5836
5837
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5837
5838
|
import React16 from "react";
|
|
5838
|
-
import { useEffect as
|
|
5839
|
-
import { useEffect as
|
|
5840
|
-
import {
|
|
5841
|
-
import { createContext as createContext18, useContext as
|
|
5839
|
+
import { useEffect as useEffect6, useState as useState12 } from "react";
|
|
5840
|
+
import { useEffect as useEffect7, useRef as useRef12 } from "react";
|
|
5841
|
+
import { useEffect as useEffect9 } from "react";
|
|
5842
|
+
import { createContext as createContext18, useContext as useContext23, useMemo as useMemo21 } from "react";
|
|
5842
5843
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5843
5844
|
import {
|
|
5844
5845
|
forwardRef as forwardRef5,
|
|
5845
|
-
useContext as
|
|
5846
|
-
useEffect as
|
|
5846
|
+
useContext as useContext25,
|
|
5847
|
+
useEffect as useEffect11,
|
|
5847
5848
|
useImperativeHandle as useImperativeHandle6,
|
|
5848
5849
|
useLayoutEffect as useLayoutEffect8,
|
|
5849
|
-
useMemo as
|
|
5850
|
+
useMemo as useMemo23,
|
|
5850
5851
|
useRef as useRef15
|
|
5851
5852
|
} from "react";
|
|
5852
5853
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
5853
5854
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
5854
|
-
import { Suspense, useContext as
|
|
5855
|
+
import { Suspense, useContext as useContext28, useEffect as useEffect13 } from "react";
|
|
5855
5856
|
import { createPortal } from "react-dom";
|
|
5856
|
-
import { createContext as createContext19, useContext as
|
|
5857
|
+
import { createContext as createContext19, useContext as useContext27, useEffect as useEffect12, useMemo as useMemo24 } from "react";
|
|
5857
5858
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
5858
5859
|
import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5859
|
-
import React20, { useMemo as
|
|
5860
|
+
import React20, { useMemo as useMemo25, useRef as useRef16 } from "react";
|
|
5860
5861
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
5861
|
-
import { forwardRef as forwardRef7, useCallback as
|
|
5862
|
+
import { forwardRef as forwardRef7, useCallback as useCallback12, useState as useState14 } from "react";
|
|
5862
5863
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5863
5864
|
import {
|
|
5864
5865
|
forwardRef as forwardRef8,
|
|
5865
|
-
useCallback as
|
|
5866
|
-
useContext as
|
|
5866
|
+
useCallback as useCallback13,
|
|
5867
|
+
useContext as useContext29,
|
|
5867
5868
|
useImperativeHandle as useImperativeHandle7,
|
|
5868
5869
|
useLayoutEffect as useLayoutEffect9,
|
|
5869
5870
|
useRef as useRef17
|
|
@@ -5872,59 +5873,61 @@ import { jsx as jsx24 } from "react/jsx-runtime";
|
|
|
5872
5873
|
import { createRef as createRef3 } from "react";
|
|
5873
5874
|
import React24 from "react";
|
|
5874
5875
|
import {
|
|
5875
|
-
useCallback as
|
|
5876
|
+
useCallback as useCallback14,
|
|
5876
5877
|
useImperativeHandle as useImperativeHandle8,
|
|
5877
|
-
useMemo as
|
|
5878
|
+
useMemo as useMemo26,
|
|
5878
5879
|
useRef as useRef18,
|
|
5879
|
-
useState as
|
|
5880
|
+
useState as useState15
|
|
5880
5881
|
} from "react";
|
|
5881
5882
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
5882
5883
|
import React25 from "react";
|
|
5883
|
-
import { useMemo as
|
|
5884
|
-
import { createContext as createContext20, useContext as
|
|
5884
|
+
import { useMemo as useMemo28 } from "react";
|
|
5885
|
+
import { createContext as createContext20, useContext as useContext30, useMemo as useMemo27 } from "react";
|
|
5885
5886
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
5886
5887
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
5887
|
-
import React27
|
|
5888
|
-
import
|
|
5889
|
-
import { useContext as
|
|
5890
|
-
import {
|
|
5888
|
+
import React27 from "react";
|
|
5889
|
+
import React28, { createContext as createContext21 } from "react";
|
|
5890
|
+
import { useContext as useContext31, useMemo as useMemo29, useState as useState16 } from "react";
|
|
5891
|
+
import { useContext as useContext32 } from "react";
|
|
5892
|
+
import { useCallback as useCallback16 } from "react";
|
|
5891
5893
|
import {
|
|
5892
|
-
useCallback as
|
|
5893
|
-
useContext as
|
|
5894
|
-
useEffect as
|
|
5894
|
+
useCallback as useCallback15,
|
|
5895
|
+
useContext as useContext33,
|
|
5896
|
+
useEffect as useEffect14,
|
|
5895
5897
|
useLayoutEffect as useLayoutEffect10,
|
|
5896
|
-
useMemo as
|
|
5897
|
-
useState as
|
|
5898
|
+
useMemo as useMemo30,
|
|
5899
|
+
useState as useState17
|
|
5898
5900
|
} from "react";
|
|
5899
5901
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
5900
|
-
import
|
|
5902
|
+
import React30, {
|
|
5901
5903
|
forwardRef as forwardRef9,
|
|
5902
|
-
useContext as
|
|
5903
|
-
useEffect as
|
|
5904
|
+
useContext as useContext34,
|
|
5905
|
+
useEffect as useEffect16,
|
|
5904
5906
|
useImperativeHandle as useImperativeHandle9,
|
|
5905
|
-
useMemo as
|
|
5907
|
+
useMemo as useMemo31,
|
|
5906
5908
|
useRef as useRef19,
|
|
5907
|
-
useState as
|
|
5909
|
+
useState as useState18
|
|
5908
5910
|
} from "react";
|
|
5909
|
-
import { useEffect as
|
|
5911
|
+
import { useEffect as useEffect15 } from "react";
|
|
5910
5912
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
5911
5913
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
5912
|
-
import
|
|
5914
|
+
import React32, { forwardRef as forwardRef10, useMemo as useMemo32 } from "react";
|
|
5915
|
+
import React33, { useMemo as useMemo33 } from "react";
|
|
5913
5916
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
5914
|
-
import { Children, forwardRef as
|
|
5915
|
-
import
|
|
5916
|
-
import
|
|
5917
|
+
import { Children, forwardRef as forwardRef11, useMemo as useMemo34 } from "react";
|
|
5918
|
+
import React34 from "react";
|
|
5919
|
+
import React35, { createContext as createContext22 } from "react";
|
|
5917
5920
|
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
5918
5921
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
5919
|
-
import
|
|
5920
|
-
import { forwardRef as
|
|
5922
|
+
import React37 from "react";
|
|
5923
|
+
import { forwardRef as forwardRef13, useCallback as useCallback17, useContext as useContext36 } from "react";
|
|
5921
5924
|
import {
|
|
5922
|
-
forwardRef as
|
|
5923
|
-
useContext as
|
|
5924
|
-
useEffect as
|
|
5925
|
+
forwardRef as forwardRef12,
|
|
5926
|
+
useContext as useContext35,
|
|
5927
|
+
useEffect as useEffect17,
|
|
5925
5928
|
useImperativeHandle as useImperativeHandle10,
|
|
5926
5929
|
useLayoutEffect as useLayoutEffect11,
|
|
5927
|
-
useMemo as
|
|
5930
|
+
useMemo as useMemo35,
|
|
5928
5931
|
useRef as useRef20
|
|
5929
5932
|
} from "react";
|
|
5930
5933
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
@@ -5963,7 +5966,7 @@ var IsPlayerContext = createContext2(false);
|
|
|
5963
5966
|
var IsPlayerContextProvider = ({
|
|
5964
5967
|
children
|
|
5965
5968
|
}) => {
|
|
5966
|
-
return /* @__PURE__ */
|
|
5969
|
+
return /* @__PURE__ */ jsx11(IsPlayerContext.Provider, {
|
|
5967
5970
|
value: true,
|
|
5968
5971
|
children
|
|
5969
5972
|
});
|
|
@@ -5974,7 +5977,7 @@ var useIsPlayer = () => {
|
|
|
5974
5977
|
function truthy2(value) {
|
|
5975
5978
|
return Boolean(value);
|
|
5976
5979
|
}
|
|
5977
|
-
var VERSION = "4.0.
|
|
5980
|
+
var VERSION = "4.0.433";
|
|
5978
5981
|
var checkMultipleRemotionVersions = () => {
|
|
5979
5982
|
if (typeof globalThis === "undefined") {
|
|
5980
5983
|
return;
|
|
@@ -6095,6 +6098,17 @@ var AbsoluteFillRefForwarding = (props, ref) => {
|
|
|
6095
6098
|
};
|
|
6096
6099
|
var AbsoluteFill = forwardRef(AbsoluteFillRefForwarding);
|
|
6097
6100
|
var SequenceContext = createContext3(null);
|
|
6101
|
+
var exports_timeline_position_state = {};
|
|
6102
|
+
__export2(exports_timeline_position_state, {
|
|
6103
|
+
useTimelineSetFrame: () => useTimelineSetFrame,
|
|
6104
|
+
useTimelinePosition: () => useTimelinePosition,
|
|
6105
|
+
useTimelineContext: () => useTimelineContext,
|
|
6106
|
+
usePlayingState: () => usePlayingState,
|
|
6107
|
+
useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
|
|
6108
|
+
persistCurrentFrame: () => persistCurrentFrame,
|
|
6109
|
+
getInitialFrameState: () => getInitialFrameState,
|
|
6110
|
+
getFrameForComposition: () => getFrameForComposition
|
|
6111
|
+
});
|
|
6098
6112
|
function mulberry32(a) {
|
|
6099
6113
|
let t = a + 1831565813;
|
|
6100
6114
|
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
@@ -6127,15 +6141,55 @@ var random = (seed, dummy) => {
|
|
|
6127
6141
|
}
|
|
6128
6142
|
throw new Error("random() argument must be a number or a string");
|
|
6129
6143
|
};
|
|
6130
|
-
var
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
}
|
|
6144
|
+
var getErrorStackWithMessage = (error) => {
|
|
6145
|
+
const stack = error.stack ?? "";
|
|
6146
|
+
return stack.startsWith("Error:") ? stack : `${error.message}
|
|
6147
|
+
${stack}`;
|
|
6148
|
+
};
|
|
6149
|
+
var isErrorLike = (err) => {
|
|
6150
|
+
if (err instanceof Error) {
|
|
6151
|
+
return true;
|
|
6152
|
+
}
|
|
6153
|
+
if (err === null) {
|
|
6154
|
+
return false;
|
|
6155
|
+
}
|
|
6156
|
+
if (typeof err !== "object") {
|
|
6157
|
+
return false;
|
|
6158
|
+
}
|
|
6159
|
+
if (!("stack" in err)) {
|
|
6160
|
+
return false;
|
|
6161
|
+
}
|
|
6162
|
+
if (typeof err.stack !== "string") {
|
|
6163
|
+
return false;
|
|
6164
|
+
}
|
|
6165
|
+
if (!("message" in err)) {
|
|
6166
|
+
return false;
|
|
6167
|
+
}
|
|
6168
|
+
if (typeof err.message !== "string") {
|
|
6169
|
+
return false;
|
|
6170
|
+
}
|
|
6171
|
+
return true;
|
|
6172
|
+
};
|
|
6173
|
+
function cancelRenderInternal(scope, err) {
|
|
6174
|
+
let error;
|
|
6175
|
+
if (isErrorLike(err)) {
|
|
6176
|
+
error = err;
|
|
6177
|
+
if (!error.stack) {
|
|
6178
|
+
error.stack = new Error(error.message).stack;
|
|
6179
|
+
}
|
|
6180
|
+
} else if (typeof err === "string") {
|
|
6181
|
+
error = Error(err);
|
|
6182
|
+
} else {
|
|
6183
|
+
error = Error("Rendering was cancelled");
|
|
6184
|
+
}
|
|
6185
|
+
if (scope) {
|
|
6186
|
+
scope.remotion_cancelledError = getErrorStackWithMessage(error);
|
|
6187
|
+
}
|
|
6188
|
+
throw error;
|
|
6189
|
+
}
|
|
6190
|
+
function cancelRender(err) {
|
|
6191
|
+
return cancelRenderInternal(typeof window !== "undefined" ? window : undefined, err);
|
|
6192
|
+
}
|
|
6139
6193
|
function getNodeEnvString() {
|
|
6140
6194
|
return ["NOD", "E_EN", "V"].join("");
|
|
6141
6195
|
}
|
|
@@ -6155,62 +6209,323 @@ var getRemotionEnvironment = () => {
|
|
|
6155
6209
|
isClientSideRendering: false
|
|
6156
6210
|
};
|
|
6157
6211
|
};
|
|
6158
|
-
var
|
|
6159
|
-
var
|
|
6160
|
-
|
|
6161
|
-
const [env] = useState(() => getRemotionEnvironment());
|
|
6162
|
-
return context ?? env;
|
|
6212
|
+
var logLevels = ["trace", "verbose", "info", "warn", "error"];
|
|
6213
|
+
var getNumberForLogLevel = (level) => {
|
|
6214
|
+
return logLevels.indexOf(level);
|
|
6163
6215
|
};
|
|
6164
|
-
var
|
|
6165
|
-
|
|
6166
|
-
folders: [],
|
|
6167
|
-
currentCompositionMetadata: null,
|
|
6168
|
-
canvasContent: null
|
|
6169
|
-
});
|
|
6170
|
-
var CompositionSetters = createContext4({
|
|
6171
|
-
registerComposition: () => {
|
|
6172
|
-
return;
|
|
6173
|
-
},
|
|
6174
|
-
unregisterComposition: () => {
|
|
6175
|
-
return;
|
|
6176
|
-
},
|
|
6177
|
-
registerFolder: () => {
|
|
6178
|
-
return;
|
|
6179
|
-
},
|
|
6180
|
-
unregisterFolder: () => {
|
|
6181
|
-
return;
|
|
6182
|
-
},
|
|
6183
|
-
setCanvasContent: () => {
|
|
6184
|
-
return;
|
|
6185
|
-
},
|
|
6186
|
-
updateCompositionDefaultProps: () => {
|
|
6187
|
-
return;
|
|
6188
|
-
},
|
|
6189
|
-
onlyRenderComposition: null
|
|
6190
|
-
});
|
|
6191
|
-
var getKey = () => {
|
|
6192
|
-
return `remotion_inputPropsOverride` + window.location.origin;
|
|
6216
|
+
var isEqualOrBelowLogLevel = (currentLevel, level) => {
|
|
6217
|
+
return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
|
|
6193
6218
|
};
|
|
6194
|
-
var
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6219
|
+
var transformArgs = ({
|
|
6220
|
+
args,
|
|
6221
|
+
logLevel,
|
|
6222
|
+
tag
|
|
6223
|
+
}) => {
|
|
6224
|
+
const arr = [...args];
|
|
6225
|
+
if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6226
|
+
arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
|
|
6227
|
+
}
|
|
6228
|
+
if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6229
|
+
arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
|
|
6230
|
+
}
|
|
6231
|
+
return arr;
|
|
6201
6232
|
};
|
|
6202
|
-
var
|
|
6203
|
-
if (
|
|
6204
|
-
return;
|
|
6205
|
-
if (override === null) {
|
|
6206
|
-
localStorage.removeItem(getKey());
|
|
6207
|
-
return;
|
|
6233
|
+
var verbose = (options, ...args) => {
|
|
6234
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
|
|
6235
|
+
return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
|
|
6208
6236
|
}
|
|
6209
|
-
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
6210
6237
|
};
|
|
6211
|
-
var
|
|
6212
|
-
|
|
6213
|
-
|
|
6238
|
+
var trace = (options, ...args) => {
|
|
6239
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
6240
|
+
return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
|
|
6241
|
+
}
|
|
6242
|
+
};
|
|
6243
|
+
var info = (options, ...args) => {
|
|
6244
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
|
|
6245
|
+
return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
|
|
6246
|
+
}
|
|
6247
|
+
};
|
|
6248
|
+
var warn = (options, ...args) => {
|
|
6249
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
|
|
6250
|
+
return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
|
|
6251
|
+
}
|
|
6252
|
+
};
|
|
6253
|
+
var error = (options, ...args) => {
|
|
6254
|
+
return console.error(...transformArgs({ args, logLevel: "error", tag: options.tag }));
|
|
6255
|
+
};
|
|
6256
|
+
var Log = {
|
|
6257
|
+
trace,
|
|
6258
|
+
verbose,
|
|
6259
|
+
info,
|
|
6260
|
+
warn,
|
|
6261
|
+
error
|
|
6262
|
+
};
|
|
6263
|
+
if (typeof window !== "undefined") {
|
|
6264
|
+
window.remotion_renderReady = false;
|
|
6265
|
+
if (!window.remotion_delayRenderTimeouts) {
|
|
6266
|
+
window.remotion_delayRenderTimeouts = {};
|
|
6267
|
+
}
|
|
6268
|
+
window.remotion_delayRenderHandles = [];
|
|
6269
|
+
}
|
|
6270
|
+
var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
|
|
6271
|
+
var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
|
|
6272
|
+
var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
|
|
6273
|
+
var DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after";
|
|
6274
|
+
var defaultTimeout = 30000;
|
|
6275
|
+
var delayRenderInternal = ({
|
|
6276
|
+
scope,
|
|
6277
|
+
environment,
|
|
6278
|
+
label,
|
|
6279
|
+
options
|
|
6280
|
+
}) => {
|
|
6281
|
+
if (typeof label !== "string" && label !== null) {
|
|
6282
|
+
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label));
|
|
6283
|
+
}
|
|
6284
|
+
const handle = Math.random();
|
|
6285
|
+
scope.remotion_delayRenderHandles.push(handle);
|
|
6286
|
+
const called = Error().stack?.replace(/^Error/g, "") ?? "";
|
|
6287
|
+
if (environment.isRendering) {
|
|
6288
|
+
const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
|
|
6289
|
+
const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
|
|
6290
|
+
scope.remotion_delayRenderTimeouts[handle] = {
|
|
6291
|
+
label: label ?? null,
|
|
6292
|
+
startTime: Date.now(),
|
|
6293
|
+
timeout: setTimeout(() => {
|
|
6294
|
+
const message = [
|
|
6295
|
+
`A delayRender()`,
|
|
6296
|
+
label ? `"${label}"` : null,
|
|
6297
|
+
`was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
|
|
6298
|
+
retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
|
|
6299
|
+
retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
|
|
6300
|
+
DELAY_RENDER_CALLSTACK_TOKEN,
|
|
6301
|
+
called
|
|
6302
|
+
].filter(truthy2).join(" ");
|
|
6303
|
+
if (environment.isClientSideRendering) {
|
|
6304
|
+
scope.remotion_cancelledError = getErrorStackWithMessage(Error(message));
|
|
6305
|
+
} else {
|
|
6306
|
+
cancelRenderInternal(scope, Error(message));
|
|
6307
|
+
}
|
|
6308
|
+
}, timeoutToUse)
|
|
6309
|
+
};
|
|
6310
|
+
}
|
|
6311
|
+
scope.remotion_renderReady = false;
|
|
6312
|
+
return handle;
|
|
6313
|
+
};
|
|
6314
|
+
var continueRenderInternal = ({
|
|
6315
|
+
scope,
|
|
6316
|
+
handle,
|
|
6317
|
+
environment,
|
|
6318
|
+
logLevel
|
|
6319
|
+
}) => {
|
|
6320
|
+
if (typeof handle === "undefined") {
|
|
6321
|
+
throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");
|
|
6322
|
+
}
|
|
6323
|
+
if (typeof handle !== "number") {
|
|
6324
|
+
throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: " + JSON.stringify(handle));
|
|
6325
|
+
}
|
|
6326
|
+
scope.remotion_delayRenderHandles = scope.remotion_delayRenderHandles.filter((h) => {
|
|
6327
|
+
if (h === handle) {
|
|
6328
|
+
if (environment.isRendering && scope !== undefined) {
|
|
6329
|
+
if (!scope.remotion_delayRenderTimeouts[handle]) {
|
|
6330
|
+
return false;
|
|
6331
|
+
}
|
|
6332
|
+
const { label, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
|
|
6333
|
+
clearTimeout(timeout);
|
|
6334
|
+
const message = [
|
|
6335
|
+
label ? `"${label}"` : "A handle",
|
|
6336
|
+
DELAY_RENDER_CLEAR_TOKEN,
|
|
6337
|
+
`${Date.now() - startTime}ms`
|
|
6338
|
+
].filter(truthy2).join(" ");
|
|
6339
|
+
Log.verbose({ logLevel, tag: "delayRender()" }, message);
|
|
6340
|
+
delete scope.remotion_delayRenderTimeouts[handle];
|
|
6341
|
+
}
|
|
6342
|
+
return false;
|
|
6343
|
+
}
|
|
6344
|
+
return true;
|
|
6345
|
+
});
|
|
6346
|
+
if (scope.remotion_delayRenderHandles.length === 0) {
|
|
6347
|
+
scope.remotion_renderReady = true;
|
|
6348
|
+
}
|
|
6349
|
+
};
|
|
6350
|
+
var LogLevelContext = createContext4({
|
|
6351
|
+
logLevel: "info",
|
|
6352
|
+
mountTime: 0
|
|
6353
|
+
});
|
|
6354
|
+
var useLogLevel = () => {
|
|
6355
|
+
const { logLevel } = React2.useContext(LogLevelContext);
|
|
6356
|
+
if (logLevel === null) {
|
|
6357
|
+
throw new Error("useLogLevel must be used within a LogLevelProvider");
|
|
6358
|
+
}
|
|
6359
|
+
return logLevel;
|
|
6360
|
+
};
|
|
6361
|
+
var useMountTime = () => {
|
|
6362
|
+
const { mountTime } = React2.useContext(LogLevelContext);
|
|
6363
|
+
if (mountTime === null) {
|
|
6364
|
+
throw new Error("useMountTime must be used within a LogLevelProvider");
|
|
6365
|
+
}
|
|
6366
|
+
return mountTime;
|
|
6367
|
+
};
|
|
6368
|
+
var RemotionEnvironmentContext = React3.createContext(null);
|
|
6369
|
+
var useRemotionEnvironment = () => {
|
|
6370
|
+
const context = useContext3(RemotionEnvironmentContext);
|
|
6371
|
+
const [env] = useState(() => getRemotionEnvironment());
|
|
6372
|
+
return context ?? env;
|
|
6373
|
+
};
|
|
6374
|
+
var DelayRenderContextType = createContext5(null);
|
|
6375
|
+
var useDelayRender = () => {
|
|
6376
|
+
const environment = useRemotionEnvironment();
|
|
6377
|
+
const scope = useContext4(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
|
|
6378
|
+
const logLevel = useLogLevel();
|
|
6379
|
+
const delayRender2 = useCallback((label, options) => {
|
|
6380
|
+
if (!scope) {
|
|
6381
|
+
return Math.random();
|
|
6382
|
+
}
|
|
6383
|
+
return delayRenderInternal({
|
|
6384
|
+
scope,
|
|
6385
|
+
environment,
|
|
6386
|
+
label: label ?? null,
|
|
6387
|
+
options: options ?? {}
|
|
6388
|
+
});
|
|
6389
|
+
}, [environment, scope]);
|
|
6390
|
+
const continueRender2 = useCallback((handle) => {
|
|
6391
|
+
if (!scope) {
|
|
6392
|
+
return;
|
|
6393
|
+
}
|
|
6394
|
+
continueRenderInternal({
|
|
6395
|
+
scope,
|
|
6396
|
+
handle,
|
|
6397
|
+
environment,
|
|
6398
|
+
logLevel
|
|
6399
|
+
});
|
|
6400
|
+
}, [environment, logLevel, scope]);
|
|
6401
|
+
const cancelRender2 = useCallback((err) => {
|
|
6402
|
+
return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
|
|
6403
|
+
}, [scope]);
|
|
6404
|
+
return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
|
|
6405
|
+
};
|
|
6406
|
+
var SetTimelineContext = createContext6({
|
|
6407
|
+
setFrame: () => {
|
|
6408
|
+
throw new Error("default");
|
|
6409
|
+
},
|
|
6410
|
+
setPlaying: () => {
|
|
6411
|
+
throw new Error("default");
|
|
6412
|
+
}
|
|
6413
|
+
});
|
|
6414
|
+
var TimelineContext = createContext6(null);
|
|
6415
|
+
var AbsoluteTimeContext = createContext6(null);
|
|
6416
|
+
var TimelineContextProvider = ({ children, frameState }) => {
|
|
6417
|
+
const [playing, setPlaying] = useState2(false);
|
|
6418
|
+
const imperativePlaying = useRef(false);
|
|
6419
|
+
const [playbackRate, setPlaybackRate] = useState2(1);
|
|
6420
|
+
const audioAndVideoTags = useRef([]);
|
|
6421
|
+
const [remotionRootId] = useState2(() => String(random(null)));
|
|
6422
|
+
const [_frame, setFrame] = useState2(() => getInitialFrameState());
|
|
6423
|
+
const frame = frameState ?? _frame;
|
|
6424
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
6425
|
+
if (typeof window !== "undefined") {
|
|
6426
|
+
useLayoutEffect(() => {
|
|
6427
|
+
window.remotion_setFrame = (f, composition, attempt) => {
|
|
6428
|
+
window.remotion_attempt = attempt;
|
|
6429
|
+
const id = delayRender2(`Setting the current frame to ${f}`);
|
|
6430
|
+
let asyncUpdate = true;
|
|
6431
|
+
setFrame((s) => {
|
|
6432
|
+
const currentFrame = s[composition] ?? window.remotion_initialFrame;
|
|
6433
|
+
if (currentFrame === f) {
|
|
6434
|
+
asyncUpdate = false;
|
|
6435
|
+
return s;
|
|
6436
|
+
}
|
|
6437
|
+
return {
|
|
6438
|
+
...s,
|
|
6439
|
+
[composition]: f
|
|
6440
|
+
};
|
|
6441
|
+
});
|
|
6442
|
+
if (asyncUpdate) {
|
|
6443
|
+
requestAnimationFrame(() => continueRender2(id));
|
|
6444
|
+
} else {
|
|
6445
|
+
continueRender2(id);
|
|
6446
|
+
}
|
|
6447
|
+
};
|
|
6448
|
+
window.remotion_isPlayer = false;
|
|
6449
|
+
}, [continueRender2, delayRender2]);
|
|
6450
|
+
}
|
|
6451
|
+
const timelineContextValue = useMemo22(() => {
|
|
6452
|
+
return {
|
|
6453
|
+
frame,
|
|
6454
|
+
playing,
|
|
6455
|
+
imperativePlaying,
|
|
6456
|
+
rootId: remotionRootId,
|
|
6457
|
+
playbackRate,
|
|
6458
|
+
setPlaybackRate,
|
|
6459
|
+
audioAndVideoTags
|
|
6460
|
+
};
|
|
6461
|
+
}, [frame, playbackRate, playing, remotionRootId]);
|
|
6462
|
+
const setTimelineContextValue = useMemo22(() => {
|
|
6463
|
+
return {
|
|
6464
|
+
setFrame,
|
|
6465
|
+
setPlaying
|
|
6466
|
+
};
|
|
6467
|
+
}, []);
|
|
6468
|
+
return /* @__PURE__ */ jsx32(AbsoluteTimeContext.Provider, {
|
|
6469
|
+
value: timelineContextValue,
|
|
6470
|
+
children: /* @__PURE__ */ jsx32(TimelineContext.Provider, {
|
|
6471
|
+
value: timelineContextValue,
|
|
6472
|
+
children: /* @__PURE__ */ jsx32(SetTimelineContext.Provider, {
|
|
6473
|
+
value: setTimelineContextValue,
|
|
6474
|
+
children
|
|
6475
|
+
})
|
|
6476
|
+
})
|
|
6477
|
+
});
|
|
6478
|
+
};
|
|
6479
|
+
var CompositionManager = createContext7({
|
|
6480
|
+
compositions: [],
|
|
6481
|
+
folders: [],
|
|
6482
|
+
currentCompositionMetadata: null,
|
|
6483
|
+
canvasContent: null
|
|
6484
|
+
});
|
|
6485
|
+
var CompositionSetters = createContext7({
|
|
6486
|
+
registerComposition: () => {
|
|
6487
|
+
return;
|
|
6488
|
+
},
|
|
6489
|
+
unregisterComposition: () => {
|
|
6490
|
+
return;
|
|
6491
|
+
},
|
|
6492
|
+
registerFolder: () => {
|
|
6493
|
+
return;
|
|
6494
|
+
},
|
|
6495
|
+
unregisterFolder: () => {
|
|
6496
|
+
return;
|
|
6497
|
+
},
|
|
6498
|
+
setCanvasContent: () => {
|
|
6499
|
+
return;
|
|
6500
|
+
},
|
|
6501
|
+
updateCompositionDefaultProps: () => {
|
|
6502
|
+
return;
|
|
6503
|
+
},
|
|
6504
|
+
onlyRenderComposition: null
|
|
6505
|
+
});
|
|
6506
|
+
var getKey = () => {
|
|
6507
|
+
return `remotion_inputPropsOverride` + window.location.origin;
|
|
6508
|
+
};
|
|
6509
|
+
var getInputPropsOverride = () => {
|
|
6510
|
+
if (typeof localStorage === "undefined")
|
|
6511
|
+
return null;
|
|
6512
|
+
const override = localStorage.getItem(getKey());
|
|
6513
|
+
if (!override)
|
|
6514
|
+
return null;
|
|
6515
|
+
return JSON.parse(override);
|
|
6516
|
+
};
|
|
6517
|
+
var setInputPropsOverride = (override) => {
|
|
6518
|
+
if (typeof localStorage === "undefined")
|
|
6519
|
+
return;
|
|
6520
|
+
if (override === null) {
|
|
6521
|
+
localStorage.removeItem(getKey());
|
|
6522
|
+
return;
|
|
6523
|
+
}
|
|
6524
|
+
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
6525
|
+
};
|
|
6526
|
+
var DATE_TOKEN = "remotion-date:";
|
|
6527
|
+
var FILE_TOKEN = "remotion-file:";
|
|
6528
|
+
var serializeJSONWithSpecialTypes = ({
|
|
6214
6529
|
data,
|
|
6215
6530
|
indent,
|
|
6216
6531
|
staticBase
|
|
@@ -6301,7 +6616,7 @@ var getInputProps = () => {
|
|
|
6301
6616
|
const parsed = deserializeJSONWithSpecialTypes(param);
|
|
6302
6617
|
return parsed;
|
|
6303
6618
|
};
|
|
6304
|
-
var EditorPropsContext =
|
|
6619
|
+
var EditorPropsContext = createContext8({
|
|
6305
6620
|
props: {},
|
|
6306
6621
|
updateProps: () => {
|
|
6307
6622
|
throw new Error("Not implemented");
|
|
@@ -6310,11 +6625,11 @@ var EditorPropsContext = createContext5({
|
|
|
6310
6625
|
throw new Error("Not implemented");
|
|
6311
6626
|
}
|
|
6312
6627
|
});
|
|
6313
|
-
var editorPropsProviderRef =
|
|
6314
|
-
var timeValueRef =
|
|
6628
|
+
var editorPropsProviderRef = React5.createRef();
|
|
6629
|
+
var timeValueRef = React5.createRef();
|
|
6315
6630
|
var EditorPropsProvider = ({ children }) => {
|
|
6316
|
-
const [props, setProps] =
|
|
6317
|
-
const updateProps =
|
|
6631
|
+
const [props, setProps] = React5.useState({});
|
|
6632
|
+
const updateProps = useCallback2(({
|
|
6318
6633
|
defaultProps,
|
|
6319
6634
|
id,
|
|
6320
6635
|
newProps
|
|
@@ -6326,7 +6641,7 @@ var EditorPropsProvider = ({ children }) => {
|
|
|
6326
6641
|
};
|
|
6327
6642
|
});
|
|
6328
6643
|
}, []);
|
|
6329
|
-
const resetUnsaved =
|
|
6644
|
+
const resetUnsaved = useCallback2((compositionId) => {
|
|
6330
6645
|
setProps((prev) => {
|
|
6331
6646
|
if (prev[compositionId]) {
|
|
6332
6647
|
const newProps = { ...prev };
|
|
@@ -6342,10 +6657,10 @@ var EditorPropsProvider = ({ children }) => {
|
|
|
6342
6657
|
setProps
|
|
6343
6658
|
};
|
|
6344
6659
|
}, [props]);
|
|
6345
|
-
const ctx =
|
|
6660
|
+
const ctx = useMemo3(() => {
|
|
6346
6661
|
return { props, updateProps, resetUnsaved };
|
|
6347
6662
|
}, [props, resetUnsaved, updateProps]);
|
|
6348
|
-
return /* @__PURE__ */
|
|
6663
|
+
return /* @__PURE__ */ jsx42(EditorPropsContext.Provider, {
|
|
6349
6664
|
value: ctx,
|
|
6350
6665
|
children
|
|
6351
6666
|
});
|
|
@@ -6402,24 +6717,24 @@ function validateFps(fps, location, isGif) {
|
|
|
6402
6717
|
throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
|
|
6403
6718
|
}
|
|
6404
6719
|
}
|
|
6405
|
-
var ResolveCompositionContext =
|
|
6720
|
+
var ResolveCompositionContext = createContext9(null);
|
|
6406
6721
|
var resolveCompositionsRef = createRef();
|
|
6407
6722
|
var needsResolution = (composition) => {
|
|
6408
6723
|
return Boolean(composition.calculateMetadata);
|
|
6409
6724
|
};
|
|
6410
6725
|
var PROPS_UPDATED_EXTERNALLY = "remotion.propsUpdatedExternally";
|
|
6411
6726
|
var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
6412
|
-
const context =
|
|
6413
|
-
const { props: allEditorProps } =
|
|
6414
|
-
const { compositions, canvasContent, currentCompositionMetadata } =
|
|
6727
|
+
const context = useContext5(ResolveCompositionContext);
|
|
6728
|
+
const { props: allEditorProps } = useContext5(EditorPropsContext);
|
|
6729
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext5(CompositionManager);
|
|
6415
6730
|
const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
6416
6731
|
const compositionId = preferredCompositionId ?? currentComposition;
|
|
6417
6732
|
const composition = compositions.find((c) => c.id === compositionId);
|
|
6418
|
-
const selectedEditorProps =
|
|
6733
|
+
const selectedEditorProps = useMemo4(() => {
|
|
6419
6734
|
return composition ? allEditorProps[composition.id] ?? {} : {};
|
|
6420
6735
|
}, [allEditorProps, composition]);
|
|
6421
6736
|
const env = useRemotionEnvironment();
|
|
6422
|
-
return
|
|
6737
|
+
return useMemo4(() => {
|
|
6423
6738
|
if (!composition) {
|
|
6424
6739
|
return null;
|
|
6425
6740
|
}
|
|
@@ -6479,12 +6794,12 @@ var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
6479
6794
|
]);
|
|
6480
6795
|
};
|
|
6481
6796
|
var useVideo = () => {
|
|
6482
|
-
const { canvasContent, compositions, currentCompositionMetadata } =
|
|
6797
|
+
const { canvasContent, compositions, currentCompositionMetadata } = useContext6(CompositionManager);
|
|
6483
6798
|
const selected = compositions.find((c) => {
|
|
6484
6799
|
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
6485
6800
|
});
|
|
6486
6801
|
const resolved = useResolvedVideoConfig(selected?.id ?? null);
|
|
6487
|
-
return
|
|
6802
|
+
return useMemo5(() => {
|
|
6488
6803
|
if (!resolved) {
|
|
6489
6804
|
return null;
|
|
6490
6805
|
}
|
|
@@ -6512,358 +6827,57 @@ var makeKey = () => {
|
|
|
6512
6827
|
var persistCurrentFrame = (time) => {
|
|
6513
6828
|
localStorage.setItem(makeKey(), JSON.stringify(time));
|
|
6514
6829
|
};
|
|
6515
|
-
var getInitialFrameState = () => {
|
|
6516
|
-
const item = localStorage.getItem(makeKey()) ?? "{}";
|
|
6517
|
-
const obj = JSON.parse(item);
|
|
6518
|
-
return obj;
|
|
6519
|
-
};
|
|
6520
|
-
var getFrameForComposition = (composition) => {
|
|
6521
|
-
const item = localStorage.getItem(makeKey()) ?? "{}";
|
|
6522
|
-
const obj = JSON.parse(item);
|
|
6523
|
-
if (obj[composition] !== undefined) {
|
|
6524
|
-
return Number(obj[composition]);
|
|
6525
|
-
}
|
|
6526
|
-
if (typeof window === "undefined") {
|
|
6527
|
-
return 0;
|
|
6528
|
-
}
|
|
6529
|
-
return window.remotion_initialFrame ?? 0;
|
|
6530
|
-
};
|
|
6531
|
-
var useTimelinePosition = () => {
|
|
6532
|
-
const videoConfig = useVideo();
|
|
6533
|
-
const state = useContext5(TimelineContext);
|
|
6534
|
-
const env = useRemotionEnvironment();
|
|
6535
|
-
if (!videoConfig) {
|
|
6536
|
-
return typeof window === "undefined" ? 0 : window.remotion_initialFrame ?? 0;
|
|
6537
|
-
}
|
|
6538
|
-
const unclamped = state.frame[videoConfig.id] ?? (env.isPlayer ? 0 : getFrameForComposition(videoConfig.id));
|
|
6539
|
-
return Math.min(videoConfig.durationInFrames - 1, unclamped);
|
|
6540
|
-
};
|
|
6541
|
-
var useTimelineSetFrame = () => {
|
|
6542
|
-
const { setFrame } = useContext5(SetTimelineContext);
|
|
6543
|
-
return setFrame;
|
|
6544
|
-
};
|
|
6545
|
-
var usePlayingState = () => {
|
|
6546
|
-
const { playing, imperativePlaying } = useContext5(TimelineContext);
|
|
6547
|
-
const { setPlaying } = useContext5(SetTimelineContext);
|
|
6548
|
-
return useMemo5(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
|
|
6549
|
-
};
|
|
6550
|
-
var getErrorStackWithMessage = (error) => {
|
|
6551
|
-
const stack = error.stack ?? "";
|
|
6552
|
-
return stack.startsWith("Error:") ? stack : `${error.message}
|
|
6553
|
-
${stack}`;
|
|
6554
|
-
};
|
|
6555
|
-
var isErrorLike = (err) => {
|
|
6556
|
-
if (err instanceof Error) {
|
|
6557
|
-
return true;
|
|
6558
|
-
}
|
|
6559
|
-
if (err === null) {
|
|
6560
|
-
return false;
|
|
6561
|
-
}
|
|
6562
|
-
if (typeof err !== "object") {
|
|
6563
|
-
return false;
|
|
6564
|
-
}
|
|
6565
|
-
if (!("stack" in err)) {
|
|
6566
|
-
return false;
|
|
6567
|
-
}
|
|
6568
|
-
if (typeof err.stack !== "string") {
|
|
6569
|
-
return false;
|
|
6570
|
-
}
|
|
6571
|
-
if (!("message" in err)) {
|
|
6572
|
-
return false;
|
|
6573
|
-
}
|
|
6574
|
-
if (typeof err.message !== "string") {
|
|
6575
|
-
return false;
|
|
6576
|
-
}
|
|
6577
|
-
return true;
|
|
6578
|
-
};
|
|
6579
|
-
function cancelRenderInternal(scope, err) {
|
|
6580
|
-
let error;
|
|
6581
|
-
if (isErrorLike(err)) {
|
|
6582
|
-
error = err;
|
|
6583
|
-
if (!error.stack) {
|
|
6584
|
-
error.stack = new Error(error.message).stack;
|
|
6585
|
-
}
|
|
6586
|
-
} else if (typeof err === "string") {
|
|
6587
|
-
error = Error(err);
|
|
6588
|
-
} else {
|
|
6589
|
-
error = Error("Rendering was cancelled");
|
|
6590
|
-
}
|
|
6591
|
-
if (scope) {
|
|
6592
|
-
scope.remotion_cancelledError = getErrorStackWithMessage(error);
|
|
6593
|
-
}
|
|
6594
|
-
throw error;
|
|
6595
|
-
}
|
|
6596
|
-
function cancelRender(err) {
|
|
6597
|
-
return cancelRenderInternal(typeof window !== "undefined" ? window : undefined, err);
|
|
6598
|
-
}
|
|
6599
|
-
var logLevels = ["trace", "verbose", "info", "warn", "error"];
|
|
6600
|
-
var getNumberForLogLevel = (level) => {
|
|
6601
|
-
return logLevels.indexOf(level);
|
|
6602
|
-
};
|
|
6603
|
-
var isEqualOrBelowLogLevel = (currentLevel, level) => {
|
|
6604
|
-
return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
|
|
6605
|
-
};
|
|
6606
|
-
var transformArgs = ({
|
|
6607
|
-
args,
|
|
6608
|
-
logLevel,
|
|
6609
|
-
tag
|
|
6610
|
-
}) => {
|
|
6611
|
-
const arr = [...args];
|
|
6612
|
-
if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6613
|
-
arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
|
|
6614
|
-
}
|
|
6615
|
-
if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
6616
|
-
arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
|
|
6617
|
-
}
|
|
6618
|
-
return arr;
|
|
6619
|
-
};
|
|
6620
|
-
var verbose = (options, ...args) => {
|
|
6621
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
|
|
6622
|
-
return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
|
|
6623
|
-
}
|
|
6624
|
-
};
|
|
6625
|
-
var trace = (options, ...args) => {
|
|
6626
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
6627
|
-
return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
|
|
6628
|
-
}
|
|
6629
|
-
};
|
|
6630
|
-
var info = (options, ...args) => {
|
|
6631
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
|
|
6632
|
-
return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
|
|
6633
|
-
}
|
|
6634
|
-
};
|
|
6635
|
-
var warn = (options, ...args) => {
|
|
6636
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
|
|
6637
|
-
return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
|
|
6638
|
-
}
|
|
6639
|
-
};
|
|
6640
|
-
var error = (options, ...args) => {
|
|
6641
|
-
return console.error(...transformArgs({ args, logLevel: "error", tag: options.tag }));
|
|
6642
|
-
};
|
|
6643
|
-
var Log = {
|
|
6644
|
-
trace,
|
|
6645
|
-
verbose,
|
|
6646
|
-
info,
|
|
6647
|
-
warn,
|
|
6648
|
-
error
|
|
6649
|
-
};
|
|
6650
|
-
if (typeof window !== "undefined") {
|
|
6651
|
-
window.remotion_renderReady = false;
|
|
6652
|
-
if (!window.remotion_delayRenderTimeouts) {
|
|
6653
|
-
window.remotion_delayRenderTimeouts = {};
|
|
6654
|
-
}
|
|
6655
|
-
window.remotion_delayRenderHandles = [];
|
|
6656
|
-
}
|
|
6657
|
-
var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
|
|
6658
|
-
var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
|
|
6659
|
-
var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
|
|
6660
|
-
var DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after";
|
|
6661
|
-
var defaultTimeout = 30000;
|
|
6662
|
-
var delayRenderInternal = ({
|
|
6663
|
-
scope,
|
|
6664
|
-
environment,
|
|
6665
|
-
label,
|
|
6666
|
-
options
|
|
6667
|
-
}) => {
|
|
6668
|
-
if (typeof label !== "string" && label !== null) {
|
|
6669
|
-
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label));
|
|
6670
|
-
}
|
|
6671
|
-
const handle = Math.random();
|
|
6672
|
-
scope.remotion_delayRenderHandles.push(handle);
|
|
6673
|
-
const called = Error().stack?.replace(/^Error/g, "") ?? "";
|
|
6674
|
-
if (environment.isRendering) {
|
|
6675
|
-
const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
|
|
6676
|
-
const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
|
|
6677
|
-
scope.remotion_delayRenderTimeouts[handle] = {
|
|
6678
|
-
label: label ?? null,
|
|
6679
|
-
startTime: Date.now(),
|
|
6680
|
-
timeout: setTimeout(() => {
|
|
6681
|
-
const message = [
|
|
6682
|
-
`A delayRender()`,
|
|
6683
|
-
label ? `"${label}"` : null,
|
|
6684
|
-
`was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
|
|
6685
|
-
retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
|
|
6686
|
-
retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
|
|
6687
|
-
DELAY_RENDER_CALLSTACK_TOKEN,
|
|
6688
|
-
called
|
|
6689
|
-
].filter(truthy2).join(" ");
|
|
6690
|
-
if (environment.isClientSideRendering) {
|
|
6691
|
-
scope.remotion_cancelledError = getErrorStackWithMessage(Error(message));
|
|
6692
|
-
} else {
|
|
6693
|
-
cancelRenderInternal(scope, Error(message));
|
|
6694
|
-
}
|
|
6695
|
-
}, timeoutToUse)
|
|
6696
|
-
};
|
|
6697
|
-
}
|
|
6698
|
-
scope.remotion_renderReady = false;
|
|
6699
|
-
return handle;
|
|
6700
|
-
};
|
|
6701
|
-
var continueRenderInternal = ({
|
|
6702
|
-
scope,
|
|
6703
|
-
handle,
|
|
6704
|
-
environment,
|
|
6705
|
-
logLevel
|
|
6706
|
-
}) => {
|
|
6707
|
-
if (typeof handle === "undefined") {
|
|
6708
|
-
throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");
|
|
6709
|
-
}
|
|
6710
|
-
if (typeof handle !== "number") {
|
|
6711
|
-
throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: " + JSON.stringify(handle));
|
|
6712
|
-
}
|
|
6713
|
-
scope.remotion_delayRenderHandles = scope.remotion_delayRenderHandles.filter((h) => {
|
|
6714
|
-
if (h === handle) {
|
|
6715
|
-
if (environment.isRendering && scope !== undefined) {
|
|
6716
|
-
if (!scope.remotion_delayRenderTimeouts[handle]) {
|
|
6717
|
-
return false;
|
|
6718
|
-
}
|
|
6719
|
-
const { label, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
|
|
6720
|
-
clearTimeout(timeout);
|
|
6721
|
-
const message = [
|
|
6722
|
-
label ? `"${label}"` : "A handle",
|
|
6723
|
-
DELAY_RENDER_CLEAR_TOKEN,
|
|
6724
|
-
`${Date.now() - startTime}ms`
|
|
6725
|
-
].filter(truthy2).join(" ");
|
|
6726
|
-
Log.verbose({ logLevel, tag: "delayRender()" }, message);
|
|
6727
|
-
delete scope.remotion_delayRenderTimeouts[handle];
|
|
6728
|
-
}
|
|
6729
|
-
return false;
|
|
6730
|
-
}
|
|
6731
|
-
return true;
|
|
6732
|
-
});
|
|
6733
|
-
if (scope.remotion_delayRenderHandles.length === 0) {
|
|
6734
|
-
scope.remotion_renderReady = true;
|
|
6830
|
+
var getInitialFrameState = () => {
|
|
6831
|
+
const item = localStorage.getItem(makeKey()) ?? "{}";
|
|
6832
|
+
const obj = JSON.parse(item);
|
|
6833
|
+
return obj;
|
|
6834
|
+
};
|
|
6835
|
+
var getFrameForComposition = (composition) => {
|
|
6836
|
+
const item = localStorage.getItem(makeKey()) ?? "{}";
|
|
6837
|
+
const obj = JSON.parse(item);
|
|
6838
|
+
if (obj[composition] !== undefined) {
|
|
6839
|
+
return Number(obj[composition]);
|
|
6840
|
+
}
|
|
6841
|
+
if (typeof window === "undefined") {
|
|
6842
|
+
return 0;
|
|
6735
6843
|
}
|
|
6844
|
+
return window.remotion_initialFrame ?? 0;
|
|
6736
6845
|
};
|
|
6737
|
-
var
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
const { logLevel } = React4.useContext(LogLevelContext);
|
|
6743
|
-
if (logLevel === null) {
|
|
6744
|
-
throw new Error("useLogLevel must be used within a LogLevelProvider");
|
|
6846
|
+
var useTimelinePositionFromContext = (state) => {
|
|
6847
|
+
const videoConfig = useVideo();
|
|
6848
|
+
const env = useRemotionEnvironment();
|
|
6849
|
+
if (!videoConfig) {
|
|
6850
|
+
return typeof window === "undefined" ? 0 : window.remotion_initialFrame ?? 0;
|
|
6745
6851
|
}
|
|
6746
|
-
|
|
6852
|
+
const unclamped = state.frame[videoConfig.id] ?? (env.isPlayer ? 0 : getFrameForComposition(videoConfig.id));
|
|
6853
|
+
return Math.min(videoConfig.durationInFrames - 1, unclamped);
|
|
6747
6854
|
};
|
|
6748
|
-
var
|
|
6749
|
-
const
|
|
6750
|
-
if (
|
|
6751
|
-
throw new Error("
|
|
6855
|
+
var useTimelineContext = () => {
|
|
6856
|
+
const state = useContext7(TimelineContext);
|
|
6857
|
+
if (state === null) {
|
|
6858
|
+
throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
6752
6859
|
}
|
|
6753
|
-
return
|
|
6860
|
+
return state;
|
|
6754
6861
|
};
|
|
6755
|
-
var
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
const scope = useContext7(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
|
|
6759
|
-
const logLevel = useLogLevel();
|
|
6760
|
-
const delayRender2 = useCallback2((label, options) => {
|
|
6761
|
-
if (!scope) {
|
|
6762
|
-
return Math.random();
|
|
6763
|
-
}
|
|
6764
|
-
return delayRenderInternal({
|
|
6765
|
-
scope,
|
|
6766
|
-
environment,
|
|
6767
|
-
label: label ?? null,
|
|
6768
|
-
options: options ?? {}
|
|
6769
|
-
});
|
|
6770
|
-
}, [environment, scope]);
|
|
6771
|
-
const continueRender2 = useCallback2((handle) => {
|
|
6772
|
-
if (!scope) {
|
|
6773
|
-
return;
|
|
6774
|
-
}
|
|
6775
|
-
continueRenderInternal({
|
|
6776
|
-
scope,
|
|
6777
|
-
handle,
|
|
6778
|
-
environment,
|
|
6779
|
-
logLevel
|
|
6780
|
-
});
|
|
6781
|
-
}, [environment, logLevel, scope]);
|
|
6782
|
-
const cancelRender2 = useCallback2((err) => {
|
|
6783
|
-
return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
|
|
6784
|
-
}, [scope]);
|
|
6785
|
-
return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
|
|
6862
|
+
var useTimelinePosition = () => {
|
|
6863
|
+
const state = useTimelineContext();
|
|
6864
|
+
return useTimelinePositionFromContext(state);
|
|
6786
6865
|
};
|
|
6787
|
-
var
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
setPlaying: () => {
|
|
6792
|
-
throw new Error("default");
|
|
6866
|
+
var useAbsoluteTimelinePosition = () => {
|
|
6867
|
+
const state = useContext7(AbsoluteTimeContext);
|
|
6868
|
+
if (state === null) {
|
|
6869
|
+
throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
6793
6870
|
}
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
}
|
|
6803
|
-
|
|
6804
|
-
throw new Error("default");
|
|
6805
|
-
},
|
|
6806
|
-
audioAndVideoTags: { current: [] }
|
|
6807
|
-
});
|
|
6808
|
-
var TimelineContextProvider = ({ children, frameState }) => {
|
|
6809
|
-
const [playing, setPlaying] = useState2(false);
|
|
6810
|
-
const imperativePlaying = useRef(false);
|
|
6811
|
-
const [playbackRate, setPlaybackRate] = useState2(1);
|
|
6812
|
-
const audioAndVideoTags = useRef([]);
|
|
6813
|
-
const [remotionRootId] = useState2(() => String(random(null)));
|
|
6814
|
-
const [_frame, setFrame] = useState2(() => getInitialFrameState());
|
|
6815
|
-
const frame = frameState ?? _frame;
|
|
6816
|
-
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
6817
|
-
if (typeof window !== "undefined") {
|
|
6818
|
-
useLayoutEffect(() => {
|
|
6819
|
-
window.remotion_setFrame = (f, composition, attempt) => {
|
|
6820
|
-
window.remotion_attempt = attempt;
|
|
6821
|
-
const id = delayRender2(`Setting the current frame to ${f}`);
|
|
6822
|
-
let asyncUpdate = true;
|
|
6823
|
-
setFrame((s) => {
|
|
6824
|
-
const currentFrame = s[composition] ?? window.remotion_initialFrame;
|
|
6825
|
-
if (currentFrame === f) {
|
|
6826
|
-
asyncUpdate = false;
|
|
6827
|
-
return s;
|
|
6828
|
-
}
|
|
6829
|
-
return {
|
|
6830
|
-
...s,
|
|
6831
|
-
[composition]: f
|
|
6832
|
-
};
|
|
6833
|
-
});
|
|
6834
|
-
if (asyncUpdate) {
|
|
6835
|
-
requestAnimationFrame(() => continueRender2(id));
|
|
6836
|
-
} else {
|
|
6837
|
-
continueRender2(id);
|
|
6838
|
-
}
|
|
6839
|
-
};
|
|
6840
|
-
window.remotion_isPlayer = false;
|
|
6841
|
-
}, [continueRender2, delayRender2]);
|
|
6842
|
-
}
|
|
6843
|
-
const timelineContextValue = useMemo6(() => {
|
|
6844
|
-
return {
|
|
6845
|
-
frame,
|
|
6846
|
-
playing,
|
|
6847
|
-
imperativePlaying,
|
|
6848
|
-
rootId: remotionRootId,
|
|
6849
|
-
playbackRate,
|
|
6850
|
-
setPlaybackRate,
|
|
6851
|
-
audioAndVideoTags
|
|
6852
|
-
};
|
|
6853
|
-
}, [frame, playbackRate, playing, remotionRootId]);
|
|
6854
|
-
const setTimelineContextValue = useMemo6(() => {
|
|
6855
|
-
return {
|
|
6856
|
-
setFrame,
|
|
6857
|
-
setPlaying
|
|
6858
|
-
};
|
|
6859
|
-
}, []);
|
|
6860
|
-
return /* @__PURE__ */ jsx42(TimelineContext.Provider, {
|
|
6861
|
-
value: timelineContextValue,
|
|
6862
|
-
children: /* @__PURE__ */ jsx42(SetTimelineContext.Provider, {
|
|
6863
|
-
value: setTimelineContextValue,
|
|
6864
|
-
children
|
|
6865
|
-
})
|
|
6866
|
-
});
|
|
6871
|
+
return useTimelinePositionFromContext(state);
|
|
6872
|
+
};
|
|
6873
|
+
var useTimelineSetFrame = () => {
|
|
6874
|
+
const { setFrame } = useContext7(SetTimelineContext);
|
|
6875
|
+
return setFrame;
|
|
6876
|
+
};
|
|
6877
|
+
var usePlayingState = () => {
|
|
6878
|
+
const { playing, imperativePlaying } = useTimelineContext();
|
|
6879
|
+
const { setPlaying } = useContext7(SetTimelineContext);
|
|
6880
|
+
return useMemo6(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
|
|
6867
6881
|
};
|
|
6868
6882
|
var CanUseRemotionHooks = createContext10(false);
|
|
6869
6883
|
var CanUseRemotionHooksProvider = ({ children }) => {
|
|
@@ -6972,7 +6986,7 @@ var Freeze = ({
|
|
|
6972
6986
|
return active(frame);
|
|
6973
6987
|
}
|
|
6974
6988
|
}, [active, frame]);
|
|
6975
|
-
const timelineContext =
|
|
6989
|
+
const timelineContext = useTimelineContext();
|
|
6976
6990
|
const sequenceContext = useContext11(SequenceContext);
|
|
6977
6991
|
const relativeFrom = sequenceContext?.relativeFrom ?? 0;
|
|
6978
6992
|
const timelineValue = useMemo8(() => {
|
|
@@ -7013,18 +7027,36 @@ var Freeze = ({
|
|
|
7013
7027
|
var NonceContext = createContext11({
|
|
7014
7028
|
getNonce: () => 0
|
|
7015
7029
|
});
|
|
7030
|
+
var fastRefreshNonce = 0;
|
|
7031
|
+
try {
|
|
7032
|
+
if (typeof __webpack_module__ !== "undefined") {
|
|
7033
|
+
if (__webpack_module__.hot) {
|
|
7034
|
+
__webpack_module__.hot.addStatusHandler((status) => {
|
|
7035
|
+
if (status === "idle") {
|
|
7036
|
+
fastRefreshNonce++;
|
|
7037
|
+
}
|
|
7038
|
+
});
|
|
7039
|
+
}
|
|
7040
|
+
}
|
|
7041
|
+
} catch {}
|
|
7016
7042
|
var useNonce = () => {
|
|
7017
7043
|
const context = useContext12(NonceContext);
|
|
7018
|
-
const
|
|
7019
|
-
const
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7044
|
+
const nonce = context.getNonce();
|
|
7045
|
+
const nonceRef = useRef2(nonce);
|
|
7046
|
+
nonceRef.current = nonce;
|
|
7047
|
+
const history = useRef2([[fastRefreshNonce, nonce]]);
|
|
7048
|
+
const get = useCallback3(() => {
|
|
7049
|
+
if (fastRefreshNonce !== history.current[history.current.length - 1][0]) {
|
|
7050
|
+
history.current = [
|
|
7051
|
+
...history.current,
|
|
7052
|
+
[fastRefreshNonce, nonceRef.current]
|
|
7053
|
+
];
|
|
7023
7054
|
}
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7055
|
+
return history.current;
|
|
7056
|
+
}, [history]);
|
|
7057
|
+
return useMemo9(() => {
|
|
7058
|
+
return { get };
|
|
7059
|
+
}, [get]);
|
|
7028
7060
|
};
|
|
7029
7061
|
var PremountContext = createContext12({
|
|
7030
7062
|
premountFramesRemaining: 0,
|
|
@@ -7045,22 +7077,28 @@ var SequenceVisibilityToggleContext = React8.createContext({
|
|
|
7045
7077
|
throw new Error("SequenceVisibilityToggle not initialized");
|
|
7046
7078
|
}
|
|
7047
7079
|
});
|
|
7048
|
-
var
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
throw new Error("
|
|
7080
|
+
var VisualModeOverridesContext = React8.createContext({
|
|
7081
|
+
dragOverrides: {},
|
|
7082
|
+
setDragOverrides: () => {
|
|
7083
|
+
throw new Error("VisualModeOverridesContext not initialized");
|
|
7052
7084
|
},
|
|
7053
|
-
|
|
7054
|
-
throw new Error("
|
|
7055
|
-
}
|
|
7085
|
+
clearDragOverrides: () => {
|
|
7086
|
+
throw new Error("VisualModeOverridesContext not initialized");
|
|
7087
|
+
},
|
|
7088
|
+
codeValues: {},
|
|
7089
|
+
setCodeValues: () => {
|
|
7090
|
+
throw new Error("VisualModeOverridesContext not initialized");
|
|
7091
|
+
},
|
|
7092
|
+
visualModeEnabled: false
|
|
7056
7093
|
});
|
|
7057
|
-
var SequenceManagerProvider = ({ children }) => {
|
|
7058
|
-
const [sequences, setSequences] =
|
|
7059
|
-
const [hidden, setHidden] =
|
|
7060
|
-
const [
|
|
7061
|
-
const controlOverridesRef = useRef3(
|
|
7062
|
-
controlOverridesRef.current =
|
|
7063
|
-
const
|
|
7094
|
+
var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
7095
|
+
const [sequences, setSequences] = useState3([]);
|
|
7096
|
+
const [hidden, setHidden] = useState3({});
|
|
7097
|
+
const [dragOverrides, setControlOverrides] = useState3({});
|
|
7098
|
+
const controlOverridesRef = useRef3(dragOverrides);
|
|
7099
|
+
controlOverridesRef.current = dragOverrides;
|
|
7100
|
+
const [codeValues, setCodeValuesMapState] = useState3({});
|
|
7101
|
+
const setDragOverrides = useCallback4((sequenceId, key, value) => {
|
|
7064
7102
|
setControlOverrides((prev) => ({
|
|
7065
7103
|
...prev,
|
|
7066
7104
|
[sequenceId]: {
|
|
@@ -7069,7 +7107,7 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
7069
7107
|
}
|
|
7070
7108
|
}));
|
|
7071
7109
|
}, []);
|
|
7072
|
-
const
|
|
7110
|
+
const clearDragOverrides = useCallback4((sequenceId) => {
|
|
7073
7111
|
setControlOverrides((prev) => {
|
|
7074
7112
|
if (!prev[sequenceId]) {
|
|
7075
7113
|
return prev;
|
|
@@ -7079,39 +7117,65 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
7079
7117
|
return next;
|
|
7080
7118
|
});
|
|
7081
7119
|
}, []);
|
|
7082
|
-
const
|
|
7120
|
+
const setCodeValues = useCallback4((sequenceId, values) => {
|
|
7121
|
+
setCodeValuesMapState((prev) => {
|
|
7122
|
+
if (prev[sequenceId] === values) {
|
|
7123
|
+
return prev;
|
|
7124
|
+
}
|
|
7125
|
+
if (values === null) {
|
|
7126
|
+
if (!(sequenceId in prev)) {
|
|
7127
|
+
return prev;
|
|
7128
|
+
}
|
|
7129
|
+
const next = { ...prev };
|
|
7130
|
+
delete next[sequenceId];
|
|
7131
|
+
return next;
|
|
7132
|
+
}
|
|
7133
|
+
return { ...prev, [sequenceId]: values };
|
|
7134
|
+
});
|
|
7135
|
+
}, []);
|
|
7136
|
+
const registerSequence = useCallback4((seq) => {
|
|
7083
7137
|
setSequences((seqs) => {
|
|
7084
7138
|
return [...seqs, seq];
|
|
7085
7139
|
});
|
|
7086
7140
|
}, []);
|
|
7087
|
-
const unregisterSequence =
|
|
7141
|
+
const unregisterSequence = useCallback4((seq) => {
|
|
7088
7142
|
setSequences((seqs) => seqs.filter((s) => s.id !== seq));
|
|
7089
7143
|
}, []);
|
|
7090
|
-
const sequenceContext =
|
|
7144
|
+
const sequenceContext = useMemo10(() => {
|
|
7091
7145
|
return {
|
|
7092
7146
|
registerSequence,
|
|
7093
7147
|
sequences,
|
|
7094
7148
|
unregisterSequence
|
|
7095
7149
|
};
|
|
7096
7150
|
}, [registerSequence, sequences, unregisterSequence]);
|
|
7097
|
-
const hiddenContext =
|
|
7151
|
+
const hiddenContext = useMemo10(() => {
|
|
7098
7152
|
return {
|
|
7099
7153
|
hidden,
|
|
7100
7154
|
setHidden
|
|
7101
7155
|
};
|
|
7102
7156
|
}, [hidden]);
|
|
7103
|
-
const overrideContext =
|
|
7157
|
+
const overrideContext = useMemo10(() => {
|
|
7104
7158
|
return {
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7159
|
+
visualModeEnabled,
|
|
7160
|
+
dragOverrides,
|
|
7161
|
+
setDragOverrides,
|
|
7162
|
+
clearDragOverrides,
|
|
7163
|
+
codeValues,
|
|
7164
|
+
setCodeValues
|
|
7108
7165
|
};
|
|
7109
|
-
}, [
|
|
7166
|
+
}, [
|
|
7167
|
+
visualModeEnabled,
|
|
7168
|
+
dragOverrides,
|
|
7169
|
+
setDragOverrides,
|
|
7170
|
+
clearDragOverrides,
|
|
7171
|
+
codeValues,
|
|
7172
|
+
setCodeValues
|
|
7173
|
+
]);
|
|
7110
7174
|
return /* @__PURE__ */ jsx72(SequenceManager.Provider, {
|
|
7111
7175
|
value: sequenceContext,
|
|
7112
7176
|
children: /* @__PURE__ */ jsx72(SequenceVisibilityToggleContext.Provider, {
|
|
7113
7177
|
value: hiddenContext,
|
|
7114
|
-
children: /* @__PURE__ */ jsx72(
|
|
7178
|
+
children: /* @__PURE__ */ jsx72(VisualModeOverridesContext.Provider, {
|
|
7115
7179
|
value: overrideContext,
|
|
7116
7180
|
children
|
|
7117
7181
|
})
|
|
@@ -7135,9 +7199,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7135
7199
|
...other
|
|
7136
7200
|
}, ref) => {
|
|
7137
7201
|
const { layout = "absolute-fill" } = other;
|
|
7138
|
-
const [id] =
|
|
7202
|
+
const [id] = useState4(() => String(Math.random()));
|
|
7139
7203
|
const parentSequence = useContext13(SequenceContext);
|
|
7140
|
-
const { rootId } =
|
|
7204
|
+
const { rootId } = useTimelineContext();
|
|
7141
7205
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
7142
7206
|
const nonce = useNonce();
|
|
7143
7207
|
if (layout !== "absolute-fill" && layout !== "none") {
|
|
@@ -7164,13 +7228,13 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7164
7228
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
7165
7229
|
const { registerSequence, unregisterSequence } = useContext13(SequenceManager);
|
|
7166
7230
|
const { hidden } = useContext13(SequenceVisibilityToggleContext);
|
|
7167
|
-
const premounting =
|
|
7231
|
+
const premounting = useMemo11(() => {
|
|
7168
7232
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
7169
7233
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
7170
|
-
const postmounting =
|
|
7234
|
+
const postmounting = useMemo11(() => {
|
|
7171
7235
|
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
7172
7236
|
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
7173
|
-
const contextValue =
|
|
7237
|
+
const contextValue = useMemo11(() => {
|
|
7174
7238
|
return {
|
|
7175
7239
|
cumulatedFrom,
|
|
7176
7240
|
relativeFrom: from,
|
|
@@ -7197,12 +7261,12 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7197
7261
|
premountDisplay,
|
|
7198
7262
|
postmountDisplay
|
|
7199
7263
|
]);
|
|
7200
|
-
const timelineClipName =
|
|
7264
|
+
const timelineClipName = useMemo11(() => {
|
|
7201
7265
|
return name ?? "";
|
|
7202
7266
|
}, [name]);
|
|
7203
7267
|
const env = useRemotionEnvironment();
|
|
7204
7268
|
const inheritedStack = other?.stack ?? null;
|
|
7205
|
-
|
|
7269
|
+
useEffect(() => {
|
|
7206
7270
|
if (!env.isStudio) {
|
|
7207
7271
|
return;
|
|
7208
7272
|
}
|
|
@@ -7215,7 +7279,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7215
7279
|
type: "sequence",
|
|
7216
7280
|
rootId,
|
|
7217
7281
|
showInTimeline,
|
|
7218
|
-
nonce,
|
|
7282
|
+
nonce: nonce.get(),
|
|
7219
7283
|
loopDisplay,
|
|
7220
7284
|
stack: stack ?? inheritedStack,
|
|
7221
7285
|
premountDisplay: premountDisplay ?? null,
|
|
@@ -7249,7 +7313,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7249
7313
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
7250
7314
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
7251
7315
|
const styleIfThere = other.layout === "none" ? undefined : other.style;
|
|
7252
|
-
const defaultStyle =
|
|
7316
|
+
const defaultStyle = useMemo11(() => {
|
|
7253
7317
|
return {
|
|
7254
7318
|
flexDirection: undefined,
|
|
7255
7319
|
...width ? { width } : {},
|
|
@@ -7276,7 +7340,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7276
7340
|
};
|
|
7277
7341
|
var RegularSequence = forwardRef2(RegularSequenceRefForwardingFunction);
|
|
7278
7342
|
var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
7279
|
-
const
|
|
7343
|
+
const parentPremountContext = useContext13(PremountContext);
|
|
7344
|
+
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
7280
7345
|
if (props.layout === "none") {
|
|
7281
7346
|
throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
|
|
7282
7347
|
}
|
|
@@ -7295,7 +7360,7 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
7295
7360
|
const postmountingActive = frame > endThreshold && frame <= endThreshold + postmountFor;
|
|
7296
7361
|
const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
|
|
7297
7362
|
const isFreezingActive = premountingActive || postmountingActive;
|
|
7298
|
-
const style =
|
|
7363
|
+
const style = useMemo11(() => {
|
|
7299
7364
|
return {
|
|
7300
7365
|
...passedStyle,
|
|
7301
7366
|
opacity: premountingActive || postmountingActive ? 0 : 1,
|
|
@@ -7310,10 +7375,9 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
7310
7375
|
styleWhilePremounted,
|
|
7311
7376
|
styleWhilePostmounted
|
|
7312
7377
|
]);
|
|
7313
|
-
const
|
|
7314
|
-
const
|
|
7315
|
-
const
|
|
7316
|
-
const premountContextValue = useMemo10(() => {
|
|
7378
|
+
const { playing } = useTimelineContext();
|
|
7379
|
+
const premountFramesRemaining = premountingActive ? from - frame : 0;
|
|
7380
|
+
const premountContextValue = useMemo11(() => {
|
|
7317
7381
|
return {
|
|
7318
7382
|
premountFramesRemaining,
|
|
7319
7383
|
playing: parentPremountContext.playing || playing
|
|
@@ -7408,7 +7472,7 @@ var calcArgs = (fit, frameSize, canvasSize) => {
|
|
|
7408
7472
|
};
|
|
7409
7473
|
var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
|
|
7410
7474
|
const canvasRef = useRef4(null);
|
|
7411
|
-
const draw =
|
|
7475
|
+
const draw = useCallback5((imageData) => {
|
|
7412
7476
|
const canvas = canvasRef.current;
|
|
7413
7477
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
7414
7478
|
const canvasHeight = height ?? imageData.displayHeight;
|
|
@@ -7611,7 +7675,7 @@ var AnimatedImage = forwardRef3(({
|
|
|
7611
7675
|
...props
|
|
7612
7676
|
}, canvasRef) => {
|
|
7613
7677
|
const mountState = useRef5({ isMounted: true });
|
|
7614
|
-
|
|
7678
|
+
useEffect2(() => {
|
|
7615
7679
|
const { current } = mountState;
|
|
7616
7680
|
current.isMounted = true;
|
|
7617
7681
|
return () => {
|
|
@@ -7619,9 +7683,9 @@ var AnimatedImage = forwardRef3(({
|
|
|
7619
7683
|
};
|
|
7620
7684
|
}, []);
|
|
7621
7685
|
const resolvedSrc = resolveAnimatedImageSource(src);
|
|
7622
|
-
const [imageDecoder, setImageDecoder] =
|
|
7686
|
+
const [imageDecoder, setImageDecoder] = useState5(null);
|
|
7623
7687
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
7624
|
-
const [decodeHandle] =
|
|
7688
|
+
const [decodeHandle] = useState5(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
|
|
7625
7689
|
const frame = useCurrentFrame();
|
|
7626
7690
|
const { fps } = useVideoConfig();
|
|
7627
7691
|
const currentTime = frame / playbackRate / fps;
|
|
@@ -7635,8 +7699,8 @@ var AnimatedImage = forwardRef3(({
|
|
|
7635
7699
|
}
|
|
7636
7700
|
return c;
|
|
7637
7701
|
}, []);
|
|
7638
|
-
const [initialLoopBehavior] =
|
|
7639
|
-
|
|
7702
|
+
const [initialLoopBehavior] = useState5(() => loopBehavior);
|
|
7703
|
+
useEffect2(() => {
|
|
7640
7704
|
const controller = new AbortController;
|
|
7641
7705
|
decodeImage({
|
|
7642
7706
|
resolvedSrc,
|
|
@@ -7746,9 +7810,9 @@ var RenderAssetManager = createContext13({
|
|
|
7746
7810
|
renderAssets: []
|
|
7747
7811
|
});
|
|
7748
7812
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
7749
|
-
const [renderAssets, setRenderAssets] =
|
|
7813
|
+
const [renderAssets, setRenderAssets] = useState6([]);
|
|
7750
7814
|
const renderAssetsRef = useRef6([]);
|
|
7751
|
-
const registerRenderAsset =
|
|
7815
|
+
const registerRenderAsset = useCallback6((renderAsset) => {
|
|
7752
7816
|
validateRenderAsset(renderAsset);
|
|
7753
7817
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
7754
7818
|
setRenderAssets(renderAssetsRef.current);
|
|
@@ -7765,7 +7829,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
7765
7829
|
};
|
|
7766
7830
|
}, []);
|
|
7767
7831
|
}
|
|
7768
|
-
const unregisterRenderAsset =
|
|
7832
|
+
const unregisterRenderAsset = useCallback6((id) => {
|
|
7769
7833
|
renderAssetsRef.current = renderAssetsRef.current.filter((a) => a.id !== id);
|
|
7770
7834
|
setRenderAssets(renderAssetsRef.current);
|
|
7771
7835
|
}, []);
|
|
@@ -7779,14 +7843,14 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
7779
7843
|
};
|
|
7780
7844
|
}
|
|
7781
7845
|
}, []);
|
|
7782
|
-
const contextValue =
|
|
7846
|
+
const contextValue = useMemo12(() => {
|
|
7783
7847
|
return {
|
|
7784
7848
|
registerRenderAsset,
|
|
7785
7849
|
unregisterRenderAsset,
|
|
7786
7850
|
renderAssets
|
|
7787
7851
|
};
|
|
7788
7852
|
}, [renderAssets, registerRenderAsset, unregisterRenderAsset]);
|
|
7789
|
-
return /* @__PURE__ */
|
|
7853
|
+
return /* @__PURE__ */ jsx112(RenderAssetManager.Provider, {
|
|
7790
7854
|
value: contextValue,
|
|
7791
7855
|
children
|
|
7792
7856
|
});
|
|
@@ -7796,7 +7860,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
7796
7860
|
const { registerRenderAsset, unregisterRenderAsset } = useContext14(RenderAssetManager);
|
|
7797
7861
|
const env = useRemotionEnvironment();
|
|
7798
7862
|
const frame = useCurrentFrame();
|
|
7799
|
-
const [id] =
|
|
7863
|
+
const [id] = useState7(() => {
|
|
7800
7864
|
return String(Math.random());
|
|
7801
7865
|
});
|
|
7802
7866
|
useLayoutEffect4(() => {
|
|
@@ -7901,14 +7965,14 @@ var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) =>
|
|
|
7901
7965
|
const iteration = Math.floor(currentFrame / durationInFrames);
|
|
7902
7966
|
const start = iteration * durationInFrames;
|
|
7903
7967
|
const from = Math.min(start, maxFrame);
|
|
7904
|
-
const loopDisplay =
|
|
7968
|
+
const loopDisplay = useMemo13(() => {
|
|
7905
7969
|
return {
|
|
7906
7970
|
numberOfTimes: Math.min(compDuration / durationInFrames, times),
|
|
7907
7971
|
startOffset: -from,
|
|
7908
7972
|
durationInFrames
|
|
7909
7973
|
};
|
|
7910
7974
|
}, [compDuration, durationInFrames, from, times]);
|
|
7911
|
-
const loopContext =
|
|
7975
|
+
const loopContext = useMemo13(() => {
|
|
7912
7976
|
return {
|
|
7913
7977
|
iteration: Math.floor(currentFrame / durationInFrames),
|
|
7914
7978
|
durationInFrames
|
|
@@ -7945,8 +8009,8 @@ var setPreloads = (updater) => {
|
|
|
7945
8009
|
updaters.forEach((u) => u());
|
|
7946
8010
|
};
|
|
7947
8011
|
var PrefetchProvider = ({ children }) => {
|
|
7948
|
-
const [_preloads, _setPreloads] =
|
|
7949
|
-
|
|
8012
|
+
const [_preloads, _setPreloads] = useState8(() => preloads);
|
|
8013
|
+
useEffect3(() => {
|
|
7950
8014
|
const updaterFunction = () => {
|
|
7951
8015
|
_setPreloads(preloads);
|
|
7952
8016
|
};
|
|
@@ -8266,7 +8330,7 @@ var DurationsContext = createContext16({
|
|
|
8266
8330
|
});
|
|
8267
8331
|
var DurationsContextProvider = ({ children }) => {
|
|
8268
8332
|
const [durations, setDurations] = useReducer(durationReducer, {});
|
|
8269
|
-
const value =
|
|
8333
|
+
const value = useMemo14(() => {
|
|
8270
8334
|
return {
|
|
8271
8335
|
durations,
|
|
8272
8336
|
setDurations
|
|
@@ -8400,7 +8464,7 @@ var useSingletonAudioContext = ({
|
|
|
8400
8464
|
audioEnabled
|
|
8401
8465
|
}) => {
|
|
8402
8466
|
const env = useRemotionEnvironment();
|
|
8403
|
-
const audioContext =
|
|
8467
|
+
const audioContext = useMemo15(() => {
|
|
8404
8468
|
if (env.isRendering) {
|
|
8405
8469
|
return null;
|
|
8406
8470
|
}
|
|
@@ -8447,7 +8511,7 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
8447
8511
|
var SharedAudioContext = createContext17(null);
|
|
8448
8512
|
var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHint, audioEnabled }) => {
|
|
8449
8513
|
const audios = useRef7([]);
|
|
8450
|
-
const [initialNumberOfAudioTags] =
|
|
8514
|
+
const [initialNumberOfAudioTags] = useState9(numberOfAudioTags);
|
|
8451
8515
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
8452
8516
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
8453
8517
|
}
|
|
@@ -8457,7 +8521,64 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8457
8521
|
latencyHint: audioLatencyHint,
|
|
8458
8522
|
audioEnabled
|
|
8459
8523
|
});
|
|
8460
|
-
const
|
|
8524
|
+
const audioSyncAnchor = useMemo16(() => ({ value: 0 }), []);
|
|
8525
|
+
const prevEndTimes = useRef7({ scheduledEndTime: null, mediaEndTime: null });
|
|
8526
|
+
const scheduleAudioNode = useMemo16(() => {
|
|
8527
|
+
return ({
|
|
8528
|
+
node,
|
|
8529
|
+
mediaTimestamp,
|
|
8530
|
+
targetTime,
|
|
8531
|
+
currentTime,
|
|
8532
|
+
sequenceEndTime,
|
|
8533
|
+
sequenceStartTime,
|
|
8534
|
+
debugAudioScheduling
|
|
8535
|
+
}) => {
|
|
8536
|
+
if (!audioContext) {
|
|
8537
|
+
throw new Error("Audio context not found");
|
|
8538
|
+
}
|
|
8539
|
+
const bufferDuration = node.buffer?.duration ?? 0;
|
|
8540
|
+
const unclampedMediaEndTime = mediaTimestamp + bufferDuration;
|
|
8541
|
+
const needsTrimEnd = unclampedMediaEndTime > sequenceEndTime;
|
|
8542
|
+
const needsTrimStart = mediaTimestamp < sequenceStartTime;
|
|
8543
|
+
const offsetBecauseOfTrim = needsTrimStart ? sequenceStartTime - mediaTimestamp : 0;
|
|
8544
|
+
const offsetBecauseOfTooLate = targetTime < 0 ? -targetTime : 0;
|
|
8545
|
+
const offset = offsetBecauseOfTrim + offsetBecauseOfTooLate;
|
|
8546
|
+
const duration = needsTrimEnd ? bufferDuration - Math.max(0, unclampedMediaEndTime - sequenceEndTime) - offset : bufferDuration - offset;
|
|
8547
|
+
const scheduledTime = targetTime + currentTime + offset;
|
|
8548
|
+
if (offset < 0) {
|
|
8549
|
+
throw new Error("offset < 0: " + JSON.stringify({
|
|
8550
|
+
offset,
|
|
8551
|
+
targetTime,
|
|
8552
|
+
currentTime,
|
|
8553
|
+
offsetBecauseOfTrim,
|
|
8554
|
+
offsetBecauseOfTooLate
|
|
8555
|
+
}));
|
|
8556
|
+
}
|
|
8557
|
+
if (duration > 0) {
|
|
8558
|
+
node.start(scheduledTime, offset, duration);
|
|
8559
|
+
}
|
|
8560
|
+
const scheduledEndTime = scheduledTime + duration / node.playbackRate.value;
|
|
8561
|
+
const mediaTime = mediaTimestamp + offset;
|
|
8562
|
+
const mediaEndTime = mediaTime + duration;
|
|
8563
|
+
const latency = audioContext.baseLatency + audioContext.outputLatency;
|
|
8564
|
+
const timeDiff = scheduledTime - currentTime - latency;
|
|
8565
|
+
const prev = prevEndTimes.current;
|
|
8566
|
+
const scheduledMismatch = prev.scheduledEndTime !== null && Math.abs(scheduledTime - prev.scheduledEndTime) > 0.001;
|
|
8567
|
+
const mediaMismatch = prev.mediaEndTime !== null && Math.abs(mediaTime - prev.mediaEndTime) > 0.001;
|
|
8568
|
+
if (debugAudioScheduling) {
|
|
8569
|
+
Log.info({ logLevel, tag: "audio-scheduling" }, "scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s", scheduledMismatch ? "color: red; font-weight: bold" : "", scheduledTime.toFixed(4), "", scheduledEndTime.toFixed(4), mediaMismatch ? "color: red; font-weight: bold" : "", mediaTime.toFixed(4), "", mediaEndTime.toFixed(4), duration < 0 ? "color: red; font-weight: bold" : timeDiff < 0 ? "color: red; font-weight: bold" : "color: blue; font-weight: bold", duration < 0 ? "missed " + Math.abs(offset).toFixed(2) + "s" : Math.abs(timeDiff).toFixed(2) + (timeDiff < 0 ? " delay" : " ahead"), "", "current=" + currentTime.toFixed(4), "offset=" + offset.toFixed(4), "latency=" + latency.toFixed(4), "state=" + audioContext.state);
|
|
8570
|
+
}
|
|
8571
|
+
prev.scheduledEndTime = scheduledEndTime;
|
|
8572
|
+
prev.mediaEndTime = mediaEndTime;
|
|
8573
|
+
return duration > 0 ? {
|
|
8574
|
+
type: "started",
|
|
8575
|
+
scheduledTime
|
|
8576
|
+
} : {
|
|
8577
|
+
type: "not-started"
|
|
8578
|
+
};
|
|
8579
|
+
};
|
|
8580
|
+
}, [audioContext, logLevel]);
|
|
8581
|
+
const refs = useMemo16(() => {
|
|
8461
8582
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
8462
8583
|
const ref = createRef2();
|
|
8463
8584
|
return {
|
|
@@ -8481,7 +8602,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8481
8602
|
};
|
|
8482
8603
|
}, [refs]);
|
|
8483
8604
|
const takenAudios = useRef7(new Array(numberOfAudioTags).fill(false));
|
|
8484
|
-
const rerenderAudios =
|
|
8605
|
+
const rerenderAudios = useCallback7(() => {
|
|
8485
8606
|
refs.forEach(({ ref, id }) => {
|
|
8486
8607
|
const data = audios.current?.find((a) => a.id === id);
|
|
8487
8608
|
const { current } = ref;
|
|
@@ -8502,7 +8623,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8502
8623
|
});
|
|
8503
8624
|
});
|
|
8504
8625
|
}, [refs]);
|
|
8505
|
-
const registerAudio =
|
|
8626
|
+
const registerAudio = useCallback7((options) => {
|
|
8506
8627
|
const { aud, audioId, premounting, postmounting } = options;
|
|
8507
8628
|
const found = audios.current?.find((a) => a.audioId === audioId);
|
|
8508
8629
|
if (found) {
|
|
@@ -8531,7 +8652,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8531
8652
|
rerenderAudios();
|
|
8532
8653
|
return newElem;
|
|
8533
8654
|
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
8534
|
-
const unregisterAudio =
|
|
8655
|
+
const unregisterAudio = useCallback7((id) => {
|
|
8535
8656
|
const cloned = [...takenAudios.current];
|
|
8536
8657
|
const index = refs.findIndex((r2) => r2.id === id);
|
|
8537
8658
|
if (index === -1) {
|
|
@@ -8542,7 +8663,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8542
8663
|
audios.current = audios.current?.filter((a) => a.id !== id);
|
|
8543
8664
|
rerenderAudios();
|
|
8544
8665
|
}, [refs, rerenderAudios]);
|
|
8545
|
-
const updateAudio =
|
|
8666
|
+
const updateAudio = useCallback7(({
|
|
8546
8667
|
aud,
|
|
8547
8668
|
audioId,
|
|
8548
8669
|
id,
|
|
@@ -8578,7 +8699,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8578
8699
|
}, [rerenderAudios]);
|
|
8579
8700
|
const mountTime = useMountTime();
|
|
8580
8701
|
const env = useRemotionEnvironment();
|
|
8581
|
-
const playAllAudios =
|
|
8702
|
+
const playAllAudios = useCallback7(() => {
|
|
8582
8703
|
refs.forEach((ref) => {
|
|
8583
8704
|
const audio = audios.current.find((a) => a.el === ref.ref);
|
|
8584
8705
|
if (audio?.premounting) {
|
|
@@ -8596,14 +8717,16 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8596
8717
|
});
|
|
8597
8718
|
audioContext?.resume();
|
|
8598
8719
|
}, [audioContext, logLevel, mountTime, refs, env.isPlayer]);
|
|
8599
|
-
const value =
|
|
8720
|
+
const value = useMemo16(() => {
|
|
8600
8721
|
return {
|
|
8601
8722
|
registerAudio,
|
|
8602
8723
|
unregisterAudio,
|
|
8603
8724
|
updateAudio,
|
|
8604
8725
|
playAllAudios,
|
|
8605
8726
|
numberOfAudioTags,
|
|
8606
|
-
audioContext
|
|
8727
|
+
audioContext,
|
|
8728
|
+
audioSyncAnchor,
|
|
8729
|
+
scheduleAudioNode
|
|
8607
8730
|
};
|
|
8608
8731
|
}, [
|
|
8609
8732
|
numberOfAudioTags,
|
|
@@ -8611,7 +8734,9 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
8611
8734
|
registerAudio,
|
|
8612
8735
|
unregisterAudio,
|
|
8613
8736
|
updateAudio,
|
|
8614
|
-
audioContext
|
|
8737
|
+
audioContext,
|
|
8738
|
+
audioSyncAnchor,
|
|
8739
|
+
scheduleAudioNode
|
|
8615
8740
|
]);
|
|
8616
8741
|
return /* @__PURE__ */ jsxs2(SharedAudioContext.Provider, {
|
|
8617
8742
|
value,
|
|
@@ -8634,7 +8759,7 @@ var useSharedAudio = ({
|
|
|
8634
8759
|
postmounting
|
|
8635
8760
|
}) => {
|
|
8636
8761
|
const ctx = useContext16(SharedAudioContext);
|
|
8637
|
-
const [elem] =
|
|
8762
|
+
const [elem] = useState9(() => {
|
|
8638
8763
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
8639
8764
|
return ctx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
8640
8765
|
}
|
|
@@ -8928,7 +9053,7 @@ var useBasicMediaInTimeline = ({
|
|
|
8928
9053
|
const startsAt = useMediaStartsAt();
|
|
8929
9054
|
const parentSequence = useContext19(SequenceContext);
|
|
8930
9055
|
const videoConfig = useVideoConfig();
|
|
8931
|
-
const [initialVolume] =
|
|
9056
|
+
const [initialVolume] = useState10(() => volume);
|
|
8932
9057
|
const mediaDuration = calculateMediaDuration({
|
|
8933
9058
|
mediaDurationInFrames: videoConfig.durationInFrames,
|
|
8934
9059
|
playbackRate,
|
|
@@ -8936,7 +9061,7 @@ var useBasicMediaInTimeline = ({
|
|
|
8936
9061
|
trimAfter
|
|
8937
9062
|
});
|
|
8938
9063
|
const duration = parentSequence ? Math.min(parentSequence.durationInFrames, mediaDuration) : mediaDuration;
|
|
8939
|
-
const volumes =
|
|
9064
|
+
const volumes = useMemo17(() => {
|
|
8940
9065
|
if (typeof volume === "number") {
|
|
8941
9066
|
return volume;
|
|
8942
9067
|
}
|
|
@@ -8948,14 +9073,14 @@ var useBasicMediaInTimeline = ({
|
|
|
8948
9073
|
});
|
|
8949
9074
|
}).join(",");
|
|
8950
9075
|
}, [duration, startsAt, volume, mediaVolume]);
|
|
8951
|
-
|
|
9076
|
+
useEffect4(() => {
|
|
8952
9077
|
if (typeof volume === "number" && volume !== initialVolume) {
|
|
8953
9078
|
warnOnce2(`Remotion: The ${mediaType} with src ${src} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`);
|
|
8954
9079
|
}
|
|
8955
9080
|
}, [initialVolume, mediaType, src, volume]);
|
|
8956
9081
|
const doesVolumeChange = typeof volume === "function";
|
|
8957
9082
|
const nonce = useNonce();
|
|
8958
|
-
const { rootId } =
|
|
9083
|
+
const { rootId } = useTimelineContext();
|
|
8959
9084
|
const env = useRemotionEnvironment();
|
|
8960
9085
|
return {
|
|
8961
9086
|
volumes,
|
|
@@ -9002,7 +9127,7 @@ var useMediaInTimeline = ({
|
|
|
9002
9127
|
trimBefore: undefined,
|
|
9003
9128
|
playbackRate
|
|
9004
9129
|
});
|
|
9005
|
-
|
|
9130
|
+
useEffect4(() => {
|
|
9006
9131
|
if (!src) {
|
|
9007
9132
|
throw new Error("No src passed");
|
|
9008
9133
|
}
|
|
@@ -9023,7 +9148,7 @@ var useMediaInTimeline = ({
|
|
|
9023
9148
|
rootId,
|
|
9024
9149
|
volume: volumes,
|
|
9025
9150
|
showInTimeline: true,
|
|
9026
|
-
nonce,
|
|
9151
|
+
nonce: nonce.get(),
|
|
9027
9152
|
startMediaFrom: 0 - startsAt,
|
|
9028
9153
|
doesVolumeChange,
|
|
9029
9154
|
loopDisplay,
|
|
@@ -9060,13 +9185,13 @@ var useMediaInTimeline = ({
|
|
|
9060
9185
|
]);
|
|
9061
9186
|
};
|
|
9062
9187
|
var useBufferManager = (logLevel, mountTime) => {
|
|
9063
|
-
const [blocks, setBlocks] =
|
|
9064
|
-
const [onBufferingCallbacks, setOnBufferingCallbacks] =
|
|
9065
|
-
const [onResumeCallbacks, setOnResumeCallbacks] =
|
|
9188
|
+
const [blocks, setBlocks] = useState11([]);
|
|
9189
|
+
const [onBufferingCallbacks, setOnBufferingCallbacks] = useState11([]);
|
|
9190
|
+
const [onResumeCallbacks, setOnResumeCallbacks] = useState11([]);
|
|
9066
9191
|
const env = useRemotionEnvironment();
|
|
9067
9192
|
const rendering = env.isRendering;
|
|
9068
9193
|
const buffering = useRef10(false);
|
|
9069
|
-
const addBlock =
|
|
9194
|
+
const addBlock = useCallback8((block) => {
|
|
9070
9195
|
if (rendering) {
|
|
9071
9196
|
return {
|
|
9072
9197
|
unblock: () => {
|
|
@@ -9087,7 +9212,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
9087
9212
|
}
|
|
9088
9213
|
};
|
|
9089
9214
|
}, [rendering]);
|
|
9090
|
-
const listenForBuffering =
|
|
9215
|
+
const listenForBuffering = useCallback8((callback) => {
|
|
9091
9216
|
setOnBufferingCallbacks((c) => [...c, callback]);
|
|
9092
9217
|
return {
|
|
9093
9218
|
remove: () => {
|
|
@@ -9095,7 +9220,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
9095
9220
|
}
|
|
9096
9221
|
};
|
|
9097
9222
|
}, []);
|
|
9098
|
-
const listenForResume =
|
|
9223
|
+
const listenForResume = useCallback8((callback) => {
|
|
9099
9224
|
setOnResumeCallbacks((c) => [...c, callback]);
|
|
9100
9225
|
return {
|
|
9101
9226
|
remove: () => {
|
|
@@ -9103,7 +9228,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
9103
9228
|
}
|
|
9104
9229
|
};
|
|
9105
9230
|
}, []);
|
|
9106
|
-
|
|
9231
|
+
useEffect5(() => {
|
|
9107
9232
|
if (rendering) {
|
|
9108
9233
|
return;
|
|
9109
9234
|
}
|
|
@@ -9133,7 +9258,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
9133
9258
|
}
|
|
9134
9259
|
}, [blocks]);
|
|
9135
9260
|
}
|
|
9136
|
-
return
|
|
9261
|
+
return useMemo18(() => {
|
|
9137
9262
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
9138
9263
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
9139
9264
|
};
|
|
@@ -9147,8 +9272,8 @@ var BufferingProvider = ({ children }) => {
|
|
|
9147
9272
|
});
|
|
9148
9273
|
};
|
|
9149
9274
|
var useIsPlayerBuffering = (bufferManager) => {
|
|
9150
|
-
const [isBuffering, setIsBuffering] =
|
|
9151
|
-
|
|
9275
|
+
const [isBuffering, setIsBuffering] = useState11(bufferManager.buffering.current);
|
|
9276
|
+
useEffect5(() => {
|
|
9152
9277
|
const onBuffer = () => {
|
|
9153
9278
|
setIsBuffering(true);
|
|
9154
9279
|
};
|
|
@@ -9171,7 +9296,7 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
9171
9296
|
var useBufferState = () => {
|
|
9172
9297
|
const buffer = useContext21(BufferingContextReact);
|
|
9173
9298
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
9174
|
-
return
|
|
9299
|
+
return useMemo19(() => ({
|
|
9175
9300
|
delayPlayback: () => {
|
|
9176
9301
|
if (!addBlock) {
|
|
9177
9302
|
throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
|
|
@@ -9197,7 +9322,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
9197
9322
|
}) => {
|
|
9198
9323
|
const bufferingRef = useRef11(false);
|
|
9199
9324
|
const { delayPlayback } = useBufferState();
|
|
9200
|
-
const bufferUntilFirstFrame =
|
|
9325
|
+
const bufferUntilFirstFrame = useCallback9((requestedTime) => {
|
|
9201
9326
|
if (mediaType !== "video") {
|
|
9202
9327
|
return;
|
|
9203
9328
|
}
|
|
@@ -9268,7 +9393,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
9268
9393
|
onVariableFpsVideoDetected,
|
|
9269
9394
|
pauseWhenBuffering
|
|
9270
9395
|
]);
|
|
9271
|
-
return
|
|
9396
|
+
return useMemo20(() => {
|
|
9272
9397
|
return {
|
|
9273
9398
|
isBuffering: () => bufferingRef.current,
|
|
9274
9399
|
bufferUntilFirstFrame
|
|
@@ -9316,8 +9441,8 @@ var useMediaBuffering = ({
|
|
|
9316
9441
|
src
|
|
9317
9442
|
}) => {
|
|
9318
9443
|
const buffer = useBufferState();
|
|
9319
|
-
const [isBuffering, setIsBuffering] =
|
|
9320
|
-
|
|
9444
|
+
const [isBuffering, setIsBuffering] = useState12(false);
|
|
9445
|
+
useEffect6(() => {
|
|
9321
9446
|
let cleanupFns = [];
|
|
9322
9447
|
const { current } = element;
|
|
9323
9448
|
if (!current) {
|
|
@@ -9450,7 +9575,7 @@ var useRequestVideoCallbackTime = ({
|
|
|
9450
9575
|
onVariableFpsVideoDetected
|
|
9451
9576
|
}) => {
|
|
9452
9577
|
const currentTime = useRef12(null);
|
|
9453
|
-
|
|
9578
|
+
useEffect7(() => {
|
|
9454
9579
|
const { current } = mediaRef;
|
|
9455
9580
|
if (current) {
|
|
9456
9581
|
currentTime.current = {
|
|
@@ -9670,7 +9795,7 @@ var useMediaPlayback = ({
|
|
|
9670
9795
|
isPostmounting,
|
|
9671
9796
|
onAutoPlayError
|
|
9672
9797
|
}) => {
|
|
9673
|
-
const { playbackRate: globalPlaybackRate } =
|
|
9798
|
+
const { playbackRate: globalPlaybackRate } = useTimelineContext();
|
|
9674
9799
|
const frame = useCurrentFrame();
|
|
9675
9800
|
const absoluteFrame = useTimelinePosition();
|
|
9676
9801
|
const [playing] = usePlayingState();
|
|
@@ -9685,7 +9810,7 @@ var useMediaPlayback = ({
|
|
|
9685
9810
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
9686
9811
|
}
|
|
9687
9812
|
const isVariableFpsVideoMap = useRef13({});
|
|
9688
|
-
const onVariableFpsVideoDetected =
|
|
9813
|
+
const onVariableFpsVideoDetected = useCallback10(() => {
|
|
9689
9814
|
if (!src) {
|
|
9690
9815
|
return;
|
|
9691
9816
|
}
|
|
@@ -9736,7 +9861,7 @@ var useMediaPlayback = ({
|
|
|
9736
9861
|
return acceptableTimeshift ?? defaultAcceptableTimeshift;
|
|
9737
9862
|
})();
|
|
9738
9863
|
const isPlayerBuffering = useIsPlayerBuffering(buffering);
|
|
9739
|
-
|
|
9864
|
+
useEffect8(() => {
|
|
9740
9865
|
if (mediaRef.current?.paused) {
|
|
9741
9866
|
return;
|
|
9742
9867
|
}
|
|
@@ -9781,7 +9906,7 @@ var useMediaPlayback = ({
|
|
|
9781
9906
|
mediaRef.current.playbackRate = playbackRateToSet;
|
|
9782
9907
|
}
|
|
9783
9908
|
}, [mediaRef, playbackRate]);
|
|
9784
|
-
|
|
9909
|
+
useEffect8(() => {
|
|
9785
9910
|
const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
|
|
9786
9911
|
if (!mediaRef.current) {
|
|
9787
9912
|
throw new Error(`No ${mediaType} ref found`);
|
|
@@ -9906,11 +10031,11 @@ var useMediaTag = ({
|
|
|
9906
10031
|
isPremounting,
|
|
9907
10032
|
isPostmounting
|
|
9908
10033
|
}) => {
|
|
9909
|
-
const { audioAndVideoTags, imperativePlaying } =
|
|
10034
|
+
const { audioAndVideoTags, imperativePlaying } = useTimelineContext();
|
|
9910
10035
|
const logLevel = useLogLevel();
|
|
9911
10036
|
const mountTime = useMountTime();
|
|
9912
10037
|
const env = useRemotionEnvironment();
|
|
9913
|
-
|
|
10038
|
+
useEffect9(() => {
|
|
9914
10039
|
const tag = {
|
|
9915
10040
|
id,
|
|
9916
10041
|
play: (reason) => {
|
|
@@ -9962,16 +10087,16 @@ var SetMediaVolumeContext = createContext18({
|
|
|
9962
10087
|
}
|
|
9963
10088
|
});
|
|
9964
10089
|
var useMediaVolumeState = () => {
|
|
9965
|
-
const { mediaVolume } =
|
|
9966
|
-
const { setMediaVolume } =
|
|
9967
|
-
return
|
|
10090
|
+
const { mediaVolume } = useContext23(MediaVolumeContext);
|
|
10091
|
+
const { setMediaVolume } = useContext23(SetMediaVolumeContext);
|
|
10092
|
+
return useMemo21(() => {
|
|
9968
10093
|
return [mediaVolume, setMediaVolume];
|
|
9969
10094
|
}, [mediaVolume, setMediaVolume]);
|
|
9970
10095
|
};
|
|
9971
10096
|
var useMediaMutedState = () => {
|
|
9972
|
-
const { mediaMuted } =
|
|
9973
|
-
const { setMediaMuted } =
|
|
9974
|
-
return
|
|
10097
|
+
const { mediaMuted } = useContext23(MediaVolumeContext);
|
|
10098
|
+
const { setMediaMuted } = useContext23(SetMediaVolumeContext);
|
|
10099
|
+
return useMemo21(() => {
|
|
9975
10100
|
return [mediaMuted, setMediaMuted];
|
|
9976
10101
|
}, [mediaMuted, setMediaMuted]);
|
|
9977
10102
|
};
|
|
@@ -9981,7 +10106,7 @@ var warnAboutTooHighVolume = (volume) => {
|
|
|
9981
10106
|
}
|
|
9982
10107
|
};
|
|
9983
10108
|
var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
9984
|
-
const [initialShouldPreMountAudioElements] =
|
|
10109
|
+
const [initialShouldPreMountAudioElements] = useState13(props.shouldPreMountAudioTags);
|
|
9985
10110
|
if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
|
|
9986
10111
|
throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
|
|
9987
10112
|
}
|
|
@@ -10020,13 +10145,13 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10020
10145
|
const [mediaVolume] = useMediaVolumeState();
|
|
10021
10146
|
const [mediaMuted] = useMediaMutedState();
|
|
10022
10147
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
10023
|
-
const { hidden } =
|
|
10148
|
+
const { hidden } = useContext24(SequenceVisibilityToggleContext);
|
|
10024
10149
|
if (!src) {
|
|
10025
10150
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
10026
10151
|
}
|
|
10027
10152
|
const preloadedSrc = usePreload(src);
|
|
10028
|
-
const sequenceContext =
|
|
10029
|
-
const [timelineId] =
|
|
10153
|
+
const sequenceContext = useContext24(SequenceContext);
|
|
10154
|
+
const [timelineId] = useState13(() => String(Math.random()));
|
|
10030
10155
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
10031
10156
|
const userPreferredVolume = evaluateVolume({
|
|
10032
10157
|
frame: volumePropFrame,
|
|
@@ -10039,7 +10164,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10039
10164
|
requestsVideoFrame: false,
|
|
10040
10165
|
isClientSideRendering: false
|
|
10041
10166
|
});
|
|
10042
|
-
const propsToPass =
|
|
10167
|
+
const propsToPass = useMemo222(() => {
|
|
10043
10168
|
return {
|
|
10044
10169
|
muted: muted || mediaMuted || isSequenceHidden || userPreferredVolume <= 0,
|
|
10045
10170
|
src: preloadedSrc,
|
|
@@ -10057,7 +10182,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10057
10182
|
userPreferredVolume,
|
|
10058
10183
|
crossOriginValue
|
|
10059
10184
|
]);
|
|
10060
|
-
const id =
|
|
10185
|
+
const id = useMemo222(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
|
|
10061
10186
|
src,
|
|
10062
10187
|
sequenceContext?.relativeFrom,
|
|
10063
10188
|
sequenceContext?.cumulatedFrom,
|
|
@@ -10129,7 +10254,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10129
10254
|
}, [audioRef]);
|
|
10130
10255
|
const currentOnDurationCallback = useRef14(onDuration);
|
|
10131
10256
|
currentOnDurationCallback.current = onDuration;
|
|
10132
|
-
|
|
10257
|
+
useEffect10(() => {
|
|
10133
10258
|
const { current } = audioRef;
|
|
10134
10259
|
if (!current) {
|
|
10135
10260
|
return;
|
|
@@ -10180,10 +10305,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10180
10305
|
const absoluteFrame = useTimelinePosition();
|
|
10181
10306
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
10182
10307
|
const frame = useCurrentFrame();
|
|
10183
|
-
const sequenceContext =
|
|
10184
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
10308
|
+
const sequenceContext = useContext25(SequenceContext);
|
|
10309
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext25(RenderAssetManager);
|
|
10185
10310
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
10186
|
-
const id =
|
|
10311
|
+
const id = useMemo23(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
10187
10312
|
props.src,
|
|
10188
10313
|
sequenceContext?.relativeFrom,
|
|
10189
10314
|
sequenceContext?.cumulatedFrom,
|
|
@@ -10198,7 +10323,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10198
10323
|
useImperativeHandle6(ref, () => {
|
|
10199
10324
|
return audioRef.current;
|
|
10200
10325
|
}, []);
|
|
10201
|
-
|
|
10326
|
+
useEffect11(() => {
|
|
10202
10327
|
if (!props.src) {
|
|
10203
10328
|
throw new Error("No src passed");
|
|
10204
10329
|
}
|
|
@@ -10290,7 +10415,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10290
10415
|
};
|
|
10291
10416
|
var AudioForRendering = forwardRef5(AudioForRenderingRefForwardingFunction);
|
|
10292
10417
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
10293
|
-
const audioContext =
|
|
10418
|
+
const audioContext = useContext26(SharedAudioContext);
|
|
10294
10419
|
const {
|
|
10295
10420
|
startFrom,
|
|
10296
10421
|
endAt,
|
|
@@ -10309,12 +10434,12 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10309
10434
|
if (environment.isClientSideRendering) {
|
|
10310
10435
|
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");
|
|
10311
10436
|
}
|
|
10312
|
-
const { durations, setDurations } =
|
|
10437
|
+
const { durations, setDurations } = useContext26(DurationsContext);
|
|
10313
10438
|
if (typeof props.src !== "string") {
|
|
10314
10439
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
10315
10440
|
}
|
|
10316
10441
|
const preloadedSrc = usePreload(props.src);
|
|
10317
|
-
const onError =
|
|
10442
|
+
const onError = useCallback11((e) => {
|
|
10318
10443
|
console.log(e.currentTarget.error);
|
|
10319
10444
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
10320
10445
|
if (loop) {
|
|
@@ -10328,7 +10453,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10328
10453
|
console.warn(errMessage);
|
|
10329
10454
|
}
|
|
10330
10455
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
10331
|
-
const onDuration =
|
|
10456
|
+
const onDuration = useCallback11((src, durationInSeconds) => {
|
|
10332
10457
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
10333
10458
|
}, [setDurations]);
|
|
10334
10459
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -10502,7 +10627,7 @@ var useLazyComponent = ({
|
|
|
10502
10627
|
if ("component" in compProps) {
|
|
10503
10628
|
componentRef.current = compProps.component;
|
|
10504
10629
|
}
|
|
10505
|
-
const lazy =
|
|
10630
|
+
const lazy = useMemo25(() => {
|
|
10506
10631
|
if ("component" in compProps) {
|
|
10507
10632
|
if (typeof document === "undefined" || noSuspense) {
|
|
10508
10633
|
return compProps.component;
|
|
@@ -10547,7 +10672,7 @@ var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
|
10547
10672
|
};
|
|
10548
10673
|
var Fallback = () => {
|
|
10549
10674
|
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
10550
|
-
|
|
10675
|
+
useEffect13(() => {
|
|
10551
10676
|
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
10552
10677
|
return () => continueRender2(fallback);
|
|
10553
10678
|
}, [continueRender2, delayRender2]);
|
|
@@ -10563,7 +10688,7 @@ var InnerComposition = ({
|
|
|
10563
10688
|
schema,
|
|
10564
10689
|
...compProps
|
|
10565
10690
|
}) => {
|
|
10566
|
-
const compManager =
|
|
10691
|
+
const compManager = useContext28(CompositionSetters);
|
|
10567
10692
|
const { registerComposition, unregisterComposition } = compManager;
|
|
10568
10693
|
const video = useVideo();
|
|
10569
10694
|
const lazy = useLazyComponent({
|
|
@@ -10574,7 +10699,7 @@ var InnerComposition = ({
|
|
|
10574
10699
|
const nonce = useNonce();
|
|
10575
10700
|
const isPlayer = useIsPlayer();
|
|
10576
10701
|
const environment = useRemotionEnvironment();
|
|
10577
|
-
const canUseComposition =
|
|
10702
|
+
const canUseComposition = useContext28(CanUseRemotionHooks);
|
|
10578
10703
|
if (typeof window !== "undefined") {
|
|
10579
10704
|
window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
|
|
10580
10705
|
}
|
|
@@ -10584,8 +10709,8 @@ var InnerComposition = ({
|
|
|
10584
10709
|
}
|
|
10585
10710
|
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
10586
10711
|
}
|
|
10587
|
-
const { folderName, parentName } =
|
|
10588
|
-
|
|
10712
|
+
const { folderName, parentName } = useContext28(FolderContext);
|
|
10713
|
+
useEffect13(() => {
|
|
10589
10714
|
if (!id) {
|
|
10590
10715
|
throw new Error("No id for composition passed.");
|
|
10591
10716
|
}
|
|
@@ -10600,7 +10725,7 @@ var InnerComposition = ({
|
|
|
10600
10725
|
folderName,
|
|
10601
10726
|
component: lazy,
|
|
10602
10727
|
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
10603
|
-
nonce,
|
|
10728
|
+
nonce: nonce.get(),
|
|
10604
10729
|
parentFolderName: parentName,
|
|
10605
10730
|
schema: schema ?? null,
|
|
10606
10731
|
calculateMetadata: compProps.calculateMetadata ?? null
|
|
@@ -10624,7 +10749,7 @@ var InnerComposition = ({
|
|
|
10624
10749
|
registerComposition,
|
|
10625
10750
|
unregisterComposition
|
|
10626
10751
|
]);
|
|
10627
|
-
|
|
10752
|
+
useEffect13(() => {
|
|
10628
10753
|
window.dispatchEvent(new CustomEvent(PROPS_UPDATED_EXTERNALLY, {
|
|
10629
10754
|
detail: {
|
|
10630
10755
|
resetUnsaved: id
|
|
@@ -10663,7 +10788,7 @@ var InnerComposition = ({
|
|
|
10663
10788
|
return null;
|
|
10664
10789
|
};
|
|
10665
10790
|
var Composition = (props2) => {
|
|
10666
|
-
const { onlyRenderComposition } =
|
|
10791
|
+
const { onlyRenderComposition } = useContext28(CompositionSetters);
|
|
10667
10792
|
if (onlyRenderComposition && onlyRenderComposition !== props2.id) {
|
|
10668
10793
|
return null;
|
|
10669
10794
|
}
|
|
@@ -10681,15 +10806,15 @@ var IFrameRefForwarding = ({
|
|
|
10681
10806
|
...props2
|
|
10682
10807
|
}, ref) => {
|
|
10683
10808
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
10684
|
-
const [handle] =
|
|
10809
|
+
const [handle] = useState14(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
|
|
10685
10810
|
retries: delayRenderRetries ?? undefined,
|
|
10686
10811
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
10687
10812
|
}));
|
|
10688
|
-
const didLoad =
|
|
10813
|
+
const didLoad = useCallback12((e) => {
|
|
10689
10814
|
continueRender2(handle);
|
|
10690
10815
|
onLoad?.(e);
|
|
10691
10816
|
}, [handle, onLoad, continueRender2]);
|
|
10692
|
-
const didGetError =
|
|
10817
|
+
const didGetError = useCallback12((e) => {
|
|
10693
10818
|
continueRender2(handle);
|
|
10694
10819
|
if (onError) {
|
|
10695
10820
|
onError(e);
|
|
@@ -10723,7 +10848,7 @@ var ImgRefForwarding = ({
|
|
|
10723
10848
|
const imageRef = useRef17(null);
|
|
10724
10849
|
const errors = useRef17({});
|
|
10725
10850
|
const { delayPlayback } = useBufferState();
|
|
10726
|
-
const sequenceContext =
|
|
10851
|
+
const sequenceContext = useContext29(SequenceContext);
|
|
10727
10852
|
if (!src) {
|
|
10728
10853
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
10729
10854
|
}
|
|
@@ -10735,7 +10860,7 @@ var ImgRefForwarding = ({
|
|
|
10735
10860
|
return imageRef.current;
|
|
10736
10861
|
}, []);
|
|
10737
10862
|
const actualSrc = usePreload(src);
|
|
10738
|
-
const retryIn =
|
|
10863
|
+
const retryIn = useCallback13((timeout) => {
|
|
10739
10864
|
if (!imageRef.current) {
|
|
10740
10865
|
return;
|
|
10741
10866
|
}
|
|
@@ -10752,7 +10877,8 @@ var ImgRefForwarding = ({
|
|
|
10752
10877
|
imageRef.current.setAttribute("src", newSrc);
|
|
10753
10878
|
}, timeout);
|
|
10754
10879
|
}, []);
|
|
10755
|
-
const
|
|
10880
|
+
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
10881
|
+
const didGetError = useCallback13((e) => {
|
|
10756
10882
|
if (!errors.current) {
|
|
10757
10883
|
return;
|
|
10758
10884
|
}
|
|
@@ -10767,9 +10893,10 @@ var ImgRefForwarding = ({
|
|
|
10767
10893
|
retryIn(backoff);
|
|
10768
10894
|
return;
|
|
10769
10895
|
}
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10896
|
+
try {
|
|
10897
|
+
cancelRender2("Error loading image with src: " + imageRef.current?.src);
|
|
10898
|
+
} catch {}
|
|
10899
|
+
}, [cancelRender2, maxRetries, onError, retryIn]);
|
|
10773
10900
|
if (typeof window !== "undefined") {
|
|
10774
10901
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
10775
10902
|
const isPostmounting = Boolean(sequenceContext?.postmounting);
|
|
@@ -10814,7 +10941,7 @@ var ImgRefForwarding = ({
|
|
|
10814
10941
|
current.src = actualSrc;
|
|
10815
10942
|
current.decode().then(onComplete).catch((err) => {
|
|
10816
10943
|
console.warn(err);
|
|
10817
|
-
if (current.complete) {
|
|
10944
|
+
if (current.complete && current.naturalWidth > 0 && current.naturalHeight > 0) {
|
|
10818
10945
|
onComplete();
|
|
10819
10946
|
} else {
|
|
10820
10947
|
current.addEventListener("load", onComplete);
|
|
@@ -10862,43 +10989,43 @@ var CompositionManagerProvider = ({
|
|
|
10862
10989
|
initialCompositions,
|
|
10863
10990
|
initialCanvasContent
|
|
10864
10991
|
}) => {
|
|
10865
|
-
const [folders, setFolders] =
|
|
10866
|
-
const [canvasContent, setCanvasContent] =
|
|
10867
|
-
const [compositions, setCompositions] =
|
|
10992
|
+
const [folders, setFolders] = useState15([]);
|
|
10993
|
+
const [canvasContent, setCanvasContent] = useState15(initialCanvasContent);
|
|
10994
|
+
const [compositions, setCompositions] = useState15(initialCompositions);
|
|
10868
10995
|
const currentcompositionsRef = useRef18(compositions);
|
|
10869
|
-
const updateCompositions =
|
|
10996
|
+
const updateCompositions = useCallback14((updateComps) => {
|
|
10870
10997
|
setCompositions((comps) => {
|
|
10871
10998
|
const updated = updateComps(comps);
|
|
10872
10999
|
currentcompositionsRef.current = updated;
|
|
10873
11000
|
return updated;
|
|
10874
11001
|
});
|
|
10875
11002
|
}, []);
|
|
10876
|
-
const registerComposition =
|
|
11003
|
+
const registerComposition = useCallback14((comp) => {
|
|
10877
11004
|
updateCompositions((comps) => {
|
|
10878
11005
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
10879
11006
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
10880
11007
|
}
|
|
10881
|
-
|
|
10882
|
-
return value;
|
|
11008
|
+
return [...comps, comp];
|
|
10883
11009
|
});
|
|
10884
11010
|
}, [updateCompositions]);
|
|
10885
|
-
const unregisterComposition =
|
|
11011
|
+
const unregisterComposition = useCallback14((id) => {
|
|
10886
11012
|
setCompositions((comps) => {
|
|
10887
11013
|
return comps.filter((c2) => c2.id !== id);
|
|
10888
11014
|
});
|
|
10889
11015
|
}, []);
|
|
10890
|
-
const registerFolder =
|
|
11016
|
+
const registerFolder = useCallback14((name, parent, nonce) => {
|
|
10891
11017
|
setFolders((prevFolders) => {
|
|
10892
11018
|
return [
|
|
10893
11019
|
...prevFolders,
|
|
10894
11020
|
{
|
|
10895
11021
|
name,
|
|
10896
|
-
parent
|
|
11022
|
+
parent,
|
|
11023
|
+
nonce
|
|
10897
11024
|
}
|
|
10898
11025
|
];
|
|
10899
11026
|
});
|
|
10900
11027
|
}, []);
|
|
10901
|
-
const unregisterFolder =
|
|
11028
|
+
const unregisterFolder = useCallback14((name, parent) => {
|
|
10902
11029
|
setFolders((prevFolders) => {
|
|
10903
11030
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
10904
11031
|
});
|
|
@@ -10908,7 +11035,7 @@ var CompositionManagerProvider = ({
|
|
|
10908
11035
|
getCompositions: () => currentcompositionsRef.current
|
|
10909
11036
|
};
|
|
10910
11037
|
}, []);
|
|
10911
|
-
const updateCompositionDefaultProps =
|
|
11038
|
+
const updateCompositionDefaultProps = useCallback14((id, newDefaultProps) => {
|
|
10912
11039
|
setCompositions((comps) => {
|
|
10913
11040
|
const updated = comps.map((c2) => {
|
|
10914
11041
|
if (c2.id === id) {
|
|
@@ -10922,7 +11049,7 @@ var CompositionManagerProvider = ({
|
|
|
10922
11049
|
return updated;
|
|
10923
11050
|
});
|
|
10924
11051
|
}, []);
|
|
10925
|
-
const compositionManagerSetters =
|
|
11052
|
+
const compositionManagerSetters = useMemo26(() => {
|
|
10926
11053
|
return {
|
|
10927
11054
|
registerComposition,
|
|
10928
11055
|
unregisterComposition,
|
|
@@ -10940,7 +11067,7 @@ var CompositionManagerProvider = ({
|
|
|
10940
11067
|
updateCompositionDefaultProps,
|
|
10941
11068
|
onlyRenderComposition
|
|
10942
11069
|
]);
|
|
10943
|
-
const compositionManagerContextValue =
|
|
11070
|
+
const compositionManagerContextValue = useMemo26(() => {
|
|
10944
11071
|
return {
|
|
10945
11072
|
compositions,
|
|
10946
11073
|
folders,
|
|
@@ -11014,6 +11141,27 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
11014
11141
|
}
|
|
11015
11142
|
`;
|
|
11016
11143
|
};
|
|
11144
|
+
var getEffectiveVisualModeValue = ({
|
|
11145
|
+
codeValue,
|
|
11146
|
+
runtimeValue,
|
|
11147
|
+
dragOverrideValue,
|
|
11148
|
+
defaultValue,
|
|
11149
|
+
shouldResortToDefaultValueIfUndefined = false
|
|
11150
|
+
}) => {
|
|
11151
|
+
if (dragOverrideValue !== undefined) {
|
|
11152
|
+
return dragOverrideValue;
|
|
11153
|
+
}
|
|
11154
|
+
if (!codeValue) {
|
|
11155
|
+
return runtimeValue;
|
|
11156
|
+
}
|
|
11157
|
+
if (!codeValue.canUpdate) {
|
|
11158
|
+
return runtimeValue;
|
|
11159
|
+
}
|
|
11160
|
+
if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
|
|
11161
|
+
return defaultValue;
|
|
11162
|
+
}
|
|
11163
|
+
return codeValue.codeValue;
|
|
11164
|
+
};
|
|
11017
11165
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
11018
11166
|
var getPreviewDomElement = () => {
|
|
11019
11167
|
return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
|
|
@@ -11038,7 +11186,7 @@ var waitForRoot = (fn) => {
|
|
|
11038
11186
|
};
|
|
11039
11187
|
var MediaEnabledContext = createContext20(null);
|
|
11040
11188
|
var useVideoEnabled = () => {
|
|
11041
|
-
const context =
|
|
11189
|
+
const context = useContext30(MediaEnabledContext);
|
|
11042
11190
|
if (!context) {
|
|
11043
11191
|
return window.remotion_videoEnabled;
|
|
11044
11192
|
}
|
|
@@ -11048,7 +11196,7 @@ var useVideoEnabled = () => {
|
|
|
11048
11196
|
return context.videoEnabled;
|
|
11049
11197
|
};
|
|
11050
11198
|
var useAudioEnabled = () => {
|
|
11051
|
-
const context =
|
|
11199
|
+
const context = useContext30(MediaEnabledContext);
|
|
11052
11200
|
if (!context) {
|
|
11053
11201
|
return window.remotion_audioEnabled;
|
|
11054
11202
|
}
|
|
@@ -11062,7 +11210,7 @@ var MediaEnabledProvider = ({
|
|
|
11062
11210
|
videoEnabled,
|
|
11063
11211
|
audioEnabled
|
|
11064
11212
|
}) => {
|
|
11065
|
-
const value =
|
|
11213
|
+
const value = useMemo27(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
11066
11214
|
return /* @__PURE__ */ jsx26(MediaEnabledContext.Provider, {
|
|
11067
11215
|
value,
|
|
11068
11216
|
children
|
|
@@ -11076,15 +11224,15 @@ var RemotionRootContexts = ({
|
|
|
11076
11224
|
videoEnabled,
|
|
11077
11225
|
audioEnabled,
|
|
11078
11226
|
frameState,
|
|
11079
|
-
|
|
11227
|
+
visualModeEnabled
|
|
11080
11228
|
}) => {
|
|
11081
|
-
const nonceContext =
|
|
11229
|
+
const nonceContext = useMemo28(() => {
|
|
11082
11230
|
let counter = 0;
|
|
11083
11231
|
return {
|
|
11084
11232
|
getNonce: () => counter++
|
|
11085
11233
|
};
|
|
11086
|
-
}, [
|
|
11087
|
-
const logging =
|
|
11234
|
+
}, []);
|
|
11235
|
+
const logging = useMemo28(() => {
|
|
11088
11236
|
return { logLevel, mountTime: Date.now() };
|
|
11089
11237
|
}, [logLevel]);
|
|
11090
11238
|
return /* @__PURE__ */ jsx27(LogLevelContext.Provider, {
|
|
@@ -11099,6 +11247,7 @@ var RemotionRootContexts = ({
|
|
|
11099
11247
|
children: /* @__PURE__ */ jsx27(EditorPropsProvider, {
|
|
11100
11248
|
children: /* @__PURE__ */ jsx27(PrefetchProvider, {
|
|
11101
11249
|
children: /* @__PURE__ */ jsx27(SequenceManagerProvider, {
|
|
11250
|
+
visualModeEnabled,
|
|
11102
11251
|
children: /* @__PURE__ */ jsx27(SharedAudioContextProvider, {
|
|
11103
11252
|
numberOfAudioTags,
|
|
11104
11253
|
audioLatencyHint,
|
|
@@ -11281,6 +11430,7 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
11281
11430
|
};
|
|
11282
11431
|
}
|
|
11283
11432
|
};
|
|
11433
|
+
var SequenceStackTracesUpdateContext = React27.createContext(() => {});
|
|
11284
11434
|
var getEnvVariables = () => {
|
|
11285
11435
|
if (getRemotionEnvironment().isRendering) {
|
|
11286
11436
|
const param = window.remotion_envVariables;
|
|
@@ -11306,7 +11456,7 @@ var setupEnvVariables = () => {
|
|
|
11306
11456
|
window.process.env[key] = env[key];
|
|
11307
11457
|
});
|
|
11308
11458
|
};
|
|
11309
|
-
var CurrentScaleContext =
|
|
11459
|
+
var CurrentScaleContext = React28.createContext(null);
|
|
11310
11460
|
var PreviewSizeContext = createContext21({
|
|
11311
11461
|
setSize: () => {
|
|
11312
11462
|
return;
|
|
@@ -11332,7 +11482,7 @@ var calculateScale = ({
|
|
|
11332
11482
|
};
|
|
11333
11483
|
var useSchema = (schema, currentValue) => {
|
|
11334
11484
|
const env = useRemotionEnvironment();
|
|
11335
|
-
const earlyReturn =
|
|
11485
|
+
const earlyReturn = useMemo29(() => {
|
|
11336
11486
|
if (!env.isStudio || env.isReadOnlyStudio) {
|
|
11337
11487
|
return {
|
|
11338
11488
|
controls: undefined,
|
|
@@ -11344,35 +11494,64 @@ var useSchema = (schema, currentValue) => {
|
|
|
11344
11494
|
if (earlyReturn) {
|
|
11345
11495
|
return earlyReturn;
|
|
11346
11496
|
}
|
|
11347
|
-
const [overrideId] =
|
|
11348
|
-
const {
|
|
11349
|
-
|
|
11497
|
+
const [overrideId] = useState16(() => String(Math.random()));
|
|
11498
|
+
const {
|
|
11499
|
+
visualModeEnabled,
|
|
11500
|
+
dragOverrides: overrides,
|
|
11501
|
+
codeValues
|
|
11502
|
+
} = useContext31(VisualModeOverridesContext);
|
|
11503
|
+
const controls = useMemo29(() => {
|
|
11504
|
+
if (!visualModeEnabled) {
|
|
11505
|
+
return;
|
|
11506
|
+
}
|
|
11350
11507
|
if (schema === null || currentValue === null) {
|
|
11508
|
+
return;
|
|
11509
|
+
}
|
|
11510
|
+
return {
|
|
11511
|
+
schema,
|
|
11512
|
+
currentValue,
|
|
11513
|
+
overrideId
|
|
11514
|
+
};
|
|
11515
|
+
}, [schema, currentValue, overrideId, visualModeEnabled]);
|
|
11516
|
+
return useMemo29(() => {
|
|
11517
|
+
if (controls === undefined || currentValue === null || schema === null || !visualModeEnabled) {
|
|
11351
11518
|
return {
|
|
11352
11519
|
controls: undefined,
|
|
11353
11520
|
values: currentValue ?? {}
|
|
11354
11521
|
};
|
|
11355
11522
|
}
|
|
11356
11523
|
const overrideValues = overrides[overrideId] ?? {};
|
|
11357
|
-
const
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11524
|
+
const propStatus = codeValues[overrideId];
|
|
11525
|
+
const currentValueKeys = Object.keys(currentValue);
|
|
11526
|
+
const keysToUpdate = new Set(currentValueKeys).values();
|
|
11527
|
+
const merged = {};
|
|
11528
|
+
for (const key of keysToUpdate) {
|
|
11529
|
+
const codeValueStatus = propStatus?.[key] ?? null;
|
|
11530
|
+
merged[key] = getEffectiveVisualModeValue({
|
|
11531
|
+
codeValue: codeValueStatus,
|
|
11532
|
+
runtimeValue: currentValue[key],
|
|
11533
|
+
dragOverrideValue: overrideValues[key],
|
|
11534
|
+
defaultValue: schema[key]?.default,
|
|
11535
|
+
shouldResortToDefaultValueIfUndefined: false
|
|
11536
|
+
});
|
|
11362
11537
|
}
|
|
11363
11538
|
return {
|
|
11364
|
-
controls
|
|
11365
|
-
schema,
|
|
11366
|
-
currentValue,
|
|
11367
|
-
overrideId
|
|
11368
|
-
},
|
|
11539
|
+
controls,
|
|
11369
11540
|
values: merged
|
|
11370
11541
|
};
|
|
11371
|
-
}, [
|
|
11542
|
+
}, [
|
|
11543
|
+
controls,
|
|
11544
|
+
currentValue,
|
|
11545
|
+
overrideId,
|
|
11546
|
+
overrides,
|
|
11547
|
+
codeValues,
|
|
11548
|
+
schema,
|
|
11549
|
+
visualModeEnabled
|
|
11550
|
+
]);
|
|
11372
11551
|
};
|
|
11373
11552
|
var useSequenceControlOverride = (key) => {
|
|
11374
|
-
const seqContext =
|
|
11375
|
-
const { overrides } =
|
|
11553
|
+
const seqContext = useContext32(SequenceContext);
|
|
11554
|
+
const { dragOverrides: overrides } = useContext32(VisualModeOverridesContext);
|
|
11376
11555
|
if (!seqContext) {
|
|
11377
11556
|
return;
|
|
11378
11557
|
}
|
|
@@ -11409,13 +11588,13 @@ var OffthreadVideoForRendering = ({
|
|
|
11409
11588
|
const frame = useCurrentFrame();
|
|
11410
11589
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
|
|
11411
11590
|
const videoConfig = useUnsafeVideoConfig();
|
|
11412
|
-
const sequenceContext =
|
|
11591
|
+
const sequenceContext = useContext33(SequenceContext);
|
|
11413
11592
|
const mediaStartsAt = useMediaStartsAt();
|
|
11414
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
11593
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext33(RenderAssetManager);
|
|
11415
11594
|
if (!src) {
|
|
11416
11595
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
11417
11596
|
}
|
|
11418
|
-
const id =
|
|
11597
|
+
const id = useMemo30(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
11419
11598
|
src,
|
|
11420
11599
|
sequenceContext?.cumulatedFrom,
|
|
11421
11600
|
sequenceContext?.relativeFrom,
|
|
@@ -11430,7 +11609,7 @@ var OffthreadVideoForRendering = ({
|
|
|
11430
11609
|
mediaVolume: 1
|
|
11431
11610
|
});
|
|
11432
11611
|
warnAboutTooHighVolume(volume);
|
|
11433
|
-
|
|
11612
|
+
useEffect14(() => {
|
|
11434
11613
|
if (!src) {
|
|
11435
11614
|
throw new Error("No src passed");
|
|
11436
11615
|
}
|
|
@@ -11470,14 +11649,14 @@ var OffthreadVideoForRendering = ({
|
|
|
11470
11649
|
sequenceContext?.relativeFrom,
|
|
11471
11650
|
audioStreamIndex
|
|
11472
11651
|
]);
|
|
11473
|
-
const currentTime =
|
|
11652
|
+
const currentTime = useMemo30(() => {
|
|
11474
11653
|
return getExpectedMediaFrameUncorrected({
|
|
11475
11654
|
frame,
|
|
11476
11655
|
playbackRate: playbackRate || 1,
|
|
11477
11656
|
startFrom: -mediaStartsAt
|
|
11478
11657
|
}) / videoConfig.fps;
|
|
11479
11658
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
11480
|
-
const actualSrc =
|
|
11659
|
+
const actualSrc = useMemo30(() => {
|
|
11481
11660
|
return getOffthreadVideoSource({
|
|
11482
11661
|
src,
|
|
11483
11662
|
currentTime,
|
|
@@ -11485,7 +11664,7 @@ var OffthreadVideoForRendering = ({
|
|
|
11485
11664
|
toneMapped
|
|
11486
11665
|
});
|
|
11487
11666
|
}, [toneMapped, currentTime, src, transparent]);
|
|
11488
|
-
const [imageSrc, setImageSrc] =
|
|
11667
|
+
const [imageSrc, setImageSrc] = useState17(null);
|
|
11489
11668
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
11490
11669
|
useLayoutEffect10(() => {
|
|
11491
11670
|
if (!window.remotion_videoEnabled) {
|
|
@@ -11558,17 +11737,17 @@ var OffthreadVideoForRendering = ({
|
|
|
11558
11737
|
continueRender2,
|
|
11559
11738
|
delayRender2
|
|
11560
11739
|
]);
|
|
11561
|
-
const onErr =
|
|
11740
|
+
const onErr = useCallback15(() => {
|
|
11562
11741
|
if (onError) {
|
|
11563
11742
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
11564
11743
|
} else {
|
|
11565
11744
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
11566
11745
|
}
|
|
11567
11746
|
}, [imageSrc, onError]);
|
|
11568
|
-
const className =
|
|
11747
|
+
const className = useMemo30(() => {
|
|
11569
11748
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy2).join(" ");
|
|
11570
11749
|
}, [props2.className]);
|
|
11571
|
-
const onImageFrame =
|
|
11750
|
+
const onImageFrame = useCallback15((img) => {
|
|
11572
11751
|
if (onVideoFrame) {
|
|
11573
11752
|
onVideoFrame(img);
|
|
11574
11753
|
}
|
|
@@ -11591,7 +11770,7 @@ var useEmitVideoFrame = ({
|
|
|
11591
11770
|
ref,
|
|
11592
11771
|
onVideoFrame
|
|
11593
11772
|
}) => {
|
|
11594
|
-
|
|
11773
|
+
useEffect15(() => {
|
|
11595
11774
|
const { current } = ref;
|
|
11596
11775
|
if (!current) {
|
|
11597
11776
|
return;
|
|
@@ -11614,12 +11793,12 @@ var useEmitVideoFrame = ({
|
|
|
11614
11793
|
}, [onVideoFrame, ref]);
|
|
11615
11794
|
};
|
|
11616
11795
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
11617
|
-
const context =
|
|
11796
|
+
const context = useContext34(SharedAudioContext);
|
|
11618
11797
|
if (!context) {
|
|
11619
11798
|
throw new Error("SharedAudioContext not found");
|
|
11620
11799
|
}
|
|
11621
11800
|
const videoRef = useRef19(null);
|
|
11622
|
-
const sharedSource =
|
|
11801
|
+
const sharedSource = useMemo31(() => {
|
|
11623
11802
|
if (!context.audioContext) {
|
|
11624
11803
|
return null;
|
|
11625
11804
|
}
|
|
@@ -11628,7 +11807,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11628
11807
|
ref: videoRef
|
|
11629
11808
|
});
|
|
11630
11809
|
}, [context.audioContext]);
|
|
11631
|
-
const effectToUse =
|
|
11810
|
+
const effectToUse = React30.useInsertionEffect ?? React30.useLayoutEffect;
|
|
11632
11811
|
effectToUse(() => {
|
|
11633
11812
|
return () => {
|
|
11634
11813
|
requestAnimationFrame(() => {
|
|
@@ -11670,11 +11849,11 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11670
11849
|
}
|
|
11671
11850
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
11672
11851
|
const { fps, durationInFrames } = useVideoConfig();
|
|
11673
|
-
const parentSequence =
|
|
11674
|
-
const { hidden } =
|
|
11852
|
+
const parentSequence = useContext34(SequenceContext);
|
|
11853
|
+
const { hidden } = useContext34(SequenceVisibilityToggleContext);
|
|
11675
11854
|
const logLevel = useLogLevel();
|
|
11676
11855
|
const mountTime = useMountTime();
|
|
11677
|
-
const [timelineId] =
|
|
11856
|
+
const [timelineId] = useState18(() => String(Math.random()));
|
|
11678
11857
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
11679
11858
|
if (typeof acceptableTimeShift !== "undefined") {
|
|
11680
11859
|
throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
|
|
@@ -11740,13 +11919,13 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11740
11919
|
useImperativeHandle9(ref, () => {
|
|
11741
11920
|
return videoRef.current;
|
|
11742
11921
|
}, []);
|
|
11743
|
-
|
|
11922
|
+
useState18(() => playbackLogging({
|
|
11744
11923
|
logLevel,
|
|
11745
11924
|
message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
|
|
11746
11925
|
tag: "video",
|
|
11747
11926
|
mountTime
|
|
11748
11927
|
}));
|
|
11749
|
-
|
|
11928
|
+
useEffect16(() => {
|
|
11750
11929
|
const { current } = videoRef;
|
|
11751
11930
|
if (!current) {
|
|
11752
11931
|
return;
|
|
@@ -11777,7 +11956,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11777
11956
|
const currentOnDurationCallback = useRef19(onDuration);
|
|
11778
11957
|
currentOnDurationCallback.current = onDuration;
|
|
11779
11958
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
11780
|
-
|
|
11959
|
+
useEffect16(() => {
|
|
11781
11960
|
const { current } = videoRef;
|
|
11782
11961
|
if (!current) {
|
|
11783
11962
|
return;
|
|
@@ -11794,7 +11973,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11794
11973
|
current.removeEventListener("loadedmetadata", onLoadedMetadata);
|
|
11795
11974
|
};
|
|
11796
11975
|
}, [src]);
|
|
11797
|
-
|
|
11976
|
+
useEffect16(() => {
|
|
11798
11977
|
const { current } = videoRef;
|
|
11799
11978
|
if (!current) {
|
|
11800
11979
|
return;
|
|
@@ -11805,7 +11984,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11805
11984
|
current.preload = "auto";
|
|
11806
11985
|
}
|
|
11807
11986
|
}, []);
|
|
11808
|
-
const actualStyle =
|
|
11987
|
+
const actualStyle = useMemo31(() => {
|
|
11809
11988
|
return {
|
|
11810
11989
|
...style,
|
|
11811
11990
|
opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
|
|
@@ -11845,7 +12024,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
11845
12024
|
if (environment.isClientSideRendering) {
|
|
11846
12025
|
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");
|
|
11847
12026
|
}
|
|
11848
|
-
const onDuration =
|
|
12027
|
+
const onDuration = useCallback16(() => {
|
|
11849
12028
|
return;
|
|
11850
12029
|
}, []);
|
|
11851
12030
|
if (typeof props2.src !== "string") {
|
|
@@ -11986,20 +12165,82 @@ var OffthreadVideo = ({
|
|
|
11986
12165
|
};
|
|
11987
12166
|
addSequenceStackTraces(OffthreadVideo);
|
|
11988
12167
|
var WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged";
|
|
12168
|
+
var getNestedValue = (obj, key) => {
|
|
12169
|
+
const parts = key.split(".");
|
|
12170
|
+
let current = obj;
|
|
12171
|
+
for (const part of parts) {
|
|
12172
|
+
if (current === null || current === undefined || typeof current !== "object")
|
|
12173
|
+
return;
|
|
12174
|
+
current = current[part];
|
|
12175
|
+
}
|
|
12176
|
+
return current;
|
|
12177
|
+
};
|
|
12178
|
+
var mergeValues = (props2, values, schemaKeys) => {
|
|
12179
|
+
const merged = { ...props2 };
|
|
12180
|
+
for (const key of schemaKeys) {
|
|
12181
|
+
const value = values[key];
|
|
12182
|
+
const parts = key.split(".");
|
|
12183
|
+
if (parts.length === 1) {
|
|
12184
|
+
merged[key] = value;
|
|
12185
|
+
continue;
|
|
12186
|
+
}
|
|
12187
|
+
let current = merged;
|
|
12188
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
12189
|
+
const part = parts[i];
|
|
12190
|
+
if (typeof current[part] === "object" && current[part] !== null) {
|
|
12191
|
+
current[part] = { ...current[part] };
|
|
12192
|
+
} else {
|
|
12193
|
+
current[part] = {};
|
|
12194
|
+
}
|
|
12195
|
+
current = current[part];
|
|
12196
|
+
}
|
|
12197
|
+
current[parts[parts.length - 1]] = value;
|
|
12198
|
+
}
|
|
12199
|
+
return merged;
|
|
12200
|
+
};
|
|
12201
|
+
var wrapInSchema = (Component, schema) => {
|
|
12202
|
+
const schemaKeys = Object.keys(schema);
|
|
12203
|
+
const Wrapped = forwardRef10((props2, ref) => {
|
|
12204
|
+
const env = useRemotionEnvironment();
|
|
12205
|
+
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
12206
|
+
return React32.createElement(Component, {
|
|
12207
|
+
...props2,
|
|
12208
|
+
controls: null,
|
|
12209
|
+
ref
|
|
12210
|
+
});
|
|
12211
|
+
}
|
|
12212
|
+
const schemaInput = useMemo32(() => {
|
|
12213
|
+
const input = {};
|
|
12214
|
+
for (const key of schemaKeys) {
|
|
12215
|
+
input[key] = getNestedValue(props2, key);
|
|
12216
|
+
}
|
|
12217
|
+
return input;
|
|
12218
|
+
}, schemaKeys.map((key) => getNestedValue(props2, key)));
|
|
12219
|
+
const { controls, values } = useSchema(schema, schemaInput);
|
|
12220
|
+
const mergedProps = mergeValues(props2, values, schemaKeys);
|
|
12221
|
+
return React32.createElement(Component, {
|
|
12222
|
+
...mergedProps,
|
|
12223
|
+
controls,
|
|
12224
|
+
ref
|
|
12225
|
+
});
|
|
12226
|
+
});
|
|
12227
|
+
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
12228
|
+
return Wrapped;
|
|
12229
|
+
};
|
|
11989
12230
|
function useRemotionContexts() {
|
|
11990
|
-
const compositionManagerCtx =
|
|
11991
|
-
const timelineContext =
|
|
11992
|
-
const setTimelineContext =
|
|
11993
|
-
const sequenceContext =
|
|
11994
|
-
const nonceContext =
|
|
11995
|
-
const canUseRemotionHooksContext =
|
|
11996
|
-
const preloadContext =
|
|
11997
|
-
const resolveCompositionContext =
|
|
11998
|
-
const renderAssetManagerContext =
|
|
11999
|
-
const sequenceManagerContext =
|
|
12000
|
-
const bufferManagerContext =
|
|
12001
|
-
const logLevelContext =
|
|
12002
|
-
return
|
|
12231
|
+
const compositionManagerCtx = React33.useContext(CompositionManager);
|
|
12232
|
+
const timelineContext = React33.useContext(TimelineContext);
|
|
12233
|
+
const setTimelineContext = React33.useContext(SetTimelineContext);
|
|
12234
|
+
const sequenceContext = React33.useContext(SequenceContext);
|
|
12235
|
+
const nonceContext = React33.useContext(NonceContext);
|
|
12236
|
+
const canUseRemotionHooksContext = React33.useContext(CanUseRemotionHooks);
|
|
12237
|
+
const preloadContext = React33.useContext(PreloadContext);
|
|
12238
|
+
const resolveCompositionContext = React33.useContext(ResolveCompositionContext);
|
|
12239
|
+
const renderAssetManagerContext = React33.useContext(RenderAssetManager);
|
|
12240
|
+
const sequenceManagerContext = React33.useContext(SequenceManager);
|
|
12241
|
+
const bufferManagerContext = React33.useContext(BufferingContextReact);
|
|
12242
|
+
const logLevelContext = React33.useContext(LogLevelContext);
|
|
12243
|
+
return useMemo33(() => ({
|
|
12003
12244
|
compositionManagerCtx,
|
|
12004
12245
|
timelineContext,
|
|
12005
12246
|
setTimelineContext,
|
|
@@ -12073,6 +12314,7 @@ var Internals = {
|
|
|
12073
12314
|
useUnsafeVideoConfig,
|
|
12074
12315
|
useFrameForVolumeProp,
|
|
12075
12316
|
useTimelinePosition,
|
|
12317
|
+
useAbsoluteTimelinePosition,
|
|
12076
12318
|
evaluateVolume,
|
|
12077
12319
|
getAbsoluteSrc,
|
|
12078
12320
|
Timeline: exports_timeline_position_state,
|
|
@@ -12082,10 +12324,12 @@ var Internals = {
|
|
|
12082
12324
|
VideoForPreview,
|
|
12083
12325
|
CompositionManager,
|
|
12084
12326
|
CompositionSetters,
|
|
12085
|
-
|
|
12327
|
+
VisualModeOverridesContext,
|
|
12086
12328
|
SequenceManager,
|
|
12329
|
+
SequenceStackTracesUpdateContext,
|
|
12087
12330
|
SequenceVisibilityToggleContext,
|
|
12088
12331
|
useSchema,
|
|
12332
|
+
wrapInSchema,
|
|
12089
12333
|
useSequenceControlOverride,
|
|
12090
12334
|
RemotionRootContexts,
|
|
12091
12335
|
CompositionManagerProvider,
|
|
@@ -12133,6 +12377,7 @@ var Internals = {
|
|
|
12133
12377
|
REMOTION_STUDIO_CONTAINER_ELEMENT,
|
|
12134
12378
|
RenderAssetManager,
|
|
12135
12379
|
persistCurrentFrame,
|
|
12380
|
+
useTimelineContext,
|
|
12136
12381
|
useTimelineSetFrame,
|
|
12137
12382
|
isIosSafari,
|
|
12138
12383
|
WATCH_REMOTION_STATIC_FILES,
|
|
@@ -12167,7 +12412,9 @@ var Internals = {
|
|
|
12167
12412
|
TimelinePosition: exports_timeline_position_state,
|
|
12168
12413
|
DelayRenderContextType,
|
|
12169
12414
|
TimelineContext,
|
|
12170
|
-
|
|
12415
|
+
AbsoluteTimeContext,
|
|
12416
|
+
RenderAssetManagerProvider,
|
|
12417
|
+
getEffectiveVisualModeValue
|
|
12171
12418
|
};
|
|
12172
12419
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
12173
12420
|
var PERCENTAGE = NUMBER + "%";
|
|
@@ -12196,9 +12443,9 @@ var validateFrame = ({
|
|
|
12196
12443
|
}
|
|
12197
12444
|
};
|
|
12198
12445
|
var flattenChildren = (children) => {
|
|
12199
|
-
const childrenArray =
|
|
12446
|
+
const childrenArray = React34.Children.toArray(children);
|
|
12200
12447
|
return childrenArray.reduce((flatChildren, child) => {
|
|
12201
|
-
if (child.type ===
|
|
12448
|
+
if (child.type === React34.Fragment) {
|
|
12202
12449
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
12203
12450
|
}
|
|
12204
12451
|
flatChildren.push(child);
|
|
@@ -12219,7 +12466,7 @@ var IsNotInsideSeriesProvider = ({ children }) => {
|
|
|
12219
12466
|
});
|
|
12220
12467
|
};
|
|
12221
12468
|
var useRequireToBeInsideSeries = () => {
|
|
12222
|
-
const isInsideSeries =
|
|
12469
|
+
const isInsideSeries = React35.useContext(IsInsideSeriesContext);
|
|
12223
12470
|
if (!isInsideSeries) {
|
|
12224
12471
|
throw new Error("This component must be inside a <Series /> component.");
|
|
12225
12472
|
}
|
|
@@ -12230,9 +12477,9 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
|
12230
12477
|
children
|
|
12231
12478
|
});
|
|
12232
12479
|
};
|
|
12233
|
-
var SeriesSequence =
|
|
12480
|
+
var SeriesSequence = forwardRef11(SeriesSequenceRefForwardingFunction);
|
|
12234
12481
|
var Series = (props2) => {
|
|
12235
|
-
const childrenValue =
|
|
12482
|
+
const childrenValue = useMemo34(() => {
|
|
12236
12483
|
let startFrame = 0;
|
|
12237
12484
|
const flattenedChildren = flattenChildren(props2.children);
|
|
12238
12485
|
return Children.map(flattenedChildren, (child, i) => {
|
|
@@ -12765,14 +13012,14 @@ var VideoForRenderingForwardFunction = ({
|
|
|
12765
13012
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
12766
13013
|
const videoConfig = useUnsafeVideoConfig();
|
|
12767
13014
|
const videoRef = useRef20(null);
|
|
12768
|
-
const sequenceContext =
|
|
13015
|
+
const sequenceContext = useContext35(SequenceContext);
|
|
12769
13016
|
const mediaStartsAt = useMediaStartsAt();
|
|
12770
13017
|
const environment = useRemotionEnvironment();
|
|
12771
13018
|
const logLevel = useLogLevel();
|
|
12772
13019
|
const mountTime = useMountTime();
|
|
12773
13020
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
12774
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
12775
|
-
const id =
|
|
13021
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext35(RenderAssetManager);
|
|
13022
|
+
const id = useMemo35(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
12776
13023
|
props2.src,
|
|
12777
13024
|
sequenceContext?.cumulatedFrom,
|
|
12778
13025
|
sequenceContext?.relativeFrom,
|
|
@@ -12787,7 +13034,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
12787
13034
|
mediaVolume: 1
|
|
12788
13035
|
});
|
|
12789
13036
|
warnAboutTooHighVolume(volume);
|
|
12790
|
-
|
|
13037
|
+
useEffect17(() => {
|
|
12791
13038
|
if (!props2.src) {
|
|
12792
13039
|
throw new Error("No src passed");
|
|
12793
13040
|
}
|
|
@@ -12830,7 +13077,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
12830
13077
|
useImperativeHandle10(ref, () => {
|
|
12831
13078
|
return videoRef.current;
|
|
12832
13079
|
}, []);
|
|
12833
|
-
|
|
13080
|
+
useEffect17(() => {
|
|
12834
13081
|
if (!window.remotion_videoEnabled) {
|
|
12835
13082
|
return;
|
|
12836
13083
|
}
|
|
@@ -12954,7 +13201,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
12954
13201
|
...props2
|
|
12955
13202
|
});
|
|
12956
13203
|
};
|
|
12957
|
-
var VideoForRendering =
|
|
13204
|
+
var VideoForRendering = forwardRef12(VideoForRenderingForwardFunction);
|
|
12958
13205
|
var VideoForwardingFunction = (props2, ref) => {
|
|
12959
13206
|
const {
|
|
12960
13207
|
startFrom,
|
|
@@ -12975,7 +13222,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
12975
13222
|
if (environment.isClientSideRendering) {
|
|
12976
13223
|
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");
|
|
12977
13224
|
}
|
|
12978
|
-
const { durations, setDurations } =
|
|
13225
|
+
const { durations, setDurations } = useContext36(DurationsContext);
|
|
12979
13226
|
if (typeof ref === "string") {
|
|
12980
13227
|
throw new Error("string refs are not supported");
|
|
12981
13228
|
}
|
|
@@ -12983,10 +13230,10 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
12983
13230
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
12984
13231
|
}
|
|
12985
13232
|
const preloadedSrc = usePreload(props2.src);
|
|
12986
|
-
const onDuration =
|
|
13233
|
+
const onDuration = useCallback17((src, durationInSeconds) => {
|
|
12987
13234
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
12988
13235
|
}, [setDurations]);
|
|
12989
|
-
const onVideoFrame =
|
|
13236
|
+
const onVideoFrame = useCallback17(() => {}, []);
|
|
12990
13237
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
12991
13238
|
validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
|
|
12992
13239
|
const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
|
|
@@ -13059,7 +13306,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
13059
13306
|
onAutoPlayError: onAutoPlayError ?? undefined
|
|
13060
13307
|
});
|
|
13061
13308
|
};
|
|
13062
|
-
var Html5Video =
|
|
13309
|
+
var Html5Video = forwardRef13(VideoForwardingFunction);
|
|
13063
13310
|
addSequenceStackTraces(Html5Video);
|
|
13064
13311
|
checkMultipleRemotionVersions();
|
|
13065
13312
|
var proxyObj = {};
|
|
@@ -13099,8 +13346,8 @@ import { jsx as jsx83 } from "react/jsx-runtime";
|
|
|
13099
13346
|
import React52 from "react";
|
|
13100
13347
|
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
13101
13348
|
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
13102
|
-
import { jsx as
|
|
13103
|
-
import * as
|
|
13349
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
13350
|
+
import * as React342 from "react";
|
|
13104
13351
|
import * as ReactDOM4 from "react-dom";
|
|
13105
13352
|
import React9 from "react";
|
|
13106
13353
|
import * as React6 from "react";
|
|
@@ -13139,13 +13386,13 @@ import * as React252 from "react";
|
|
|
13139
13386
|
import * as React26 from "react";
|
|
13140
13387
|
import { jsx as jsx223 } from "react/jsx-runtime";
|
|
13141
13388
|
import * as React332 from "react";
|
|
13142
|
-
import * as
|
|
13389
|
+
import * as React29 from "react";
|
|
13143
13390
|
import { useState as useState112 } from "react";
|
|
13144
13391
|
import * as React272 from "react";
|
|
13145
|
-
import * as
|
|
13392
|
+
import * as React282 from "react";
|
|
13146
13393
|
import * as React322 from "react";
|
|
13147
|
-
import * as
|
|
13148
|
-
import * as
|
|
13394
|
+
import * as React31 from "react";
|
|
13395
|
+
import * as React302 from "react";
|
|
13149
13396
|
import { Fragment as Fragment62, jsx as jsx232, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
13150
13397
|
import { forwardRef as forwardRef132, createElement as createElement7 } from "react";
|
|
13151
13398
|
import { forwardRef as forwardRef122, createElement as createElement6 } from "react";
|
|
@@ -13157,7 +13404,7 @@ import * as React36 from "react";
|
|
|
13157
13404
|
import { jsx as jsx262 } from "react/jsx-runtime";
|
|
13158
13405
|
import * as React46 from "react";
|
|
13159
13406
|
import React39 from "react";
|
|
13160
|
-
import * as
|
|
13407
|
+
import * as React372 from "react";
|
|
13161
13408
|
import * as React38 from "react";
|
|
13162
13409
|
import { Fragment as Fragment22, jsx as jsx272 } from "react/jsx-runtime";
|
|
13163
13410
|
import { jsx as jsx282 } from "react/jsx-runtime";
|
|
@@ -13200,19 +13447,19 @@ var getChildNodeFrom = (htmlElement) => {
|
|
|
13200
13447
|
return childNode;
|
|
13201
13448
|
};
|
|
13202
13449
|
var useHoverTransforms = (ref, disabled) => {
|
|
13203
|
-
const [state, setState] =
|
|
13450
|
+
const [state, setState] = React4.useState({
|
|
13204
13451
|
progress: 0,
|
|
13205
13452
|
isActive: false
|
|
13206
13453
|
});
|
|
13207
|
-
const eventTarget =
|
|
13208
|
-
|
|
13454
|
+
const eventTarget = useMemo36(() => new EventTarget, []);
|
|
13455
|
+
useEffect18(() => {
|
|
13209
13456
|
if (disabled) {
|
|
13210
13457
|
eventTarget.dispatchEvent(new Event("disabled"));
|
|
13211
13458
|
} else {
|
|
13212
13459
|
eventTarget.dispatchEvent(new Event("enabled"));
|
|
13213
13460
|
}
|
|
13214
13461
|
}, [disabled, eventTarget]);
|
|
13215
|
-
|
|
13462
|
+
React4.useEffect(() => {
|
|
13216
13463
|
const element = ref.current;
|
|
13217
13464
|
if (!element)
|
|
13218
13465
|
return;
|
|
@@ -13287,8 +13534,8 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
13287
13534
|
return state;
|
|
13288
13535
|
};
|
|
13289
13536
|
var useClickTransforms = (ref) => {
|
|
13290
|
-
const [hoverProgress, setHoverProgress] =
|
|
13291
|
-
|
|
13537
|
+
const [hoverProgress, setHoverProgress] = React4.useState(0);
|
|
13538
|
+
React4.useEffect(() => {
|
|
13292
13539
|
const element = getChildNodeFrom(ref.current);
|
|
13293
13540
|
if (!element) {
|
|
13294
13541
|
return;
|
|
@@ -13351,8 +13598,8 @@ var getAngle = (ref, coordinates) => {
|
|
|
13351
13598
|
};
|
|
13352
13599
|
var lastCoordinates = null;
|
|
13353
13600
|
var useMousePosition = (ref) => {
|
|
13354
|
-
const [angle, setAngle] =
|
|
13355
|
-
|
|
13601
|
+
const [angle, setAngle] = useState19(getAngle(ref.current, lastCoordinates));
|
|
13602
|
+
useEffect18(() => {
|
|
13356
13603
|
const element = ref.current;
|
|
13357
13604
|
if (!element) {
|
|
13358
13605
|
return;
|
|
@@ -13519,7 +13766,7 @@ var Button = ({
|
|
|
13519
13766
|
const [dimensions, setDimensions] = useState22(null);
|
|
13520
13767
|
const ref = useRef22(null);
|
|
13521
13768
|
const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
|
|
13522
|
-
const onPointerEnter =
|
|
13769
|
+
const onPointerEnter = useCallback18((e) => {
|
|
13523
13770
|
if (e.pointerType !== "mouse") {
|
|
13524
13771
|
return;
|
|
13525
13772
|
}
|
|
@@ -13751,11 +13998,11 @@ var Link = ({
|
|
|
13751
13998
|
});
|
|
13752
13999
|
};
|
|
13753
14000
|
var PlanePaperIcon = (props) => {
|
|
13754
|
-
return /* @__PURE__ */
|
|
14001
|
+
return /* @__PURE__ */ jsx113("svg", {
|
|
13755
14002
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13756
14003
|
...props,
|
|
13757
14004
|
viewBox: "0 0 576 512",
|
|
13758
|
-
children: /* @__PURE__ */
|
|
14005
|
+
children: /* @__PURE__ */ jsx113("path", {
|
|
13759
14006
|
fill: "currentcolor",
|
|
13760
14007
|
d: "M169.9 280L94.9 448.6 461.2 280 169.9 280zm291.3-48L94.9 63.4 169.9 232 461.2 232zM34.8 465.6L128 256 34.8 46.4C33 42.2 32 37.6 32 33 32 14.8 46.7 0 64.8 0 69.5 0 74.2 1 78.5 3L554.2 222c13.3 6.1 21.8 19.4 21.8 34s-8.5 27.9-21.8 34L78.5 509c-4.3 2-9 3-13.7 3-18.1 0-32.8-14.8-32.8-33 0-4.6 1-9.2 2.8-13.4z"
|
|
13761
14008
|
})
|
|
@@ -16924,7 +17171,7 @@ var SideCar = function(_a) {
|
|
|
16924
17171
|
if (!Target) {
|
|
16925
17172
|
throw new Error("Sidecar medium not found");
|
|
16926
17173
|
}
|
|
16927
|
-
return
|
|
17174
|
+
return React282.createElement(Target, __assign({}, rest));
|
|
16928
17175
|
};
|
|
16929
17176
|
SideCar.isSideCarExport = true;
|
|
16930
17177
|
function exportSidecar(medium, exported) {
|
|
@@ -16935,9 +17182,9 @@ var effectCar = createSidecarMedium();
|
|
|
16935
17182
|
var nothing = function() {
|
|
16936
17183
|
return;
|
|
16937
17184
|
};
|
|
16938
|
-
var RemoveScroll =
|
|
16939
|
-
var ref =
|
|
16940
|
-
var _a =
|
|
17185
|
+
var RemoveScroll = React29.forwardRef(function(props, parentRef) {
|
|
17186
|
+
var ref = React29.useRef(null);
|
|
17187
|
+
var _a = React29.useState({
|
|
16941
17188
|
onScrollCapture: nothing,
|
|
16942
17189
|
onWheelCapture: nothing,
|
|
16943
17190
|
onTouchMoveCapture: nothing
|
|
@@ -16946,7 +17193,7 @@ var RemoveScroll = React292.forwardRef(function(props, parentRef) {
|
|
|
16946
17193
|
var SideCar2 = sideCar;
|
|
16947
17194
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
16948
17195
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
16949
|
-
return
|
|
17196
|
+
return React29.createElement(React29.Fragment, null, enabled && React29.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }), forwardProps ? React29.cloneElement(React29.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React29.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children));
|
|
16950
17197
|
});
|
|
16951
17198
|
RemoveScroll.defaultProps = {
|
|
16952
17199
|
enabled: true,
|
|
@@ -17014,7 +17261,7 @@ var stylesheetSingleton = function() {
|
|
|
17014
17261
|
var styleHookSingleton = function() {
|
|
17015
17262
|
var sheet = stylesheetSingleton();
|
|
17016
17263
|
return function(styles, isDynamic) {
|
|
17017
|
-
|
|
17264
|
+
React302.useEffect(function() {
|
|
17018
17265
|
sheet.add(styles);
|
|
17019
17266
|
return function() {
|
|
17020
17267
|
sheet.remove();
|
|
@@ -17119,7 +17366,7 @@ var getCurrentUseCounter = function() {
|
|
|
17119
17366
|
return isFinite(counter) ? counter : 0;
|
|
17120
17367
|
};
|
|
17121
17368
|
var useLockAttribute = function() {
|
|
17122
|
-
|
|
17369
|
+
React31.useEffect(function() {
|
|
17123
17370
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
17124
17371
|
return function() {
|
|
17125
17372
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -17134,10 +17381,10 @@ var useLockAttribute = function() {
|
|
|
17134
17381
|
var RemoveScrollBar = function(_a) {
|
|
17135
17382
|
var { noRelative, noImportant, gapMode: _b } = _a, gapMode = _b === undefined ? "margin" : _b;
|
|
17136
17383
|
useLockAttribute();
|
|
17137
|
-
var gap =
|
|
17384
|
+
var gap = React31.useMemo(function() {
|
|
17138
17385
|
return getGapWidth(gapMode);
|
|
17139
17386
|
}, [gapMode]);
|
|
17140
|
-
return
|
|
17387
|
+
return React31.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
17141
17388
|
};
|
|
17142
17389
|
var passiveSupported = false;
|
|
17143
17390
|
if (typeof window !== "undefined") {
|
|
@@ -17438,9 +17685,9 @@ var Select = (props) => {
|
|
|
17438
17685
|
required
|
|
17439
17686
|
} = props;
|
|
17440
17687
|
const popperScope = usePopperScope(__scopeSelect);
|
|
17441
|
-
const [trigger, setTrigger] =
|
|
17442
|
-
const [valueNode, setValueNode] =
|
|
17443
|
-
const [valueNodeHasChildren, setValueNodeHasChildren] =
|
|
17688
|
+
const [trigger, setTrigger] = React342.useState(null);
|
|
17689
|
+
const [valueNode, setValueNode] = React342.useState(null);
|
|
17690
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = React342.useState(false);
|
|
17444
17691
|
const direction = useDirection(dir);
|
|
17445
17692
|
const [open = false, setOpen] = useControllableState({
|
|
17446
17693
|
prop: openProp,
|
|
@@ -17452,9 +17699,9 @@ var Select = (props) => {
|
|
|
17452
17699
|
defaultProp: defaultValue,
|
|
17453
17700
|
onChange: onValueChange
|
|
17454
17701
|
});
|
|
17455
|
-
const triggerPointerDownPosRef =
|
|
17702
|
+
const triggerPointerDownPosRef = React342.useRef(null);
|
|
17456
17703
|
const isFormControl = trigger ? Boolean(trigger.closest("form")) : true;
|
|
17457
|
-
const [nativeOptionsSet, setNativeOptionsSet] =
|
|
17704
|
+
const [nativeOptionsSet, setNativeOptionsSet] = React342.useState(/* @__PURE__ */ new Set);
|
|
17458
17705
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
17459
17706
|
return /* @__PURE__ */ jsx232(Root22, { ...popperScope, children: /* @__PURE__ */ jsxs4(SelectProvider, {
|
|
17460
17707
|
required,
|
|
@@ -17476,10 +17723,10 @@ var Select = (props) => {
|
|
|
17476
17723
|
children: [
|
|
17477
17724
|
/* @__PURE__ */ jsx232(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx232(SelectNativeOptionsProvider, {
|
|
17478
17725
|
scope: props.__scopeSelect,
|
|
17479
|
-
onNativeOptionAdd:
|
|
17726
|
+
onNativeOptionAdd: React342.useCallback((option) => {
|
|
17480
17727
|
setNativeOptionsSet((prev) => new Set(prev).add(option));
|
|
17481
17728
|
}, []),
|
|
17482
|
-
onNativeOptionRemove:
|
|
17729
|
+
onNativeOptionRemove: React342.useCallback((option) => {
|
|
17483
17730
|
setNativeOptionsSet((prev) => {
|
|
17484
17731
|
const optionsSet = new Set(prev);
|
|
17485
17732
|
optionsSet.delete(option);
|
|
@@ -17507,7 +17754,7 @@ var Select = (props) => {
|
|
|
17507
17754
|
};
|
|
17508
17755
|
Select.displayName = SELECT_NAME;
|
|
17509
17756
|
var TRIGGER_NAME = "SelectTrigger";
|
|
17510
|
-
var SelectTrigger =
|
|
17757
|
+
var SelectTrigger = React342.forwardRef((props, forwardedRef) => {
|
|
17511
17758
|
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
17512
17759
|
const popperScope = usePopperScope(__scopeSelect);
|
|
17513
17760
|
const context = useSelectContext(TRIGGER_NAME, __scopeSelect);
|
|
@@ -17575,7 +17822,7 @@ var SelectTrigger = React34.forwardRef((props, forwardedRef) => {
|
|
|
17575
17822
|
});
|
|
17576
17823
|
SelectTrigger.displayName = TRIGGER_NAME;
|
|
17577
17824
|
var VALUE_NAME = "SelectValue";
|
|
17578
|
-
var SelectValue =
|
|
17825
|
+
var SelectValue = React342.forwardRef((props, forwardedRef) => {
|
|
17579
17826
|
const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
|
|
17580
17827
|
const context = useSelectContext(VALUE_NAME, __scopeSelect);
|
|
17581
17828
|
const { onValueNodeHasChildrenChange } = context;
|
|
@@ -17593,7 +17840,7 @@ var SelectValue = React34.forwardRef((props, forwardedRef) => {
|
|
|
17593
17840
|
});
|
|
17594
17841
|
SelectValue.displayName = VALUE_NAME;
|
|
17595
17842
|
var ICON_NAME = "SelectIcon";
|
|
17596
|
-
var SelectIcon =
|
|
17843
|
+
var SelectIcon = React342.forwardRef((props, forwardedRef) => {
|
|
17597
17844
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
17598
17845
|
return /* @__PURE__ */ jsx232(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "▼" });
|
|
17599
17846
|
});
|
|
@@ -17604,9 +17851,9 @@ var SelectPortal = (props) => {
|
|
|
17604
17851
|
};
|
|
17605
17852
|
SelectPortal.displayName = PORTAL_NAME2;
|
|
17606
17853
|
var CONTENT_NAME2 = "SelectContent";
|
|
17607
|
-
var SelectContent =
|
|
17854
|
+
var SelectContent = React342.forwardRef((props, forwardedRef) => {
|
|
17608
17855
|
const context = useSelectContext(CONTENT_NAME2, props.__scopeSelect);
|
|
17609
|
-
const [fragment, setFragment] =
|
|
17856
|
+
const [fragment, setFragment] = React342.useState();
|
|
17610
17857
|
useLayoutEffect22(() => {
|
|
17611
17858
|
setFragment(new DocumentFragment);
|
|
17612
17859
|
}, []);
|
|
@@ -17620,7 +17867,7 @@ SelectContent.displayName = CONTENT_NAME2;
|
|
|
17620
17867
|
var CONTENT_MARGIN = 10;
|
|
17621
17868
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME2);
|
|
17622
17869
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
17623
|
-
var SelectContentImpl =
|
|
17870
|
+
var SelectContentImpl = React342.forwardRef((props, forwardedRef) => {
|
|
17624
17871
|
const {
|
|
17625
17872
|
__scopeSelect,
|
|
17626
17873
|
position = "item-aligned",
|
|
@@ -17640,20 +17887,20 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17640
17887
|
...contentProps
|
|
17641
17888
|
} = props;
|
|
17642
17889
|
const context = useSelectContext(CONTENT_NAME2, __scopeSelect);
|
|
17643
|
-
const [content, setContent] =
|
|
17644
|
-
const [viewport, setViewport] =
|
|
17890
|
+
const [content, setContent] = React342.useState(null);
|
|
17891
|
+
const [viewport, setViewport] = React342.useState(null);
|
|
17645
17892
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
17646
|
-
const [selectedItem, setSelectedItem] =
|
|
17647
|
-
const [selectedItemText, setSelectedItemText] =
|
|
17893
|
+
const [selectedItem, setSelectedItem] = React342.useState(null);
|
|
17894
|
+
const [selectedItemText, setSelectedItemText] = React342.useState(null);
|
|
17648
17895
|
const getItems = useCollection(__scopeSelect);
|
|
17649
|
-
const [isPositioned, setIsPositioned] =
|
|
17650
|
-
const firstValidItemFoundRef =
|
|
17651
|
-
|
|
17896
|
+
const [isPositioned, setIsPositioned] = React342.useState(false);
|
|
17897
|
+
const firstValidItemFoundRef = React342.useRef(false);
|
|
17898
|
+
React342.useEffect(() => {
|
|
17652
17899
|
if (content)
|
|
17653
17900
|
return hideOthers(content);
|
|
17654
17901
|
}, [content]);
|
|
17655
17902
|
useFocusGuards();
|
|
17656
|
-
const focusFirst2 =
|
|
17903
|
+
const focusFirst2 = React342.useCallback((candidates) => {
|
|
17657
17904
|
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
|
17658
17905
|
const [lastItem] = restItems.slice(-1);
|
|
17659
17906
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
@@ -17670,14 +17917,14 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17670
17917
|
return;
|
|
17671
17918
|
}
|
|
17672
17919
|
}, [getItems, viewport]);
|
|
17673
|
-
const focusSelectedItem =
|
|
17674
|
-
|
|
17920
|
+
const focusSelectedItem = React342.useCallback(() => focusFirst2([selectedItem, content]), [focusFirst2, selectedItem, content]);
|
|
17921
|
+
React342.useEffect(() => {
|
|
17675
17922
|
if (isPositioned) {
|
|
17676
17923
|
focusSelectedItem();
|
|
17677
17924
|
}
|
|
17678
17925
|
}, [isPositioned, focusSelectedItem]);
|
|
17679
17926
|
const { onOpenChange, triggerPointerDownPosRef } = context;
|
|
17680
|
-
|
|
17927
|
+
React342.useEffect(() => {
|
|
17681
17928
|
if (content) {
|
|
17682
17929
|
let pointerMoveDelta = { x: 0, y: 0 };
|
|
17683
17930
|
const handlePointerMove = (event) => {
|
|
@@ -17707,7 +17954,7 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17707
17954
|
};
|
|
17708
17955
|
}
|
|
17709
17956
|
}, [content, onOpenChange, triggerPointerDownPosRef]);
|
|
17710
|
-
|
|
17957
|
+
React342.useEffect(() => {
|
|
17711
17958
|
const close = () => onOpenChange(false);
|
|
17712
17959
|
window.addEventListener("blur", close);
|
|
17713
17960
|
window.addEventListener("resize", close);
|
|
@@ -17724,7 +17971,7 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17724
17971
|
setTimeout(() => nextItem.ref.current.focus());
|
|
17725
17972
|
}
|
|
17726
17973
|
});
|
|
17727
|
-
const itemRefCallback =
|
|
17974
|
+
const itemRefCallback = React342.useCallback((node, value, disabled) => {
|
|
17728
17975
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
17729
17976
|
const isSelectedItem = context.value !== undefined && context.value === value;
|
|
17730
17977
|
if (isSelectedItem || isFirstValidItem) {
|
|
@@ -17733,8 +17980,8 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17733
17980
|
firstValidItemFoundRef.current = true;
|
|
17734
17981
|
}
|
|
17735
17982
|
}, [context.value]);
|
|
17736
|
-
const handleItemLeave =
|
|
17737
|
-
const itemTextRefCallback =
|
|
17983
|
+
const handleItemLeave = React342.useCallback(() => content?.focus(), [content]);
|
|
17984
|
+
const itemTextRefCallback = React342.useCallback((node, value, disabled) => {
|
|
17738
17985
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
17739
17986
|
const isSelectedItem = context.value !== undefined && context.value === value;
|
|
17740
17987
|
if (isSelectedItem || isFirstValidItem) {
|
|
@@ -17829,18 +18076,18 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17829
18076
|
});
|
|
17830
18077
|
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
17831
18078
|
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
17832
|
-
var SelectItemAlignedPosition =
|
|
18079
|
+
var SelectItemAlignedPosition = React342.forwardRef((props, forwardedRef) => {
|
|
17833
18080
|
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
17834
18081
|
const context = useSelectContext(CONTENT_NAME2, __scopeSelect);
|
|
17835
18082
|
const contentContext = useSelectContentContext(CONTENT_NAME2, __scopeSelect);
|
|
17836
|
-
const [contentWrapper, setContentWrapper] =
|
|
17837
|
-
const [content, setContent] =
|
|
18083
|
+
const [contentWrapper, setContentWrapper] = React342.useState(null);
|
|
18084
|
+
const [content, setContent] = React342.useState(null);
|
|
17838
18085
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
17839
18086
|
const getItems = useCollection(__scopeSelect);
|
|
17840
|
-
const shouldExpandOnScrollRef =
|
|
17841
|
-
const shouldRepositionRef =
|
|
18087
|
+
const shouldExpandOnScrollRef = React342.useRef(false);
|
|
18088
|
+
const shouldRepositionRef = React342.useRef(true);
|
|
17842
18089
|
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
17843
|
-
const position =
|
|
18090
|
+
const position = React342.useCallback(() => {
|
|
17844
18091
|
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
17845
18092
|
const triggerRect = context.trigger.getBoundingClientRect();
|
|
17846
18093
|
const contentRect = content.getBoundingClientRect();
|
|
@@ -17921,12 +18168,12 @@ var SelectItemAlignedPosition = React34.forwardRef((props, forwardedRef) => {
|
|
|
17921
18168
|
onPlaced
|
|
17922
18169
|
]);
|
|
17923
18170
|
useLayoutEffect22(() => position(), [position]);
|
|
17924
|
-
const [contentZIndex, setContentZIndex] =
|
|
18171
|
+
const [contentZIndex, setContentZIndex] = React342.useState();
|
|
17925
18172
|
useLayoutEffect22(() => {
|
|
17926
18173
|
if (content)
|
|
17927
18174
|
setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
17928
18175
|
}, [content]);
|
|
17929
|
-
const handleScrollButtonChange =
|
|
18176
|
+
const handleScrollButtonChange = React342.useCallback((node) => {
|
|
17930
18177
|
if (node && shouldRepositionRef.current === true) {
|
|
17931
18178
|
position();
|
|
17932
18179
|
focusSelectedItem?.();
|
|
@@ -17960,7 +18207,7 @@ var SelectItemAlignedPosition = React34.forwardRef((props, forwardedRef) => {
|
|
|
17960
18207
|
});
|
|
17961
18208
|
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
|
|
17962
18209
|
var POPPER_POSITION_NAME = "SelectPopperPosition";
|
|
17963
|
-
var SelectPopperPosition =
|
|
18210
|
+
var SelectPopperPosition = React342.forwardRef((props, forwardedRef) => {
|
|
17964
18211
|
const {
|
|
17965
18212
|
__scopeSelect,
|
|
17966
18213
|
align = "start",
|
|
@@ -17990,12 +18237,12 @@ var SelectPopperPosition = React34.forwardRef((props, forwardedRef) => {
|
|
|
17990
18237
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
17991
18238
|
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME2, {});
|
|
17992
18239
|
var VIEWPORT_NAME = "SelectViewport";
|
|
17993
|
-
var SelectViewport =
|
|
18240
|
+
var SelectViewport = React342.forwardRef((props, forwardedRef) => {
|
|
17994
18241
|
const { __scopeSelect, nonce, ...viewportProps } = props;
|
|
17995
18242
|
const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
|
|
17996
18243
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
17997
18244
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
17998
|
-
const prevScrollTopRef =
|
|
18245
|
+
const prevScrollTopRef = React342.useRef(0);
|
|
17999
18246
|
return /* @__PURE__ */ jsxs4(Fragment62, { children: [
|
|
18000
18247
|
/* @__PURE__ */ jsx232("style", {
|
|
18001
18248
|
dangerouslySetInnerHTML: {
|
|
@@ -18044,14 +18291,14 @@ var SelectViewport = React34.forwardRef((props, forwardedRef) => {
|
|
|
18044
18291
|
SelectViewport.displayName = VIEWPORT_NAME;
|
|
18045
18292
|
var GROUP_NAME = "SelectGroup";
|
|
18046
18293
|
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);
|
|
18047
|
-
var SelectGroup =
|
|
18294
|
+
var SelectGroup = React342.forwardRef((props, forwardedRef) => {
|
|
18048
18295
|
const { __scopeSelect, ...groupProps } = props;
|
|
18049
18296
|
const groupId = useId();
|
|
18050
18297
|
return /* @__PURE__ */ jsx232(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx232(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
|
|
18051
18298
|
});
|
|
18052
18299
|
SelectGroup.displayName = GROUP_NAME;
|
|
18053
18300
|
var LABEL_NAME = "SelectLabel";
|
|
18054
|
-
var SelectLabel =
|
|
18301
|
+
var SelectLabel = React342.forwardRef((props, forwardedRef) => {
|
|
18055
18302
|
const { __scopeSelect, ...labelProps } = props;
|
|
18056
18303
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
18057
18304
|
return /* @__PURE__ */ jsx232(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
|
|
@@ -18059,7 +18306,7 @@ var SelectLabel = React34.forwardRef((props, forwardedRef) => {
|
|
|
18059
18306
|
SelectLabel.displayName = LABEL_NAME;
|
|
18060
18307
|
var ITEM_NAME = "SelectItem";
|
|
18061
18308
|
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);
|
|
18062
|
-
var SelectItem =
|
|
18309
|
+
var SelectItem = React342.forwardRef((props, forwardedRef) => {
|
|
18063
18310
|
const {
|
|
18064
18311
|
__scopeSelect,
|
|
18065
18312
|
value,
|
|
@@ -18070,8 +18317,8 @@ var SelectItem = React34.forwardRef((props, forwardedRef) => {
|
|
|
18070
18317
|
const context = useSelectContext(ITEM_NAME, __scopeSelect);
|
|
18071
18318
|
const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);
|
|
18072
18319
|
const isSelected = context.value === value;
|
|
18073
|
-
const [textValue, setTextValue] =
|
|
18074
|
-
const [isFocused, setIsFocused] =
|
|
18320
|
+
const [textValue, setTextValue] = React342.useState(textValueProp ?? "");
|
|
18321
|
+
const [isFocused, setIsFocused] = React342.useState(false);
|
|
18075
18322
|
const composedRefs = useComposedRefs(forwardedRef, (node) => contentContext.itemRefCallback?.(node, value, disabled));
|
|
18076
18323
|
const textId = useId();
|
|
18077
18324
|
const handleSelect = () => {
|
|
@@ -18089,7 +18336,7 @@ var SelectItem = React34.forwardRef((props, forwardedRef) => {
|
|
|
18089
18336
|
disabled,
|
|
18090
18337
|
textId,
|
|
18091
18338
|
isSelected,
|
|
18092
|
-
onItemTextChange:
|
|
18339
|
+
onItemTextChange: React342.useCallback((node) => {
|
|
18093
18340
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
18094
18341
|
}, []),
|
|
18095
18342
|
children: /* @__PURE__ */ jsx232(Collection.ItemSlot, {
|
|
@@ -18138,16 +18385,16 @@ var SelectItem = React34.forwardRef((props, forwardedRef) => {
|
|
|
18138
18385
|
});
|
|
18139
18386
|
SelectItem.displayName = ITEM_NAME;
|
|
18140
18387
|
var ITEM_TEXT_NAME = "SelectItemText";
|
|
18141
|
-
var SelectItemText =
|
|
18388
|
+
var SelectItemText = React342.forwardRef((props, forwardedRef) => {
|
|
18142
18389
|
const { __scopeSelect, className, style, ...itemTextProps } = props;
|
|
18143
18390
|
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
18144
18391
|
const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
18145
18392
|
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
18146
18393
|
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
18147
|
-
const [itemTextNode, setItemTextNode] =
|
|
18394
|
+
const [itemTextNode, setItemTextNode] = React342.useState(null);
|
|
18148
18395
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setItemTextNode(node), itemContext.onItemTextChange, (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled));
|
|
18149
18396
|
const textContent = itemTextNode?.textContent;
|
|
18150
|
-
const nativeOption =
|
|
18397
|
+
const nativeOption = React342.useMemo(() => /* @__PURE__ */ jsx232("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value), [itemContext.disabled, itemContext.value, textContent]);
|
|
18151
18398
|
const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
|
|
18152
18399
|
useLayoutEffect22(() => {
|
|
18153
18400
|
onNativeOptionAdd(nativeOption);
|
|
@@ -18160,17 +18407,17 @@ var SelectItemText = React34.forwardRef((props, forwardedRef) => {
|
|
|
18160
18407
|
});
|
|
18161
18408
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
18162
18409
|
var ITEM_INDICATOR_NAME = "SelectItemIndicator";
|
|
18163
|
-
var SelectItemIndicator =
|
|
18410
|
+
var SelectItemIndicator = React342.forwardRef((props, forwardedRef) => {
|
|
18164
18411
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
18165
18412
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
18166
18413
|
return itemContext.isSelected ? /* @__PURE__ */ jsx232(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
|
|
18167
18414
|
});
|
|
18168
18415
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
18169
18416
|
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
18170
|
-
var SelectScrollUpButton =
|
|
18417
|
+
var SelectScrollUpButton = React342.forwardRef((props, forwardedRef) => {
|
|
18171
18418
|
const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
18172
18419
|
const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
18173
|
-
const [canScrollUp, setCanScrollUp] =
|
|
18420
|
+
const [canScrollUp, setCanScrollUp] = React342.useState(false);
|
|
18174
18421
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
18175
18422
|
useLayoutEffect22(() => {
|
|
18176
18423
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -18198,10 +18445,10 @@ var SelectScrollUpButton = React34.forwardRef((props, forwardedRef) => {
|
|
|
18198
18445
|
});
|
|
18199
18446
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
18200
18447
|
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
18201
|
-
var SelectScrollDownButton =
|
|
18448
|
+
var SelectScrollDownButton = React342.forwardRef((props, forwardedRef) => {
|
|
18202
18449
|
const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
18203
18450
|
const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
18204
|
-
const [canScrollDown, setCanScrollDown] =
|
|
18451
|
+
const [canScrollDown, setCanScrollDown] = React342.useState(false);
|
|
18205
18452
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
18206
18453
|
useLayoutEffect22(() => {
|
|
18207
18454
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -18229,18 +18476,18 @@ var SelectScrollDownButton = React34.forwardRef((props, forwardedRef) => {
|
|
|
18229
18476
|
}) : null;
|
|
18230
18477
|
});
|
|
18231
18478
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
18232
|
-
var SelectScrollButtonImpl =
|
|
18479
|
+
var SelectScrollButtonImpl = React342.forwardRef((props, forwardedRef) => {
|
|
18233
18480
|
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
|
|
18234
18481
|
const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
18235
|
-
const autoScrollTimerRef =
|
|
18482
|
+
const autoScrollTimerRef = React342.useRef(null);
|
|
18236
18483
|
const getItems = useCollection(__scopeSelect);
|
|
18237
|
-
const clearAutoScrollTimer =
|
|
18484
|
+
const clearAutoScrollTimer = React342.useCallback(() => {
|
|
18238
18485
|
if (autoScrollTimerRef.current !== null) {
|
|
18239
18486
|
window.clearInterval(autoScrollTimerRef.current);
|
|
18240
18487
|
autoScrollTimerRef.current = null;
|
|
18241
18488
|
}
|
|
18242
18489
|
}, []);
|
|
18243
|
-
|
|
18490
|
+
React342.useEffect(() => {
|
|
18244
18491
|
return () => clearAutoScrollTimer();
|
|
18245
18492
|
}, [clearAutoScrollTimer]);
|
|
18246
18493
|
useLayoutEffect22(() => {
|
|
@@ -18269,13 +18516,13 @@ var SelectScrollButtonImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
18269
18516
|
});
|
|
18270
18517
|
});
|
|
18271
18518
|
var SEPARATOR_NAME = "SelectSeparator";
|
|
18272
|
-
var SelectSeparator =
|
|
18519
|
+
var SelectSeparator = React342.forwardRef((props, forwardedRef) => {
|
|
18273
18520
|
const { __scopeSelect, ...separatorProps } = props;
|
|
18274
18521
|
return /* @__PURE__ */ jsx232(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
18275
18522
|
});
|
|
18276
18523
|
SelectSeparator.displayName = SEPARATOR_NAME;
|
|
18277
18524
|
var ARROW_NAME2 = "SelectArrow";
|
|
18278
|
-
var SelectArrow =
|
|
18525
|
+
var SelectArrow = React342.forwardRef((props, forwardedRef) => {
|
|
18279
18526
|
const { __scopeSelect, ...arrowProps } = props;
|
|
18280
18527
|
const popperScope = usePopperScope(__scopeSelect);
|
|
18281
18528
|
const context = useSelectContext(ARROW_NAME2, __scopeSelect);
|
|
@@ -18286,12 +18533,12 @@ SelectArrow.displayName = ARROW_NAME2;
|
|
|
18286
18533
|
function shouldShowPlaceholder(value) {
|
|
18287
18534
|
return value === "" || value === undefined;
|
|
18288
18535
|
}
|
|
18289
|
-
var BubbleSelect =
|
|
18536
|
+
var BubbleSelect = React342.forwardRef((props, forwardedRef) => {
|
|
18290
18537
|
const { value, ...selectProps } = props;
|
|
18291
|
-
const ref =
|
|
18538
|
+
const ref = React342.useRef(null);
|
|
18292
18539
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
18293
18540
|
const prevValue = usePrevious(value);
|
|
18294
|
-
|
|
18541
|
+
React342.useEffect(() => {
|
|
18295
18542
|
const select = ref.current;
|
|
18296
18543
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
18297
18544
|
const descriptor = Object.getOwnPropertyDescriptor(selectProto, "value");
|
|
@@ -18307,9 +18554,9 @@ var BubbleSelect = React34.forwardRef((props, forwardedRef) => {
|
|
|
18307
18554
|
BubbleSelect.displayName = "BubbleSelect";
|
|
18308
18555
|
function useTypeaheadSearch(onSearchChange) {
|
|
18309
18556
|
const handleSearchChange = useCallbackRef(onSearchChange);
|
|
18310
|
-
const searchRef =
|
|
18311
|
-
const timerRef =
|
|
18312
|
-
const handleTypeaheadSearch =
|
|
18557
|
+
const searchRef = React342.useRef("");
|
|
18558
|
+
const timerRef = React342.useRef(0);
|
|
18559
|
+
const handleTypeaheadSearch = React342.useCallback((key) => {
|
|
18313
18560
|
const search = searchRef.current + key;
|
|
18314
18561
|
handleSearchChange(search);
|
|
18315
18562
|
(function updateSearch(value) {
|
|
@@ -18319,11 +18566,11 @@ function useTypeaheadSearch(onSearchChange) {
|
|
|
18319
18566
|
timerRef.current = window.setTimeout(() => updateSearch(""), 1000);
|
|
18320
18567
|
})(search);
|
|
18321
18568
|
}, [handleSearchChange]);
|
|
18322
|
-
const resetTypeahead =
|
|
18569
|
+
const resetTypeahead = React342.useCallback(() => {
|
|
18323
18570
|
searchRef.current = "";
|
|
18324
18571
|
window.clearTimeout(timerRef.current);
|
|
18325
18572
|
}, []);
|
|
18326
|
-
|
|
18573
|
+
React342.useEffect(() => {
|
|
18327
18574
|
return () => window.clearTimeout(timerRef.current);
|
|
18328
18575
|
}, []);
|
|
18329
18576
|
return [searchRef, handleTypeaheadSearch, resetTypeahead];
|
|
@@ -18602,7 +18849,7 @@ function composeRefs2(...refs) {
|
|
|
18602
18849
|
};
|
|
18603
18850
|
}
|
|
18604
18851
|
function useComposedRefs2(...refs) {
|
|
18605
|
-
return
|
|
18852
|
+
return React372.useCallback(composeRefs2(...refs), refs);
|
|
18606
18853
|
}
|
|
18607
18854
|
function createSlot(ownerName) {
|
|
18608
18855
|
const SlotClone2 = /* @__PURE__ */ createSlotClone(ownerName);
|
|
@@ -19657,10 +19904,10 @@ var Triangle2 = (props) => {
|
|
|
19657
19904
|
};
|
|
19658
19905
|
|
|
19659
19906
|
// src/components/design.tsx
|
|
19660
|
-
import { useCallback as
|
|
19907
|
+
import { useCallback as useCallback31, useState as useState39 } from "react";
|
|
19661
19908
|
|
|
19662
19909
|
// src/components/ManageTeamMembers.tsx
|
|
19663
|
-
import React51, { useCallback as
|
|
19910
|
+
import React51, { useCallback as useCallback30, useState as useState38 } from "react";
|
|
19664
19911
|
import { jsx as jsx38, jsxs as jsxs6, Fragment as Fragment8 } from "react/jsx-runtime";
|
|
19665
19912
|
function generateId() {
|
|
19666
19913
|
return Math.random().toString(36).substr(2, 9);
|
|
@@ -19704,9 +19951,9 @@ var Row = ({ value, onChange, onDelete, disableDelete }) => {
|
|
|
19704
19951
|
});
|
|
19705
19952
|
};
|
|
19706
19953
|
var ManageTeamMembers = () => {
|
|
19707
|
-
const [members, setMembers] =
|
|
19954
|
+
const [members, setMembers] = useState38(initialMembers);
|
|
19708
19955
|
const displayedMembers = [...members, { id: "NEW", name: "" }];
|
|
19709
|
-
const updateMember =
|
|
19956
|
+
const updateMember = useCallback30((idx, value) => {
|
|
19710
19957
|
if (idx === members.length) {
|
|
19711
19958
|
if (value.trim() !== "") {
|
|
19712
19959
|
setMembers((prev) => [...prev, { id: generateId(), name: value }]);
|
|
@@ -19715,11 +19962,11 @@ var ManageTeamMembers = () => {
|
|
|
19715
19962
|
setMembers((prev) => prev.map((m, i) => i === idx ? { ...m, name: value } : m));
|
|
19716
19963
|
}
|
|
19717
19964
|
}, [members.length]);
|
|
19718
|
-
const deleteMember =
|
|
19965
|
+
const deleteMember = useCallback30((idx) => {
|
|
19719
19966
|
setMembers((prev) => prev.filter((_, i) => i !== idx));
|
|
19720
19967
|
}, []);
|
|
19721
|
-
const [loading, setLoading] =
|
|
19722
|
-
const save =
|
|
19968
|
+
const [loading, setLoading] = useState38(false);
|
|
19969
|
+
const save = useCallback30(() => {
|
|
19723
19970
|
setLoading(true);
|
|
19724
19971
|
setTimeout(() => {
|
|
19725
19972
|
setLoading(false);
|
|
@@ -19774,24 +20021,24 @@ var Explainer = ({ children }) => {
|
|
|
19774
20021
|
});
|
|
19775
20022
|
};
|
|
19776
20023
|
var DesignPage = () => {
|
|
19777
|
-
const [count4, setCount] =
|
|
19778
|
-
const [active, setActive] =
|
|
19779
|
-
const [submitButtonActive, setSubmitButtonActive] =
|
|
19780
|
-
const [submitButtonPrimaryActive, setSubmitButtonPrimaryActive] =
|
|
19781
|
-
const onClick =
|
|
20024
|
+
const [count4, setCount] = useState39(10);
|
|
20025
|
+
const [active, setActive] = useState39(false);
|
|
20026
|
+
const [submitButtonActive, setSubmitButtonActive] = useState39(true);
|
|
20027
|
+
const [submitButtonPrimaryActive, setSubmitButtonPrimaryActive] = useState39(true);
|
|
20028
|
+
const onClick = useCallback31(() => {
|
|
19782
20029
|
setSubmitButtonActive(false);
|
|
19783
20030
|
setTimeout(() => {
|
|
19784
20031
|
setSubmitButtonActive(true);
|
|
19785
20032
|
}, 1000);
|
|
19786
20033
|
}, []);
|
|
19787
|
-
const onClickPrimary =
|
|
20034
|
+
const onClickPrimary = useCallback31(() => {
|
|
19788
20035
|
setSubmitButtonPrimaryActive(false);
|
|
19789
20036
|
setTimeout(() => {
|
|
19790
20037
|
setSubmitButtonPrimaryActive(true);
|
|
19791
20038
|
}, 1000);
|
|
19792
20039
|
}, []);
|
|
19793
|
-
const [saving, setSaving] =
|
|
19794
|
-
const save =
|
|
20040
|
+
const [saving, setSaving] = useState39(false);
|
|
20041
|
+
const save = useCallback31(() => {
|
|
19795
20042
|
setSaving(true);
|
|
19796
20043
|
setTimeout(() => {
|
|
19797
20044
|
setSaving(false);
|