@remotion/promo-pages 4.0.501 → 4.0.503
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 +1511 -1202
- package/dist/components/Homepage.js +15 -2
- package/dist/components/homepage/CanvasSectionTitle.d.ts +4 -0
- package/dist/components/homepage/CanvasSectionTitle.js +14 -0
- package/dist/components/homepage/ChooseTemplate.d.ts +2 -0
- package/dist/components/homepage/ChooseTemplate.js +25 -0
- package/dist/components/homepage/CommunityStatsItems.js +1 -1
- package/dist/components/homepage/Demo/index.js +1 -1
- package/dist/components/homepage/EditorStarterSection.d.ts +3 -0
- package/dist/components/homepage/EditorStarterSection.js +8 -0
- package/dist/components/homepage/FreePricing.js +2 -2
- package/dist/components/homepage/GitHubButton.js +1 -1
- package/dist/components/homepage/MakeVideosAgentically.js +4 -2
- package/dist/components/homepage/MakeVideosInteractively.js +4 -2
- package/dist/components/homepage/MakeVideosProgrammatically.js +3 -1
- package/dist/components/homepage/MoreTemplatesButton.d.ts +2 -0
- package/dist/components/homepage/MoreTemplatesButton.js +11 -0
- package/dist/components/homepage/PricingBulletPoint.js +4 -1
- package/dist/components/homepage/use-transparent-video-source.d.ts +4 -0
- package/dist/components/homepage/use-transparent-video-source.js +9 -0
- package/dist/design.js +3988 -3988
- package/dist/experts.js +3949 -3949
- package/dist/homepage/Pricing.js +3995 -3992
- package/dist/prompts/PromptsGallery.js +3988 -3988
- package/dist/prompts/PromptsShow.js +3604 -3604
- package/dist/prompts/PromptsSubmit.css +2578 -0
- package/dist/prompts/PromptsSubmit.js +3988 -3988
- package/dist/team.js +3988 -3988
- package/dist/template-modal-content.js +3988 -3988
- package/dist/templates.js +3989 -3990
- package/package.json +13 -13
package/dist/Homepage.js
CHANGED
|
@@ -915,7 +915,7 @@ import { useMemo as useMemo42 } from "react";
|
|
|
915
915
|
|
|
916
916
|
// ../core/dist/esm/index.mjs
|
|
917
917
|
import { createContext } from "react";
|
|
918
|
-
import { Suspense, useCallback as
|
|
918
|
+
import { Suspense, useCallback as useCallback4, useContext as useContext9, useEffect as useEffect2 } from "react";
|
|
919
919
|
import { createPortal } from "react-dom";
|
|
920
920
|
import { createContext as createContext2 } from "react";
|
|
921
921
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
@@ -927,56 +927,56 @@ import { createContext as createContext5, useCallback, useContext, useMemo, useR
|
|
|
927
927
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
928
928
|
import { createContext as createContext7, useContext as useContext3 } from "react";
|
|
929
929
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
930
|
-
import { useCallback as useCallback6, useRef as useRef6 } from "react";
|
|
931
930
|
import { forwardRef, useMemo as useMemo3 } from "react";
|
|
932
931
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
933
|
-
import
|
|
932
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
933
|
+
import { createContext as createContext9, createRef, useContext as useContext5, useMemo as useMemo5 } from "react";
|
|
934
|
+
import React4, { createContext as createContext8, useCallback as useCallback2, useMemo as useMemo4 } from "react";
|
|
935
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
936
|
+
import { useContext as useContext4, useState } from "react";
|
|
937
|
+
import React5 from "react";
|
|
938
|
+
import { createContext as createContext11, useCallback as useCallback3, useContext as useContext7 } from "react";
|
|
939
|
+
import { createContext as createContext10 } from "react";
|
|
940
|
+
import * as React6 from "react";
|
|
941
|
+
import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
|
|
942
|
+
import { useContext as useContext8, useMemo as useMemo7 } from "react";
|
|
943
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
944
|
+
import React9 from "react";
|
|
934
945
|
import {
|
|
935
946
|
forwardRef as forwardRef3,
|
|
936
|
-
useCallback as
|
|
937
|
-
useContext as
|
|
938
|
-
useEffect as
|
|
939
|
-
useMemo as
|
|
940
|
-
useRef as
|
|
947
|
+
useCallback as useCallback6,
|
|
948
|
+
useContext as useContext18,
|
|
949
|
+
useEffect as useEffect3,
|
|
950
|
+
useMemo as useMemo15,
|
|
951
|
+
useRef as useRef6,
|
|
941
952
|
useState as useState5
|
|
942
953
|
} from "react";
|
|
943
|
-
import { useContext as
|
|
944
|
-
import { createContext as
|
|
945
|
-
import { useContext as
|
|
954
|
+
import { useContext as useContext14, useMemo as useMemo11 } from "react";
|
|
955
|
+
import { createContext as createContext12 } from "react";
|
|
956
|
+
import { useContext as useContext10, useMemo as useMemo9 } from "react";
|
|
946
957
|
import {
|
|
947
|
-
createContext as
|
|
958
|
+
createContext as createContext13,
|
|
948
959
|
useLayoutEffect,
|
|
949
|
-
useMemo as
|
|
950
|
-
useRef as
|
|
960
|
+
useMemo as useMemo8,
|
|
961
|
+
useRef as useRef3,
|
|
951
962
|
useState as useState2
|
|
952
963
|
} from "react";
|
|
953
|
-
import { createContext as createContext10, useCallback as useCallback2, useContext as useContext6 } from "react";
|
|
954
|
-
import { createContext as createContext9 } from "react";
|
|
955
|
-
import * as React5 from "react";
|
|
956
|
-
import { useContext as useContext5, useState } from "react";
|
|
957
|
-
import React6 from "react";
|
|
958
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
959
|
-
import { useContext as useContext8, useMemo as useMemo7 } from "react";
|
|
960
|
-
import { createContext as createContext13, createRef, useContext as useContext7, useMemo as useMemo6 } from "react";
|
|
961
|
-
import React8, { createContext as createContext12, useCallback as useCallback3, useMemo as useMemo5 } from "react";
|
|
962
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
963
|
-
import { useContext as useContext10 } from "react";
|
|
964
|
-
import { useContext as useContext12 } from "react";
|
|
965
|
-
import { useContext as useContext11, useMemo as useMemo9 } from "react";
|
|
966
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
967
|
-
import React10, { useCallback as useCallback4, useMemo as useMemo11, useRef as useRef3, useState as useState3 } from "react";
|
|
968
964
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
969
|
-
import
|
|
965
|
+
import { useContext as useContext11 } from "react";
|
|
966
|
+
import { useContext as useContext13 } from "react";
|
|
967
|
+
import { useContext as useContext12, useMemo as useMemo10 } from "react";
|
|
970
968
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
971
|
-
import {
|
|
972
|
-
import { createContext as createContext15 } from "react";
|
|
973
|
-
import React12, { forwardRef as forwardRef2, useContext as useContext16, useMemo as useMemo13, useState as useState4 } from "react";
|
|
974
|
-
import { useContext as useContext15, useRef as useRef4 } from "react";
|
|
975
|
-
import { createContext as createContext16 } from "react";
|
|
969
|
+
import React12, { useCallback as useCallback5, useMemo as useMemo12, useRef as useRef4, useState as useState3 } from "react";
|
|
976
970
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
971
|
+
import React13, { createContext as createContext14 } from "react";
|
|
977
972
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
978
|
-
import {
|
|
979
|
-
import
|
|
973
|
+
import { useContext as useContext15, useMemo as useMemo13 } from "react";
|
|
974
|
+
import { createContext as createContext15 } from "react";
|
|
975
|
+
import React14, { forwardRef as forwardRef2, useContext as useContext17, useMemo as useMemo14, useState as useState4 } from "react";
|
|
976
|
+
import { useContext as useContext16, useRef as useRef5 } from "react";
|
|
977
|
+
import { createContext as createContext16 } from "react";
|
|
978
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
979
|
+
import { useCallback as useCallback7, useRef as useRef7 } from "react";
|
|
980
980
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
981
981
|
import {
|
|
982
982
|
forwardRef as forwardRef4,
|
|
@@ -1581,448 +1581,306 @@ var AbsoluteFillElementRefForwarding = (props, ref) => {
|
|
|
1581
1581
|
});
|
|
1582
1582
|
};
|
|
1583
1583
|
var AbsoluteFillElement = forwardRef(AbsoluteFillElementRefForwarding);
|
|
1584
|
-
var
|
|
1585
|
-
|
|
1586
|
-
var stacksByControls = new WeakMap;
|
|
1587
|
-
var REMOTION_INTERNAL_STACK_PROP = "_remotionInternalStack";
|
|
1588
|
-
var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
1589
|
-
var addSequenceStackTraces = (component) => {
|
|
1590
|
-
componentsToAddStacksTo.push(component);
|
|
1584
|
+
var rotate = {
|
|
1585
|
+
transform: `rotate(90deg)`
|
|
1591
1586
|
};
|
|
1592
|
-
var
|
|
1593
|
-
|
|
1587
|
+
var ICON_SIZE = 40;
|
|
1588
|
+
var label = {
|
|
1589
|
+
color: "white",
|
|
1590
|
+
fontSize: 14,
|
|
1591
|
+
fontFamily: "sans-serif"
|
|
1594
1592
|
};
|
|
1595
|
-
var
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
stacksByControls.delete(controls);
|
|
1599
|
-
return;
|
|
1600
|
-
}
|
|
1601
|
-
stacksByControls.set(controls, stack);
|
|
1593
|
+
var container = {
|
|
1594
|
+
justifyContent: "center",
|
|
1595
|
+
alignItems: "center"
|
|
1602
1596
|
};
|
|
1603
|
-
var
|
|
1604
|
-
return
|
|
1597
|
+
var Loading = () => {
|
|
1598
|
+
return /* @__PURE__ */ jsxs2(AbsoluteFillElement, {
|
|
1599
|
+
style: container,
|
|
1600
|
+
id: "remotion-comp-loading",
|
|
1601
|
+
children: [
|
|
1602
|
+
/* @__PURE__ */ jsx5("style", {
|
|
1603
|
+
type: "text/css",
|
|
1604
|
+
children: `
|
|
1605
|
+
@keyframes anim {
|
|
1606
|
+
from {
|
|
1607
|
+
opacity: 0
|
|
1608
|
+
}
|
|
1609
|
+
to {
|
|
1610
|
+
opacity: 1
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
#remotion-comp-loading {
|
|
1614
|
+
animation: anim 2s;
|
|
1615
|
+
animation-fill-mode: forwards;
|
|
1616
|
+
}
|
|
1617
|
+
`
|
|
1618
|
+
}),
|
|
1619
|
+
/* @__PURE__ */ jsx5("svg", {
|
|
1620
|
+
width: ICON_SIZE,
|
|
1621
|
+
height: ICON_SIZE,
|
|
1622
|
+
viewBox: "-100 -100 400 400",
|
|
1623
|
+
style: rotate,
|
|
1624
|
+
children: /* @__PURE__ */ jsx5("path", {
|
|
1625
|
+
fill: "#555",
|
|
1626
|
+
stroke: "#555",
|
|
1627
|
+
strokeWidth: "100",
|
|
1628
|
+
strokeLinejoin: "round",
|
|
1629
|
+
d: "M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z"
|
|
1630
|
+
})
|
|
1631
|
+
}),
|
|
1632
|
+
/* @__PURE__ */ jsxs2("p", {
|
|
1633
|
+
style: label,
|
|
1634
|
+
children: [
|
|
1635
|
+
"Resolving ",
|
|
1636
|
+
"<Suspense>",
|
|
1637
|
+
"..."
|
|
1638
|
+
]
|
|
1639
|
+
})
|
|
1640
|
+
]
|
|
1641
|
+
});
|
|
1605
1642
|
};
|
|
1606
|
-
var
|
|
1607
|
-
|
|
1608
|
-
if (
|
|
1609
|
-
|
|
1643
|
+
var _portalNode = null;
|
|
1644
|
+
var portalNode = () => {
|
|
1645
|
+
if (!_portalNode) {
|
|
1646
|
+
if (typeof document === "undefined") {
|
|
1647
|
+
throw new Error("Tried to call an API that only works in the browser from outside the browser");
|
|
1648
|
+
}
|
|
1649
|
+
_portalNode = document.createElement("div");
|
|
1650
|
+
_portalNode.style.position = "absolute";
|
|
1651
|
+
_portalNode.style.top = "0px";
|
|
1652
|
+
_portalNode.style.left = "0px";
|
|
1653
|
+
_portalNode.style.right = "0px";
|
|
1654
|
+
_portalNode.style.bottom = "0px";
|
|
1655
|
+
_portalNode.style.width = "100%";
|
|
1656
|
+
_portalNode.style.height = "100%";
|
|
1657
|
+
_portalNode.style.display = "flex";
|
|
1658
|
+
_portalNode.style.flexDirection = "column";
|
|
1659
|
+
const containerNode = document.createElement("div");
|
|
1660
|
+
containerNode.style.position = "fixed";
|
|
1661
|
+
containerNode.style.top = -999999 + "px";
|
|
1662
|
+
containerNode.appendChild(_portalNode);
|
|
1663
|
+
document.body.appendChild(containerNode);
|
|
1610
1664
|
}
|
|
1611
|
-
|
|
1612
|
-
|
|
1665
|
+
return _portalNode;
|
|
1666
|
+
};
|
|
1667
|
+
var getKey = () => {
|
|
1668
|
+
return `remotion_inputPropsOverride` + window.location.origin;
|
|
1669
|
+
};
|
|
1670
|
+
var getInputPropsOverride = () => {
|
|
1671
|
+
if (typeof localStorage === "undefined")
|
|
1613
1672
|
return null;
|
|
1614
|
-
|
|
1615
|
-
if (
|
|
1673
|
+
const override = localStorage.getItem(getKey());
|
|
1674
|
+
if (!override)
|
|
1616
1675
|
return null;
|
|
1617
|
-
|
|
1618
|
-
return child.type;
|
|
1676
|
+
return JSON.parse(override);
|
|
1619
1677
|
};
|
|
1620
|
-
var
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1678
|
+
var setInputPropsOverride = (override) => {
|
|
1679
|
+
if (typeof localStorage === "undefined")
|
|
1680
|
+
return;
|
|
1681
|
+
if (override === null) {
|
|
1682
|
+
localStorage.removeItem(getKey());
|
|
1683
|
+
return;
|
|
1626
1684
|
}
|
|
1685
|
+
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
1627
1686
|
};
|
|
1628
|
-
var
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
default: "50% 50%",
|
|
1633
|
-
description: "Transform origin"
|
|
1634
|
-
},
|
|
1635
|
-
"style.translate": {
|
|
1636
|
-
type: "translate",
|
|
1637
|
-
step: 1,
|
|
1638
|
-
default: "0px 0px",
|
|
1639
|
-
description: "Offset"
|
|
1640
|
-
},
|
|
1641
|
-
"style.scale": {
|
|
1642
|
-
type: "scale",
|
|
1643
|
-
max: 100,
|
|
1644
|
-
step: 0.01,
|
|
1645
|
-
default: 1,
|
|
1646
|
-
description: "Scale",
|
|
1647
|
-
defaultKeyframeOutput: "perceptual-scale"
|
|
1648
|
-
},
|
|
1649
|
-
"style.rotate": {
|
|
1650
|
-
type: "rotation-css",
|
|
1651
|
-
step: 1,
|
|
1652
|
-
default: "0deg",
|
|
1653
|
-
description: "Rotation"
|
|
1654
|
-
},
|
|
1655
|
-
"style.opacity": {
|
|
1656
|
-
type: "number",
|
|
1657
|
-
min: 0,
|
|
1658
|
-
max: 1,
|
|
1659
|
-
step: 0.01,
|
|
1660
|
-
default: 1,
|
|
1661
|
-
description: "Opacity",
|
|
1662
|
-
hiddenFromList: false
|
|
1687
|
+
var didWarnSSRImport = false;
|
|
1688
|
+
var warnOnceSSRImport = () => {
|
|
1689
|
+
if (didWarnSSRImport) {
|
|
1690
|
+
return;
|
|
1663
1691
|
}
|
|
1692
|
+
didWarnSSRImport = true;
|
|
1693
|
+
console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.");
|
|
1694
|
+
console.warn("To hide this warning, don't call this function on the server:");
|
|
1695
|
+
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
1664
1696
|
};
|
|
1665
|
-
var
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
default: undefined,
|
|
1670
|
-
description: "Color"
|
|
1671
|
-
},
|
|
1672
|
-
"style.fontFamily": {
|
|
1673
|
-
type: "font-family",
|
|
1674
|
-
default: undefined,
|
|
1675
|
-
description: "Font family",
|
|
1676
|
-
keyframable: false
|
|
1677
|
-
},
|
|
1678
|
-
"style.fontSize": {
|
|
1679
|
-
type: "number",
|
|
1680
|
-
default: undefined,
|
|
1681
|
-
min: 0,
|
|
1682
|
-
step: 1,
|
|
1683
|
-
description: "Font size",
|
|
1684
|
-
hiddenFromList: false
|
|
1685
|
-
},
|
|
1686
|
-
"style.lineHeight": {
|
|
1687
|
-
type: "number",
|
|
1688
|
-
default: undefined,
|
|
1689
|
-
min: 0,
|
|
1690
|
-
step: 0.05,
|
|
1691
|
-
description: "Line height",
|
|
1692
|
-
hiddenFromList: false
|
|
1693
|
-
},
|
|
1694
|
-
"style.fontWeight": {
|
|
1695
|
-
type: "enum",
|
|
1696
|
-
default: "400",
|
|
1697
|
-
description: "Font weight",
|
|
1698
|
-
variants: {
|
|
1699
|
-
"100": {},
|
|
1700
|
-
"200": {},
|
|
1701
|
-
"300": {},
|
|
1702
|
-
"400": {},
|
|
1703
|
-
"500": {},
|
|
1704
|
-
"600": {},
|
|
1705
|
-
"700": {},
|
|
1706
|
-
"800": {},
|
|
1707
|
-
"900": {},
|
|
1708
|
-
normal: {},
|
|
1709
|
-
bold: {}
|
|
1710
|
-
}
|
|
1711
|
-
},
|
|
1712
|
-
"style.fontStyle": {
|
|
1713
|
-
type: "enum",
|
|
1714
|
-
default: "normal",
|
|
1715
|
-
description: "Font style",
|
|
1716
|
-
variants: {
|
|
1717
|
-
normal: {},
|
|
1718
|
-
italic: {},
|
|
1719
|
-
oblique: {}
|
|
1720
|
-
}
|
|
1721
|
-
},
|
|
1722
|
-
"style.textAlign": {
|
|
1723
|
-
type: "enum",
|
|
1724
|
-
default: "left",
|
|
1725
|
-
description: "Text align",
|
|
1726
|
-
variants: {
|
|
1727
|
-
left: {},
|
|
1728
|
-
center: {},
|
|
1729
|
-
right: {},
|
|
1730
|
-
justify: {},
|
|
1731
|
-
start: {},
|
|
1732
|
-
end: {}
|
|
1733
|
-
}
|
|
1734
|
-
},
|
|
1735
|
-
"style.letterSpacing": {
|
|
1736
|
-
type: "number",
|
|
1737
|
-
default: undefined,
|
|
1738
|
-
step: 0.1,
|
|
1739
|
-
description: "Letter spacing",
|
|
1740
|
-
hiddenFromList: false
|
|
1697
|
+
var getInputProps = () => {
|
|
1698
|
+
if (typeof window === "undefined") {
|
|
1699
|
+
warnOnceSSRImport();
|
|
1700
|
+
return {};
|
|
1741
1701
|
}
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
"style.borderWidth": {
|
|
1745
|
-
type: "number",
|
|
1746
|
-
default: undefined,
|
|
1747
|
-
min: 0,
|
|
1748
|
-
step: 1,
|
|
1749
|
-
description: "Border width",
|
|
1750
|
-
hiddenFromList: false
|
|
1751
|
-
},
|
|
1752
|
-
"style.borderStyle": {
|
|
1753
|
-
type: "enum",
|
|
1754
|
-
default: "none",
|
|
1755
|
-
description: "Border style",
|
|
1756
|
-
variants: {
|
|
1757
|
-
none: {},
|
|
1758
|
-
hidden: {},
|
|
1759
|
-
solid: {},
|
|
1760
|
-
dashed: {},
|
|
1761
|
-
dotted: {},
|
|
1762
|
-
double: {},
|
|
1763
|
-
groove: {},
|
|
1764
|
-
ridge: {},
|
|
1765
|
-
inset: {},
|
|
1766
|
-
outset: {}
|
|
1767
|
-
}
|
|
1768
|
-
},
|
|
1769
|
-
"style.borderColor": {
|
|
1770
|
-
type: "color",
|
|
1771
|
-
default: undefined,
|
|
1772
|
-
description: "Border color"
|
|
1702
|
+
if (getRemotionEnvironment().isPlayer) {
|
|
1703
|
+
throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");
|
|
1773
1704
|
}
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
type: "number",
|
|
1778
|
-
default: 0,
|
|
1779
|
-
min: 0,
|
|
1780
|
-
step: 1,
|
|
1781
|
-
description: "Border radius",
|
|
1782
|
-
hiddenFromList: false,
|
|
1783
|
-
keyframable: true
|
|
1784
|
-
},
|
|
1785
|
-
"style.borderTopLeftRadius": {
|
|
1786
|
-
type: "number",
|
|
1787
|
-
default: 0,
|
|
1788
|
-
min: 0,
|
|
1789
|
-
step: 1,
|
|
1790
|
-
description: "Top left radius",
|
|
1791
|
-
hiddenFromList: false
|
|
1792
|
-
},
|
|
1793
|
-
"style.borderTopRightRadius": {
|
|
1794
|
-
type: "number",
|
|
1795
|
-
default: 0,
|
|
1796
|
-
min: 0,
|
|
1797
|
-
step: 1,
|
|
1798
|
-
description: "Top right radius",
|
|
1799
|
-
hiddenFromList: false
|
|
1800
|
-
},
|
|
1801
|
-
"style.borderBottomRightRadius": {
|
|
1802
|
-
type: "number",
|
|
1803
|
-
default: 0,
|
|
1804
|
-
min: 0,
|
|
1805
|
-
step: 1,
|
|
1806
|
-
description: "Bottom right radius",
|
|
1807
|
-
hiddenFromList: false
|
|
1808
|
-
},
|
|
1809
|
-
"style.borderBottomLeftRadius": {
|
|
1810
|
-
type: "number",
|
|
1811
|
-
default: 0,
|
|
1812
|
-
min: 0,
|
|
1813
|
-
step: 1,
|
|
1814
|
-
description: "Bottom left radius",
|
|
1815
|
-
hiddenFromList: false
|
|
1705
|
+
const override = getInputPropsOverride();
|
|
1706
|
+
if (override) {
|
|
1707
|
+
return override;
|
|
1816
1708
|
}
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1709
|
+
if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
|
|
1710
|
+
throw new Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");
|
|
1711
|
+
}
|
|
1712
|
+
const param = window.remotion_inputProps;
|
|
1713
|
+
if (!param) {
|
|
1714
|
+
return {};
|
|
1823
1715
|
}
|
|
1716
|
+
const parsed = deserializeJSONWithSpecialTypes(param);
|
|
1717
|
+
return parsed;
|
|
1824
1718
|
};
|
|
1825
|
-
var
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
description: "Stroke"
|
|
1830
|
-
},
|
|
1831
|
-
strokeWidth: {
|
|
1832
|
-
type: "number",
|
|
1833
|
-
default: 1,
|
|
1834
|
-
description: "Stroke width",
|
|
1835
|
-
min: 0,
|
|
1836
|
-
step: 1,
|
|
1837
|
-
hiddenFromList: false
|
|
1719
|
+
var EditorPropsContext = createContext8({
|
|
1720
|
+
props: {},
|
|
1721
|
+
updateProps: () => {
|
|
1722
|
+
throw new Error("Not implemented");
|
|
1838
1723
|
}
|
|
1724
|
+
});
|
|
1725
|
+
var timeValueRef = React4.createRef();
|
|
1726
|
+
var EditorPropsProvider = ({ children }) => {
|
|
1727
|
+
const [props, setProps] = React4.useState({});
|
|
1728
|
+
const updateProps = useCallback2(({
|
|
1729
|
+
defaultProps,
|
|
1730
|
+
id,
|
|
1731
|
+
newProps
|
|
1732
|
+
}) => {
|
|
1733
|
+
setProps((prev) => {
|
|
1734
|
+
return {
|
|
1735
|
+
...prev,
|
|
1736
|
+
[id]: typeof newProps === "function" ? newProps(prev[id] ?? defaultProps) : newProps
|
|
1737
|
+
};
|
|
1738
|
+
});
|
|
1739
|
+
}, []);
|
|
1740
|
+
const ctx = useMemo4(() => {
|
|
1741
|
+
return { props, updateProps };
|
|
1742
|
+
}, [props, updateProps]);
|
|
1743
|
+
return /* @__PURE__ */ jsx6(EditorPropsContext.Provider, {
|
|
1744
|
+
value: ctx,
|
|
1745
|
+
children
|
|
1746
|
+
});
|
|
1839
1747
|
};
|
|
1840
|
-
var
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
},
|
|
1846
|
-
...svgStrokeSchema
|
|
1748
|
+
var RemotionEnvironmentContext = React5.createContext(null);
|
|
1749
|
+
var useRemotionEnvironment = () => {
|
|
1750
|
+
const context = useContext4(RemotionEnvironmentContext);
|
|
1751
|
+
const [env] = useState(() => getRemotionEnvironment());
|
|
1752
|
+
return context ?? env;
|
|
1847
1753
|
};
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
default: "",
|
|
1852
|
-
description: "Text",
|
|
1853
|
-
keyframable: false
|
|
1754
|
+
function validateDimension(amount, nameOfProp, location) {
|
|
1755
|
+
if (typeof amount !== "number") {
|
|
1756
|
+
throw new Error(`The "${nameOfProp}" prop ${location} must be a number, but you passed a value of type ${typeof amount}`);
|
|
1854
1757
|
}
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
premountFor: {
|
|
1858
|
-
type: "number",
|
|
1859
|
-
default: 0,
|
|
1860
|
-
description: "Premount For",
|
|
1861
|
-
min: 0,
|
|
1862
|
-
step: 1,
|
|
1863
|
-
hiddenFromList: false,
|
|
1864
|
-
keyframable: false
|
|
1865
|
-
},
|
|
1866
|
-
postmountFor: {
|
|
1867
|
-
type: "number",
|
|
1868
|
-
default: 0,
|
|
1869
|
-
min: 0,
|
|
1870
|
-
step: 1,
|
|
1871
|
-
hiddenFromList: true,
|
|
1872
|
-
keyframable: false
|
|
1758
|
+
if (isNaN(amount)) {
|
|
1759
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must not be NaN, but is NaN.`);
|
|
1873
1760
|
}
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
}
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
max: 1,
|
|
1915
|
-
step: 0.01,
|
|
1916
|
-
hiddenFromList: false,
|
|
1917
|
-
keyframable: true
|
|
1761
|
+
if (!Number.isFinite(amount)) {
|
|
1762
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be finite, but is ${amount}.`);
|
|
1763
|
+
}
|
|
1764
|
+
if (amount % 1 !== 0) {
|
|
1765
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be an integer, but is ${amount}.`);
|
|
1766
|
+
}
|
|
1767
|
+
if (amount <= 0) {
|
|
1768
|
+
throw new TypeError(`The "${nameOfProp}" prop ${location} must be positive, but got ${amount}.`);
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
function validateDurationInFrames(durationInFrames, options) {
|
|
1772
|
+
const { allowFloats, component } = options;
|
|
1773
|
+
if (typeof durationInFrames === "undefined") {
|
|
1774
|
+
throw new Error(`The "durationInFrames" prop ${component} is missing.`);
|
|
1775
|
+
}
|
|
1776
|
+
if (typeof durationInFrames !== "number") {
|
|
1777
|
+
throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
|
|
1778
|
+
}
|
|
1779
|
+
if (durationInFrames <= 0) {
|
|
1780
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
1781
|
+
}
|
|
1782
|
+
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
1783
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
1784
|
+
}
|
|
1785
|
+
if (!Number.isFinite(durationInFrames)) {
|
|
1786
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
function validateFps(fps, location, isGif) {
|
|
1790
|
+
if (typeof fps !== "number") {
|
|
1791
|
+
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
1792
|
+
}
|
|
1793
|
+
if (!Number.isFinite(fps)) {
|
|
1794
|
+
throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
|
|
1795
|
+
}
|
|
1796
|
+
if (isNaN(fps)) {
|
|
1797
|
+
throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
|
|
1798
|
+
}
|
|
1799
|
+
if (fps <= 0) {
|
|
1800
|
+
throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
|
|
1918
1801
|
}
|
|
1802
|
+
if (isGif && fps > 50) {
|
|
1803
|
+
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`);
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
var ResolveCompositionContext = createContext9(null);
|
|
1807
|
+
var resolveCompositionsRef = createRef();
|
|
1808
|
+
var needsResolution = (composition) => {
|
|
1809
|
+
return Boolean(composition.calculateMetadata);
|
|
1919
1810
|
};
|
|
1920
|
-
var
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
};
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
var showInTimelineField = {
|
|
1935
|
-
type: "hidden"
|
|
1936
|
-
};
|
|
1937
|
-
var sequenceNameField = {
|
|
1938
|
-
type: "hidden"
|
|
1939
|
-
};
|
|
1940
|
-
var extendSchemaWithSequenceName = (schema) => {
|
|
1941
|
-
return {
|
|
1942
|
-
name: sequenceNameField,
|
|
1943
|
-
...schema
|
|
1944
|
-
};
|
|
1945
|
-
};
|
|
1946
|
-
var durationInFramesField = {
|
|
1947
|
-
type: "number",
|
|
1948
|
-
default: undefined,
|
|
1949
|
-
min: 1,
|
|
1950
|
-
step: 1,
|
|
1951
|
-
hiddenFromList: true
|
|
1952
|
-
};
|
|
1953
|
-
var fromField = {
|
|
1954
|
-
type: "number",
|
|
1955
|
-
default: 0,
|
|
1956
|
-
step: 1,
|
|
1957
|
-
hiddenFromList: true
|
|
1958
|
-
};
|
|
1959
|
-
var trimBeforeField = {
|
|
1960
|
-
type: "number",
|
|
1961
|
-
default: 0,
|
|
1962
|
-
min: 0,
|
|
1963
|
-
step: 1,
|
|
1964
|
-
hiddenFromList: true
|
|
1965
|
-
};
|
|
1966
|
-
var freezeField = {
|
|
1967
|
-
type: "number",
|
|
1968
|
-
default: null,
|
|
1969
|
-
step: 1,
|
|
1970
|
-
hiddenFromList: true
|
|
1971
|
-
};
|
|
1972
|
-
var baseSchema = {
|
|
1973
|
-
durationInFrames: durationInFramesField,
|
|
1974
|
-
from: fromField,
|
|
1975
|
-
trimBefore: trimBeforeField,
|
|
1976
|
-
freeze: freezeField,
|
|
1977
|
-
hidden: hiddenField,
|
|
1978
|
-
name: sequenceNameField,
|
|
1979
|
-
showInTimeline: showInTimelineField
|
|
1980
|
-
};
|
|
1981
|
-
var sequenceSchema = {
|
|
1982
|
-
...baseSchema,
|
|
1983
|
-
layout: {
|
|
1984
|
-
type: "enum",
|
|
1985
|
-
default: "absolute-fill",
|
|
1986
|
-
description: "Layout",
|
|
1987
|
-
variants: {
|
|
1988
|
-
"absolute-fill": sequenceStyleSchema,
|
|
1989
|
-
none: {}
|
|
1811
|
+
var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
1812
|
+
const context = useContext5(ResolveCompositionContext);
|
|
1813
|
+
const { props: allEditorProps } = useContext5(EditorPropsContext);
|
|
1814
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext5(CompositionManager);
|
|
1815
|
+
const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
1816
|
+
const compositionId = preferredCompositionId ?? currentComposition;
|
|
1817
|
+
const composition = compositions.find((c) => c.id === compositionId);
|
|
1818
|
+
const selectedEditorProps = useMemo5(() => {
|
|
1819
|
+
return composition ? allEditorProps[composition.id] ?? {} : {};
|
|
1820
|
+
}, [allEditorProps, composition]);
|
|
1821
|
+
const env = useRemotionEnvironment();
|
|
1822
|
+
return useMemo5(() => {
|
|
1823
|
+
if (!composition) {
|
|
1824
|
+
return null;
|
|
1990
1825
|
}
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
};
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
1826
|
+
if (currentCompositionMetadata) {
|
|
1827
|
+
return {
|
|
1828
|
+
type: "success",
|
|
1829
|
+
metadataSource: null,
|
|
1830
|
+
result: {
|
|
1831
|
+
...currentCompositionMetadata,
|
|
1832
|
+
id: composition.id,
|
|
1833
|
+
defaultProps: composition.defaultProps ?? {}
|
|
1834
|
+
}
|
|
1835
|
+
};
|
|
1836
|
+
}
|
|
1837
|
+
if (!needsResolution(composition)) {
|
|
1838
|
+
validateDurationInFrames(composition.durationInFrames, {
|
|
1839
|
+
allowFloats: false,
|
|
1840
|
+
component: `in <Composition id="${composition.id}">`
|
|
1841
|
+
});
|
|
1842
|
+
validateFps(composition.fps, `in <Composition id="${composition.id}">`, false);
|
|
1843
|
+
validateDimension(composition.width, "width", `in <Composition id="${composition.id}">`);
|
|
1844
|
+
validateDimension(composition.height, "height", `in <Composition id="${composition.id}">`);
|
|
1845
|
+
return {
|
|
1846
|
+
type: "success",
|
|
1847
|
+
metadataSource: null,
|
|
1848
|
+
result: {
|
|
1849
|
+
width: composition.width,
|
|
1850
|
+
height: composition.height,
|
|
1851
|
+
fps: composition.fps,
|
|
1852
|
+
id: composition.id,
|
|
1853
|
+
durationInFrames: composition.durationInFrames,
|
|
1854
|
+
defaultProps: composition.defaultProps ?? {},
|
|
1855
|
+
props: {
|
|
1856
|
+
...composition.defaultProps ?? {},
|
|
1857
|
+
...selectedEditorProps ?? {},
|
|
1858
|
+
...typeof window === "undefined" || env.isPlayer || !window.remotion_inputProps ? {} : getInputProps() ?? {}
|
|
1859
|
+
},
|
|
1860
|
+
defaultCodec: null,
|
|
1861
|
+
defaultOutName: null,
|
|
1862
|
+
defaultVideoImageFormat: null,
|
|
1863
|
+
defaultPixelFormat: null,
|
|
1864
|
+
defaultProResProfile: null,
|
|
1865
|
+
defaultSampleRate: null
|
|
1866
|
+
}
|
|
1867
|
+
};
|
|
1868
|
+
}
|
|
1869
|
+
if (!context) {
|
|
1870
|
+
return null;
|
|
1871
|
+
}
|
|
1872
|
+
if (!context[composition.id]) {
|
|
1873
|
+
return null;
|
|
1874
|
+
}
|
|
1875
|
+
return context[composition.id];
|
|
1876
|
+
}, [
|
|
1877
|
+
composition,
|
|
1878
|
+
context,
|
|
1879
|
+
currentCompositionMetadata,
|
|
1880
|
+
selectedEditorProps,
|
|
1881
|
+
env.isPlayer
|
|
1882
|
+
]);
|
|
2011
1883
|
};
|
|
2012
|
-
var SequenceContext = createContext8(null);
|
|
2013
|
-
var exports_timeline_position_state = {};
|
|
2014
|
-
__export2(exports_timeline_position_state, {
|
|
2015
|
-
useTimelineSetFrame: () => useTimelineSetFrame,
|
|
2016
|
-
useTimelinePosition: () => useTimelinePosition,
|
|
2017
|
-
useTimelineContext: () => useTimelineContext,
|
|
2018
|
-
usePlayingState: () => usePlayingState,
|
|
2019
|
-
usePlaybackRate: () => usePlaybackRate,
|
|
2020
|
-
useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
|
|
2021
|
-
persistCurrentFrame: () => persistCurrentFrame,
|
|
2022
|
-
getInitialFrameState: () => getInitialFrameState,
|
|
2023
|
-
getFrameForComposition: () => getFrameForComposition,
|
|
2024
|
-
clampFrameToCompositionRange: () => clampFrameToCompositionRange
|
|
2025
|
-
});
|
|
2026
1884
|
var getErrorStackWithMessage = (error) => {
|
|
2027
1885
|
const stack = error.stack ?? "";
|
|
2028
1886
|
return stack.startsWith("Error:") ? stack : `${error.message}
|
|
@@ -2138,11 +1996,11 @@ var defaultTimeout = 30000;
|
|
|
2138
1996
|
var delayRenderInternal = ({
|
|
2139
1997
|
scope,
|
|
2140
1998
|
environment,
|
|
2141
|
-
label,
|
|
1999
|
+
label: label2,
|
|
2142
2000
|
options
|
|
2143
2001
|
}) => {
|
|
2144
|
-
if (typeof
|
|
2145
|
-
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(
|
|
2002
|
+
if (typeof label2 !== "string" && label2 !== null) {
|
|
2003
|
+
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label2));
|
|
2146
2004
|
}
|
|
2147
2005
|
const handle = Math.random();
|
|
2148
2006
|
scope.remotion_delayRenderHandles.push(handle);
|
|
@@ -2151,12 +2009,12 @@ var delayRenderInternal = ({
|
|
|
2151
2009
|
const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
|
|
2152
2010
|
const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
|
|
2153
2011
|
scope.remotion_delayRenderTimeouts[handle] = {
|
|
2154
|
-
label:
|
|
2012
|
+
label: label2 ?? null,
|
|
2155
2013
|
startTime: Date.now(),
|
|
2156
2014
|
timeout: setTimeout(() => {
|
|
2157
2015
|
const message = [
|
|
2158
2016
|
`A delayRender()`,
|
|
2159
|
-
|
|
2017
|
+
label2 ? `"${label2}"` : null,
|
|
2160
2018
|
`was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
|
|
2161
2019
|
retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
|
|
2162
2020
|
retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
|
|
@@ -2189,10 +2047,10 @@ var continueRenderInternal = ({
|
|
|
2189
2047
|
const handleExists = scope.remotion_delayRenderHandles.includes(handle);
|
|
2190
2048
|
const timeoutEntry = scope.remotion_delayRenderTimeouts[handle];
|
|
2191
2049
|
if (handleExists && environment.isRendering && timeoutEntry) {
|
|
2192
|
-
const { label, startTime, timeout } = timeoutEntry;
|
|
2050
|
+
const { label: label2, startTime, timeout } = timeoutEntry;
|
|
2193
2051
|
clearTimeout(timeout);
|
|
2194
2052
|
const message = [
|
|
2195
|
-
|
|
2053
|
+
label2 ? `"${label2}"` : "A handle",
|
|
2196
2054
|
DELAY_RENDER_CLEAR_TOKEN,
|
|
2197
2055
|
`${Date.now() - startTime}ms`
|
|
2198
2056
|
].filter(truthy).join(" ");
|
|
@@ -2204,47 +2062,41 @@ var continueRenderInternal = ({
|
|
|
2204
2062
|
scope.remotion_renderReady = true;
|
|
2205
2063
|
}
|
|
2206
2064
|
};
|
|
2207
|
-
var LogLevelContext =
|
|
2065
|
+
var LogLevelContext = createContext10({
|
|
2208
2066
|
logLevel: "info",
|
|
2209
2067
|
mountTime: 0
|
|
2210
2068
|
});
|
|
2211
2069
|
var useLogLevel = () => {
|
|
2212
|
-
const { logLevel } =
|
|
2070
|
+
const { logLevel } = React6.useContext(LogLevelContext);
|
|
2213
2071
|
if (logLevel === null) {
|
|
2214
2072
|
throw new Error("useLogLevel must be used within a LogLevelProvider");
|
|
2215
2073
|
}
|
|
2216
2074
|
return logLevel;
|
|
2217
2075
|
};
|
|
2218
2076
|
var useMountTime = () => {
|
|
2219
|
-
const { mountTime } =
|
|
2077
|
+
const { mountTime } = React6.useContext(LogLevelContext);
|
|
2220
2078
|
if (mountTime === null) {
|
|
2221
2079
|
throw new Error("useMountTime must be used within a LogLevelProvider");
|
|
2222
2080
|
}
|
|
2223
2081
|
return mountTime;
|
|
2224
2082
|
};
|
|
2225
|
-
var
|
|
2226
|
-
var useRemotionEnvironment = () => {
|
|
2227
|
-
const context = useContext5(RemotionEnvironmentContext);
|
|
2228
|
-
const [env] = useState(() => getRemotionEnvironment());
|
|
2229
|
-
return context ?? env;
|
|
2230
|
-
};
|
|
2231
|
-
var DelayRenderContextType = createContext10(null);
|
|
2083
|
+
var DelayRenderContextType = createContext11(null);
|
|
2232
2084
|
var useDelayRender = () => {
|
|
2233
2085
|
const environment = useRemotionEnvironment();
|
|
2234
|
-
const scope =
|
|
2086
|
+
const scope = useContext7(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
|
|
2235
2087
|
const logLevel = useLogLevel();
|
|
2236
|
-
const delayRender2 =
|
|
2088
|
+
const delayRender2 = useCallback3((label2, options) => {
|
|
2237
2089
|
if (!scope) {
|
|
2238
2090
|
return Math.random();
|
|
2239
2091
|
}
|
|
2240
2092
|
return delayRenderInternal({
|
|
2241
2093
|
scope,
|
|
2242
2094
|
environment,
|
|
2243
|
-
label:
|
|
2095
|
+
label: label2 ?? null,
|
|
2244
2096
|
options: options ?? {}
|
|
2245
2097
|
});
|
|
2246
2098
|
}, [environment, scope]);
|
|
2247
|
-
const continueRender2 =
|
|
2099
|
+
const continueRender2 = useCallback3((handle) => {
|
|
2248
2100
|
if (!scope) {
|
|
2249
2101
|
return;
|
|
2250
2102
|
}
|
|
@@ -2255,12 +2107,306 @@ var useDelayRender = () => {
|
|
|
2255
2107
|
logLevel
|
|
2256
2108
|
});
|
|
2257
2109
|
}, [environment, logLevel, scope]);
|
|
2258
|
-
const cancelRender2 =
|
|
2110
|
+
const cancelRender2 = useCallback3((err) => {
|
|
2259
2111
|
return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
|
|
2260
2112
|
}, [scope]);
|
|
2261
2113
|
return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
|
|
2262
2114
|
};
|
|
2263
|
-
var
|
|
2115
|
+
var useLazyComponent = ({
|
|
2116
|
+
compProps,
|
|
2117
|
+
componentName,
|
|
2118
|
+
noSuspense
|
|
2119
|
+
}) => {
|
|
2120
|
+
const componentRef = useRef2(null);
|
|
2121
|
+
if ("component" in compProps) {
|
|
2122
|
+
componentRef.current = compProps.component;
|
|
2123
|
+
}
|
|
2124
|
+
const lazy = useMemo6(() => {
|
|
2125
|
+
if ("component" in compProps) {
|
|
2126
|
+
if (typeof document === "undefined" || noSuspense) {
|
|
2127
|
+
return compProps.component;
|
|
2128
|
+
}
|
|
2129
|
+
if (typeof compProps.component === "undefined") {
|
|
2130
|
+
throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
2131
|
+
}
|
|
2132
|
+
const Wrapper = (props) => {
|
|
2133
|
+
const Comp = componentRef.current;
|
|
2134
|
+
return React7.createElement(Comp, props);
|
|
2135
|
+
};
|
|
2136
|
+
return Wrapper;
|
|
2137
|
+
}
|
|
2138
|
+
if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
|
|
2139
|
+
if (typeof compProps.lazyComponent === "undefined") {
|
|
2140
|
+
throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
2141
|
+
}
|
|
2142
|
+
return React7.lazy(compProps.lazyComponent);
|
|
2143
|
+
}
|
|
2144
|
+
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
2145
|
+
}, [compProps.lazyComponent]);
|
|
2146
|
+
return lazy;
|
|
2147
|
+
};
|
|
2148
|
+
var useVideo = () => {
|
|
2149
|
+
const { canvasContent, compositions, currentCompositionMetadata } = useContext8(CompositionManager);
|
|
2150
|
+
const selected = compositions.find((c) => {
|
|
2151
|
+
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
2152
|
+
});
|
|
2153
|
+
const resolved = useResolvedVideoConfig(selected?.id ?? null);
|
|
2154
|
+
return useMemo7(() => {
|
|
2155
|
+
if (!resolved) {
|
|
2156
|
+
return null;
|
|
2157
|
+
}
|
|
2158
|
+
if (resolved.type === "error") {
|
|
2159
|
+
return null;
|
|
2160
|
+
}
|
|
2161
|
+
if (resolved.type === "loading") {
|
|
2162
|
+
return null;
|
|
2163
|
+
}
|
|
2164
|
+
if (!selected) {
|
|
2165
|
+
return null;
|
|
2166
|
+
}
|
|
2167
|
+
return {
|
|
2168
|
+
...resolved.result,
|
|
2169
|
+
defaultProps: selected.defaultProps ?? {},
|
|
2170
|
+
id: selected.id,
|
|
2171
|
+
...currentCompositionMetadata ?? {},
|
|
2172
|
+
component: selected.component
|
|
2173
|
+
};
|
|
2174
|
+
}, [currentCompositionMetadata, resolved, selected]);
|
|
2175
|
+
};
|
|
2176
|
+
var getRegex2 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
2177
|
+
var isCompositionIdValid = (id) => id.match(getRegex2());
|
|
2178
|
+
var validateCompositionId = (id) => {
|
|
2179
|
+
if (!isCompositionIdValid(id)) {
|
|
2180
|
+
throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`);
|
|
2181
|
+
}
|
|
2182
|
+
};
|
|
2183
|
+
var invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex2())}`;
|
|
2184
|
+
var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
2185
|
+
if (!defaultProps) {
|
|
2186
|
+
return;
|
|
2187
|
+
}
|
|
2188
|
+
if (typeof defaultProps !== "object") {
|
|
2189
|
+
throw new Error(`"${name}" must be an object, but you passed a value of type ${typeof defaultProps}`);
|
|
2190
|
+
}
|
|
2191
|
+
if (Array.isArray(defaultProps)) {
|
|
2192
|
+
throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
|
|
2193
|
+
}
|
|
2194
|
+
};
|
|
2195
|
+
var Fallback = () => {
|
|
2196
|
+
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
2197
|
+
useEffect2(() => {
|
|
2198
|
+
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
2199
|
+
return () => continueRender2(fallback);
|
|
2200
|
+
}, [continueRender2, delayRender2]);
|
|
2201
|
+
return null;
|
|
2202
|
+
};
|
|
2203
|
+
var InnerComposition = ({
|
|
2204
|
+
width,
|
|
2205
|
+
height,
|
|
2206
|
+
fps,
|
|
2207
|
+
durationInFrames,
|
|
2208
|
+
id,
|
|
2209
|
+
defaultProps,
|
|
2210
|
+
schema,
|
|
2211
|
+
...compProps
|
|
2212
|
+
}) => {
|
|
2213
|
+
const compManager = useContext9(CompositionSetters);
|
|
2214
|
+
const { registerComposition, unregisterComposition } = compManager;
|
|
2215
|
+
const video = useVideo();
|
|
2216
|
+
const lazy = useLazyComponent({
|
|
2217
|
+
compProps,
|
|
2218
|
+
componentName: "Composition",
|
|
2219
|
+
noSuspense: false
|
|
2220
|
+
});
|
|
2221
|
+
const nonce = useNonce();
|
|
2222
|
+
const isPlayer = useIsPlayer();
|
|
2223
|
+
const environment = useRemotionEnvironment();
|
|
2224
|
+
const canUseComposition = useContext9(CanUseRemotionHooks);
|
|
2225
|
+
if (typeof window !== "undefined") {
|
|
2226
|
+
window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
|
|
2227
|
+
}
|
|
2228
|
+
if (canUseComposition) {
|
|
2229
|
+
if (isPlayer) {
|
|
2230
|
+
throw new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
2231
|
+
}
|
|
2232
|
+
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
2233
|
+
}
|
|
2234
|
+
const { folderName, parentName } = useContext9(FolderContext);
|
|
2235
|
+
const stack = compProps._remotionInternalStack ?? null;
|
|
2236
|
+
const componentFromProps = "component" in compProps ? compProps.component : null;
|
|
2237
|
+
useEffect2(() => {
|
|
2238
|
+
if (!id) {
|
|
2239
|
+
throw new Error("No id for composition passed.");
|
|
2240
|
+
}
|
|
2241
|
+
validateCompositionId(id);
|
|
2242
|
+
validateDefaultAndInputProps(defaultProps, "defaultProps", id);
|
|
2243
|
+
registerComposition({
|
|
2244
|
+
durationInFrames: durationInFrames ?? undefined,
|
|
2245
|
+
fps: fps ?? undefined,
|
|
2246
|
+
height: height ?? undefined,
|
|
2247
|
+
width: width ?? undefined,
|
|
2248
|
+
id,
|
|
2249
|
+
folderName,
|
|
2250
|
+
component: lazy,
|
|
2251
|
+
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
2252
|
+
nonce: nonce.get(),
|
|
2253
|
+
parentFolderName: parentName,
|
|
2254
|
+
componentFromProps,
|
|
2255
|
+
schema: schema ?? null,
|
|
2256
|
+
calculateMetadata: compProps.calculateMetadata ?? null,
|
|
2257
|
+
stack
|
|
2258
|
+
});
|
|
2259
|
+
return () => {
|
|
2260
|
+
unregisterComposition(id);
|
|
2261
|
+
};
|
|
2262
|
+
}, [
|
|
2263
|
+
durationInFrames,
|
|
2264
|
+
fps,
|
|
2265
|
+
height,
|
|
2266
|
+
lazy,
|
|
2267
|
+
id,
|
|
2268
|
+
folderName,
|
|
2269
|
+
defaultProps,
|
|
2270
|
+
width,
|
|
2271
|
+
nonce,
|
|
2272
|
+
parentName,
|
|
2273
|
+
componentFromProps,
|
|
2274
|
+
schema,
|
|
2275
|
+
compProps.calculateMetadata,
|
|
2276
|
+
stack,
|
|
2277
|
+
registerComposition,
|
|
2278
|
+
unregisterComposition
|
|
2279
|
+
]);
|
|
2280
|
+
const resolved = useResolvedVideoConfig(id);
|
|
2281
|
+
const { setError, clearError } = useContext9(CompositionRenderErrorContext);
|
|
2282
|
+
const onError = useCallback4((error2) => {
|
|
2283
|
+
setError(error2);
|
|
2284
|
+
}, [setError]);
|
|
2285
|
+
const onClear = useCallback4(() => {
|
|
2286
|
+
clearError();
|
|
2287
|
+
}, [clearError]);
|
|
2288
|
+
if (environment.isStudio && video && video.component === lazy && video.id === id) {
|
|
2289
|
+
const Comp = lazy;
|
|
2290
|
+
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
2291
|
+
return null;
|
|
2292
|
+
}
|
|
2293
|
+
return createPortal(/* @__PURE__ */ jsx7(CanUseRemotionHooksProvider, {
|
|
2294
|
+
children: /* @__PURE__ */ jsx7(CompositionErrorBoundary, {
|
|
2295
|
+
onError,
|
|
2296
|
+
onClear,
|
|
2297
|
+
children: /* @__PURE__ */ jsx7(Suspense, {
|
|
2298
|
+
fallback: /* @__PURE__ */ jsx7(Loading, {}),
|
|
2299
|
+
children: /* @__PURE__ */ jsx7(Comp, {
|
|
2300
|
+
...resolved.result.props ?? {}
|
|
2301
|
+
})
|
|
2302
|
+
})
|
|
2303
|
+
})
|
|
2304
|
+
}), portalNode());
|
|
2305
|
+
}
|
|
2306
|
+
if (environment.isRendering && video && video.component === lazy && video.id === id) {
|
|
2307
|
+
const Comp = lazy;
|
|
2308
|
+
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
2309
|
+
return null;
|
|
2310
|
+
}
|
|
2311
|
+
return createPortal(/* @__PURE__ */ jsx7(CanUseRemotionHooksProvider, {
|
|
2312
|
+
children: /* @__PURE__ */ jsx7(Suspense, {
|
|
2313
|
+
fallback: /* @__PURE__ */ jsx7(Fallback, {}),
|
|
2314
|
+
children: /* @__PURE__ */ jsx7(Comp, {
|
|
2315
|
+
...resolved.result.props ?? {}
|
|
2316
|
+
})
|
|
2317
|
+
})
|
|
2318
|
+
}), portalNode());
|
|
2319
|
+
}
|
|
2320
|
+
return null;
|
|
2321
|
+
};
|
|
2322
|
+
var Composition = (props) => {
|
|
2323
|
+
const { onlyRenderComposition } = useContext9(CompositionSetters);
|
|
2324
|
+
if (onlyRenderComposition && onlyRenderComposition !== props.id) {
|
|
2325
|
+
return null;
|
|
2326
|
+
}
|
|
2327
|
+
return /* @__PURE__ */ jsx7(InnerComposition, {
|
|
2328
|
+
...props
|
|
2329
|
+
});
|
|
2330
|
+
};
|
|
2331
|
+
var componentsToAddStacksTo = [];
|
|
2332
|
+
var sequenceComponent = null;
|
|
2333
|
+
var stacksByControls = new WeakMap;
|
|
2334
|
+
var REMOTION_INTERNAL_STACK_PROP = "_remotionInternalStack";
|
|
2335
|
+
var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
2336
|
+
var addSequenceStackTraces = (component) => {
|
|
2337
|
+
componentsToAddStacksTo.push(component);
|
|
2338
|
+
};
|
|
2339
|
+
var setSequenceComponent = (component) => {
|
|
2340
|
+
sequenceComponent = component;
|
|
2341
|
+
};
|
|
2342
|
+
var getSequenceComponent = () => sequenceComponent;
|
|
2343
|
+
var setStackForControls = (controls, stack) => {
|
|
2344
|
+
if (stack === undefined) {
|
|
2345
|
+
stacksByControls.delete(controls);
|
|
2346
|
+
return;
|
|
2347
|
+
}
|
|
2348
|
+
stacksByControls.set(controls, stack);
|
|
2349
|
+
};
|
|
2350
|
+
var getStackForControls = (controls) => {
|
|
2351
|
+
return stacksByControls.get(controls) ?? null;
|
|
2352
|
+
};
|
|
2353
|
+
var getSingleChildComponent = (children) => {
|
|
2354
|
+
const mountedChildren = React9.Children.toArray(children);
|
|
2355
|
+
if (mountedChildren.length !== 1) {
|
|
2356
|
+
return null;
|
|
2357
|
+
}
|
|
2358
|
+
const child = mountedChildren[0];
|
|
2359
|
+
if (!React9.isValidElement(child)) {
|
|
2360
|
+
return null;
|
|
2361
|
+
}
|
|
2362
|
+
if (typeof child.type !== "function" && typeof child.type !== "object") {
|
|
2363
|
+
return null;
|
|
2364
|
+
}
|
|
2365
|
+
return child.type;
|
|
2366
|
+
};
|
|
2367
|
+
var VERSION = "4.0.503";
|
|
2368
|
+
var checkMultipleRemotionVersions = () => {
|
|
2369
|
+
if (typeof globalThis === "undefined") {
|
|
2370
|
+
return;
|
|
2371
|
+
}
|
|
2372
|
+
const set = () => {
|
|
2373
|
+
globalThis.remotion_imported = VERSION;
|
|
2374
|
+
if (typeof window !== "undefined") {
|
|
2375
|
+
window.remotion_imported = VERSION;
|
|
2376
|
+
}
|
|
2377
|
+
};
|
|
2378
|
+
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
2379
|
+
if (alreadyImported) {
|
|
2380
|
+
if (alreadyImported === VERSION) {
|
|
2381
|
+
return;
|
|
2382
|
+
}
|
|
2383
|
+
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
2384
|
+
set();
|
|
2385
|
+
return;
|
|
2386
|
+
}
|
|
2387
|
+
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
2388
|
+
VERSION,
|
|
2389
|
+
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
2390
|
+
].filter(truthy).join(" and ")}. This will cause things to break in an unexpected way.
|
|
2391
|
+
Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
|
|
2392
|
+
}
|
|
2393
|
+
set();
|
|
2394
|
+
};
|
|
2395
|
+
var SequenceContext = createContext12(null);
|
|
2396
|
+
var exports_timeline_position_state = {};
|
|
2397
|
+
__export2(exports_timeline_position_state, {
|
|
2398
|
+
useTimelineSetFrame: () => useTimelineSetFrame,
|
|
2399
|
+
useTimelinePosition: () => useTimelinePosition,
|
|
2400
|
+
useTimelineContext: () => useTimelineContext,
|
|
2401
|
+
usePlayingState: () => usePlayingState,
|
|
2402
|
+
usePlaybackRate: () => usePlaybackRate,
|
|
2403
|
+
useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
|
|
2404
|
+
persistCurrentFrame: () => persistCurrentFrame,
|
|
2405
|
+
getInitialFrameState: () => getInitialFrameState,
|
|
2406
|
+
getFrameForComposition: () => getFrameForComposition,
|
|
2407
|
+
clampFrameToCompositionRange: () => clampFrameToCompositionRange
|
|
2408
|
+
});
|
|
2409
|
+
var SetTimelineContext = createContext13({
|
|
2264
2410
|
setFrame: () => {
|
|
2265
2411
|
throw new Error("default");
|
|
2266
2412
|
},
|
|
@@ -2268,14 +2414,14 @@ var SetTimelineContext = createContext11({
|
|
|
2268
2414
|
throw new Error("default");
|
|
2269
2415
|
}
|
|
2270
2416
|
});
|
|
2271
|
-
var TimelineContext =
|
|
2272
|
-
var PlaybackRateContext =
|
|
2273
|
-
var AbsoluteTimeContext =
|
|
2417
|
+
var TimelineContext = createContext13(null);
|
|
2418
|
+
var PlaybackRateContext = createContext13(null);
|
|
2419
|
+
var AbsoluteTimeContext = createContext13(null);
|
|
2274
2420
|
var TimelineContextProvider = ({ children, frameState }) => {
|
|
2275
2421
|
const [playing, setPlaying] = useState2(false);
|
|
2276
|
-
const imperativePlaying =
|
|
2422
|
+
const imperativePlaying = useRef3(false);
|
|
2277
2423
|
const [playbackRate, setPlaybackRate] = useState2(1);
|
|
2278
|
-
const audioAndVideoTags =
|
|
2424
|
+
const audioAndVideoTags = useRef3([]);
|
|
2279
2425
|
const [_frame, setFrame] = useState2(() => getInitialFrameState());
|
|
2280
2426
|
const frame = frameState ?? _frame;
|
|
2281
2427
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
@@ -2305,7 +2451,7 @@ var TimelineContextProvider = ({ children, frameState }) => {
|
|
|
2305
2451
|
window.remotion_isPlayer = false;
|
|
2306
2452
|
}, [continueRender2, delayRender2]);
|
|
2307
2453
|
}
|
|
2308
|
-
const timelineContextValue =
|
|
2454
|
+
const timelineContextValue = useMemo8(() => {
|
|
2309
2455
|
return {
|
|
2310
2456
|
frame,
|
|
2311
2457
|
playing,
|
|
@@ -2313,25 +2459,25 @@ var TimelineContextProvider = ({ children, frameState }) => {
|
|
|
2313
2459
|
audioAndVideoTags
|
|
2314
2460
|
};
|
|
2315
2461
|
}, [frame, playing]);
|
|
2316
|
-
const playbackRateContextValue =
|
|
2462
|
+
const playbackRateContextValue = useMemo8(() => {
|
|
2317
2463
|
return {
|
|
2318
2464
|
playbackRate,
|
|
2319
2465
|
setPlaybackRate
|
|
2320
2466
|
};
|
|
2321
2467
|
}, [playbackRate]);
|
|
2322
|
-
const setTimelineContextValue =
|
|
2468
|
+
const setTimelineContextValue = useMemo8(() => {
|
|
2323
2469
|
return {
|
|
2324
2470
|
setFrame,
|
|
2325
2471
|
setPlaying
|
|
2326
2472
|
};
|
|
2327
2473
|
}, []);
|
|
2328
|
-
return /* @__PURE__ */
|
|
2474
|
+
return /* @__PURE__ */ jsx8(AbsoluteTimeContext.Provider, {
|
|
2329
2475
|
value: timelineContextValue,
|
|
2330
|
-
children: /* @__PURE__ */
|
|
2476
|
+
children: /* @__PURE__ */ jsx8(PlaybackRateContext.Provider, {
|
|
2331
2477
|
value: playbackRateContextValue,
|
|
2332
|
-
children: /* @__PURE__ */
|
|
2478
|
+
children: /* @__PURE__ */ jsx8(TimelineContext.Provider, {
|
|
2333
2479
|
value: timelineContextValue,
|
|
2334
|
-
children: /* @__PURE__ */
|
|
2480
|
+
children: /* @__PURE__ */ jsx8(SetTimelineContext.Provider, {
|
|
2335
2481
|
value: setTimelineContextValue,
|
|
2336
2482
|
children
|
|
2337
2483
|
})
|
|
@@ -2339,245 +2485,6 @@ var TimelineContextProvider = ({ children, frameState }) => {
|
|
|
2339
2485
|
})
|
|
2340
2486
|
});
|
|
2341
2487
|
};
|
|
2342
|
-
var getKey = () => {
|
|
2343
|
-
return `remotion_inputPropsOverride` + window.location.origin;
|
|
2344
|
-
};
|
|
2345
|
-
var getInputPropsOverride = () => {
|
|
2346
|
-
if (typeof localStorage === "undefined")
|
|
2347
|
-
return null;
|
|
2348
|
-
const override = localStorage.getItem(getKey());
|
|
2349
|
-
if (!override)
|
|
2350
|
-
return null;
|
|
2351
|
-
return JSON.parse(override);
|
|
2352
|
-
};
|
|
2353
|
-
var setInputPropsOverride = (override) => {
|
|
2354
|
-
if (typeof localStorage === "undefined")
|
|
2355
|
-
return;
|
|
2356
|
-
if (override === null) {
|
|
2357
|
-
localStorage.removeItem(getKey());
|
|
2358
|
-
return;
|
|
2359
|
-
}
|
|
2360
|
-
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
2361
|
-
};
|
|
2362
|
-
var didWarnSSRImport = false;
|
|
2363
|
-
var warnOnceSSRImport = () => {
|
|
2364
|
-
if (didWarnSSRImport) {
|
|
2365
|
-
return;
|
|
2366
|
-
}
|
|
2367
|
-
didWarnSSRImport = true;
|
|
2368
|
-
console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.");
|
|
2369
|
-
console.warn("To hide this warning, don't call this function on the server:");
|
|
2370
|
-
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
2371
|
-
};
|
|
2372
|
-
var getInputProps = () => {
|
|
2373
|
-
if (typeof window === "undefined") {
|
|
2374
|
-
warnOnceSSRImport();
|
|
2375
|
-
return {};
|
|
2376
|
-
}
|
|
2377
|
-
if (getRemotionEnvironment().isPlayer) {
|
|
2378
|
-
throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");
|
|
2379
|
-
}
|
|
2380
|
-
const override = getInputPropsOverride();
|
|
2381
|
-
if (override) {
|
|
2382
|
-
return override;
|
|
2383
|
-
}
|
|
2384
|
-
if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
|
|
2385
|
-
throw new Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");
|
|
2386
|
-
}
|
|
2387
|
-
const param = window.remotion_inputProps;
|
|
2388
|
-
if (!param) {
|
|
2389
|
-
return {};
|
|
2390
|
-
}
|
|
2391
|
-
const parsed = deserializeJSONWithSpecialTypes(param);
|
|
2392
|
-
return parsed;
|
|
2393
|
-
};
|
|
2394
|
-
var EditorPropsContext = createContext12({
|
|
2395
|
-
props: {},
|
|
2396
|
-
updateProps: () => {
|
|
2397
|
-
throw new Error("Not implemented");
|
|
2398
|
-
}
|
|
2399
|
-
});
|
|
2400
|
-
var timeValueRef = React8.createRef();
|
|
2401
|
-
var EditorPropsProvider = ({ children }) => {
|
|
2402
|
-
const [props, setProps] = React8.useState({});
|
|
2403
|
-
const updateProps = useCallback3(({
|
|
2404
|
-
defaultProps,
|
|
2405
|
-
id,
|
|
2406
|
-
newProps
|
|
2407
|
-
}) => {
|
|
2408
|
-
setProps((prev) => {
|
|
2409
|
-
return {
|
|
2410
|
-
...prev,
|
|
2411
|
-
[id]: typeof newProps === "function" ? newProps(prev[id] ?? defaultProps) : newProps
|
|
2412
|
-
};
|
|
2413
|
-
});
|
|
2414
|
-
}, []);
|
|
2415
|
-
const ctx = useMemo5(() => {
|
|
2416
|
-
return { props, updateProps };
|
|
2417
|
-
}, [props, updateProps]);
|
|
2418
|
-
return /* @__PURE__ */ jsx6(EditorPropsContext.Provider, {
|
|
2419
|
-
value: ctx,
|
|
2420
|
-
children
|
|
2421
|
-
});
|
|
2422
|
-
};
|
|
2423
|
-
function validateDimension(amount, nameOfProp, location) {
|
|
2424
|
-
if (typeof amount !== "number") {
|
|
2425
|
-
throw new Error(`The "${nameOfProp}" prop ${location} must be a number, but you passed a value of type ${typeof amount}`);
|
|
2426
|
-
}
|
|
2427
|
-
if (isNaN(amount)) {
|
|
2428
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must not be NaN, but is NaN.`);
|
|
2429
|
-
}
|
|
2430
|
-
if (!Number.isFinite(amount)) {
|
|
2431
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be finite, but is ${amount}.`);
|
|
2432
|
-
}
|
|
2433
|
-
if (amount % 1 !== 0) {
|
|
2434
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be an integer, but is ${amount}.`);
|
|
2435
|
-
}
|
|
2436
|
-
if (amount <= 0) {
|
|
2437
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be positive, but got ${amount}.`);
|
|
2438
|
-
}
|
|
2439
|
-
}
|
|
2440
|
-
function validateDurationInFrames(durationInFrames, options) {
|
|
2441
|
-
const { allowFloats, component } = options;
|
|
2442
|
-
if (typeof durationInFrames === "undefined") {
|
|
2443
|
-
throw new Error(`The "durationInFrames" prop ${component} is missing.`);
|
|
2444
|
-
}
|
|
2445
|
-
if (typeof durationInFrames !== "number") {
|
|
2446
|
-
throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
|
|
2447
|
-
}
|
|
2448
|
-
if (durationInFrames <= 0) {
|
|
2449
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
2450
|
-
}
|
|
2451
|
-
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
2452
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
2453
|
-
}
|
|
2454
|
-
if (!Number.isFinite(durationInFrames)) {
|
|
2455
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
2456
|
-
}
|
|
2457
|
-
}
|
|
2458
|
-
function validateFps(fps, location, isGif) {
|
|
2459
|
-
if (typeof fps !== "number") {
|
|
2460
|
-
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
2461
|
-
}
|
|
2462
|
-
if (!Number.isFinite(fps)) {
|
|
2463
|
-
throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
|
|
2464
|
-
}
|
|
2465
|
-
if (isNaN(fps)) {
|
|
2466
|
-
throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
|
|
2467
|
-
}
|
|
2468
|
-
if (fps <= 0) {
|
|
2469
|
-
throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
|
|
2470
|
-
}
|
|
2471
|
-
if (isGif && fps > 50) {
|
|
2472
|
-
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`);
|
|
2473
|
-
}
|
|
2474
|
-
}
|
|
2475
|
-
var ResolveCompositionContext = createContext13(null);
|
|
2476
|
-
var resolveCompositionsRef = createRef();
|
|
2477
|
-
var needsResolution = (composition) => {
|
|
2478
|
-
return Boolean(composition.calculateMetadata);
|
|
2479
|
-
};
|
|
2480
|
-
var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
2481
|
-
const context = useContext7(ResolveCompositionContext);
|
|
2482
|
-
const { props: allEditorProps } = useContext7(EditorPropsContext);
|
|
2483
|
-
const { compositions, canvasContent, currentCompositionMetadata } = useContext7(CompositionManager);
|
|
2484
|
-
const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
2485
|
-
const compositionId = preferredCompositionId ?? currentComposition;
|
|
2486
|
-
const composition = compositions.find((c) => c.id === compositionId);
|
|
2487
|
-
const selectedEditorProps = useMemo6(() => {
|
|
2488
|
-
return composition ? allEditorProps[composition.id] ?? {} : {};
|
|
2489
|
-
}, [allEditorProps, composition]);
|
|
2490
|
-
const env = useRemotionEnvironment();
|
|
2491
|
-
return useMemo6(() => {
|
|
2492
|
-
if (!composition) {
|
|
2493
|
-
return null;
|
|
2494
|
-
}
|
|
2495
|
-
if (currentCompositionMetadata) {
|
|
2496
|
-
return {
|
|
2497
|
-
type: "success",
|
|
2498
|
-
metadataSource: null,
|
|
2499
|
-
result: {
|
|
2500
|
-
...currentCompositionMetadata,
|
|
2501
|
-
id: composition.id,
|
|
2502
|
-
defaultProps: composition.defaultProps ?? {}
|
|
2503
|
-
}
|
|
2504
|
-
};
|
|
2505
|
-
}
|
|
2506
|
-
if (!needsResolution(composition)) {
|
|
2507
|
-
validateDurationInFrames(composition.durationInFrames, {
|
|
2508
|
-
allowFloats: false,
|
|
2509
|
-
component: `in <Composition id="${composition.id}">`
|
|
2510
|
-
});
|
|
2511
|
-
validateFps(composition.fps, `in <Composition id="${composition.id}">`, false);
|
|
2512
|
-
validateDimension(composition.width, "width", `in <Composition id="${composition.id}">`);
|
|
2513
|
-
validateDimension(composition.height, "height", `in <Composition id="${composition.id}">`);
|
|
2514
|
-
return {
|
|
2515
|
-
type: "success",
|
|
2516
|
-
metadataSource: null,
|
|
2517
|
-
result: {
|
|
2518
|
-
width: composition.width,
|
|
2519
|
-
height: composition.height,
|
|
2520
|
-
fps: composition.fps,
|
|
2521
|
-
id: composition.id,
|
|
2522
|
-
durationInFrames: composition.durationInFrames,
|
|
2523
|
-
defaultProps: composition.defaultProps ?? {},
|
|
2524
|
-
props: {
|
|
2525
|
-
...composition.defaultProps ?? {},
|
|
2526
|
-
...selectedEditorProps ?? {},
|
|
2527
|
-
...typeof window === "undefined" || env.isPlayer || !window.remotion_inputProps ? {} : getInputProps() ?? {}
|
|
2528
|
-
},
|
|
2529
|
-
defaultCodec: null,
|
|
2530
|
-
defaultOutName: null,
|
|
2531
|
-
defaultVideoImageFormat: null,
|
|
2532
|
-
defaultPixelFormat: null,
|
|
2533
|
-
defaultProResProfile: null,
|
|
2534
|
-
defaultSampleRate: null
|
|
2535
|
-
}
|
|
2536
|
-
};
|
|
2537
|
-
}
|
|
2538
|
-
if (!context) {
|
|
2539
|
-
return null;
|
|
2540
|
-
}
|
|
2541
|
-
if (!context[composition.id]) {
|
|
2542
|
-
return null;
|
|
2543
|
-
}
|
|
2544
|
-
return context[composition.id];
|
|
2545
|
-
}, [
|
|
2546
|
-
composition,
|
|
2547
|
-
context,
|
|
2548
|
-
currentCompositionMetadata,
|
|
2549
|
-
selectedEditorProps,
|
|
2550
|
-
env.isPlayer
|
|
2551
|
-
]);
|
|
2552
|
-
};
|
|
2553
|
-
var useVideo = () => {
|
|
2554
|
-
const { canvasContent, compositions, currentCompositionMetadata } = useContext8(CompositionManager);
|
|
2555
|
-
const selected = compositions.find((c) => {
|
|
2556
|
-
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
2557
|
-
});
|
|
2558
|
-
const resolved = useResolvedVideoConfig(selected?.id ?? null);
|
|
2559
|
-
return useMemo7(() => {
|
|
2560
|
-
if (!resolved) {
|
|
2561
|
-
return null;
|
|
2562
|
-
}
|
|
2563
|
-
if (resolved.type === "error") {
|
|
2564
|
-
return null;
|
|
2565
|
-
}
|
|
2566
|
-
if (resolved.type === "loading") {
|
|
2567
|
-
return null;
|
|
2568
|
-
}
|
|
2569
|
-
if (!selected) {
|
|
2570
|
-
return null;
|
|
2571
|
-
}
|
|
2572
|
-
return {
|
|
2573
|
-
...resolved.result,
|
|
2574
|
-
defaultProps: selected.defaultProps ?? {},
|
|
2575
|
-
id: selected.id,
|
|
2576
|
-
...currentCompositionMetadata ?? {},
|
|
2577
|
-
component: selected.component
|
|
2578
|
-
};
|
|
2579
|
-
}, [currentCompositionMetadata, resolved, selected]);
|
|
2580
|
-
};
|
|
2581
2488
|
var makeKey = () => {
|
|
2582
2489
|
return `remotion.time-all`;
|
|
2583
2490
|
};
|
|
@@ -2613,14 +2520,14 @@ var useTimelinePositionFromContext = (state) => {
|
|
|
2613
2520
|
return clampFrameToCompositionRange(unclamped, videoConfig.durationInFrames);
|
|
2614
2521
|
};
|
|
2615
2522
|
var useTimelineContext = () => {
|
|
2616
|
-
const state =
|
|
2523
|
+
const state = useContext10(TimelineContext);
|
|
2617
2524
|
if (state === null) {
|
|
2618
2525
|
throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
2619
2526
|
}
|
|
2620
2527
|
return state;
|
|
2621
2528
|
};
|
|
2622
2529
|
var usePlaybackRate = () => {
|
|
2623
|
-
const state =
|
|
2530
|
+
const state = useContext10(PlaybackRateContext);
|
|
2624
2531
|
if (state === null) {
|
|
2625
2532
|
throw new Error("PlaybackRateContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
2626
2533
|
}
|
|
@@ -2631,23 +2538,23 @@ var useTimelinePosition = () => {
|
|
|
2631
2538
|
return useTimelinePositionFromContext(state);
|
|
2632
2539
|
};
|
|
2633
2540
|
var useAbsoluteTimelinePosition = () => {
|
|
2634
|
-
const state =
|
|
2541
|
+
const state = useContext10(AbsoluteTimeContext);
|
|
2635
2542
|
if (state === null) {
|
|
2636
2543
|
throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
2637
2544
|
}
|
|
2638
2545
|
return useTimelinePositionFromContext(state);
|
|
2639
2546
|
};
|
|
2640
2547
|
var useTimelineSetFrame = () => {
|
|
2641
|
-
const { setFrame } =
|
|
2548
|
+
const { setFrame } = useContext10(SetTimelineContext);
|
|
2642
2549
|
return setFrame;
|
|
2643
2550
|
};
|
|
2644
2551
|
var usePlayingState = () => {
|
|
2645
2552
|
const { playing, imperativePlaying } = useTimelineContext();
|
|
2646
|
-
const { setPlaying } =
|
|
2647
|
-
return
|
|
2553
|
+
const { setPlaying } = useContext10(SetTimelineContext);
|
|
2554
|
+
return useMemo9(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
|
|
2648
2555
|
};
|
|
2649
2556
|
var useCurrentFrame = () => {
|
|
2650
|
-
const canUseRemotionHooks =
|
|
2557
|
+
const canUseRemotionHooks = useContext11(CanUseRemotionHooks);
|
|
2651
2558
|
const env = useRemotionEnvironment();
|
|
2652
2559
|
if (!canUseRemotionHooks) {
|
|
2653
2560
|
if (env.isPlayer) {
|
|
@@ -2656,17 +2563,17 @@ var useCurrentFrame = () => {
|
|
|
2656
2563
|
throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
|
|
2657
2564
|
}
|
|
2658
2565
|
const frame = useTimelinePosition();
|
|
2659
|
-
const context =
|
|
2566
|
+
const context = useContext11(SequenceContext);
|
|
2660
2567
|
const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
|
|
2661
2568
|
return frame - contextOffset;
|
|
2662
2569
|
};
|
|
2663
2570
|
var useUnsafeVideoConfig = () => {
|
|
2664
|
-
const context =
|
|
2571
|
+
const context = useContext12(SequenceContext);
|
|
2665
2572
|
const ctxWidth = context?.width ?? null;
|
|
2666
2573
|
const ctxHeight = context?.height ?? null;
|
|
2667
2574
|
const ctxDuration = context?.durationInFrames ?? null;
|
|
2668
2575
|
const video = useVideo();
|
|
2669
|
-
return
|
|
2576
|
+
return useMemo10(() => {
|
|
2670
2577
|
if (!video) {
|
|
2671
2578
|
return null;
|
|
2672
2579
|
}
|
|
@@ -2704,7 +2611,7 @@ var useUnsafeVideoConfig = () => {
|
|
|
2704
2611
|
};
|
|
2705
2612
|
var useVideoConfig = () => {
|
|
2706
2613
|
const videoConfig = useUnsafeVideoConfig();
|
|
2707
|
-
const context =
|
|
2614
|
+
const context = useContext13(CanUseRemotionHooks);
|
|
2708
2615
|
const isPlayer = useIsPlayer();
|
|
2709
2616
|
if (!videoConfig) {
|
|
2710
2617
|
if (typeof window !== "undefined" && window.remotion_isPlayer || isPlayer) {
|
|
@@ -2740,7 +2647,7 @@ var Freeze = ({
|
|
|
2740
2647
|
if (!Number.isFinite(frameToFreeze)) {
|
|
2741
2648
|
throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frameToFreeze}.`);
|
|
2742
2649
|
}
|
|
2743
|
-
const isActive =
|
|
2650
|
+
const isActive = useMemo11(() => {
|
|
2744
2651
|
if (typeof active === "boolean") {
|
|
2745
2652
|
return active;
|
|
2746
2653
|
}
|
|
@@ -2749,9 +2656,9 @@ var Freeze = ({
|
|
|
2749
2656
|
}
|
|
2750
2657
|
}, [active, frame]);
|
|
2751
2658
|
const timelineContext = useTimelineContext();
|
|
2752
|
-
const sequenceContext =
|
|
2659
|
+
const sequenceContext = useContext14(SequenceContext);
|
|
2753
2660
|
const relativeFrom = sequenceContext?.relativeFrom ?? 0;
|
|
2754
|
-
const timelineValue =
|
|
2661
|
+
const timelineValue = useMemo11(() => {
|
|
2755
2662
|
if (!isActive) {
|
|
2756
2663
|
return timelineContext;
|
|
2757
2664
|
}
|
|
@@ -2766,7 +2673,7 @@ var Freeze = ({
|
|
|
2766
2673
|
}
|
|
2767
2674
|
};
|
|
2768
2675
|
}, [isActive, timelineContext, videoConfig.id, frameToFreeze, relativeFrom]);
|
|
2769
|
-
const newSequenceContext =
|
|
2676
|
+
const newSequenceContext = useMemo11(() => {
|
|
2770
2677
|
if (!sequenceContext) {
|
|
2771
2678
|
return null;
|
|
2772
2679
|
}
|
|
@@ -2778,14 +2685,406 @@ var Freeze = ({
|
|
|
2778
2685
|
cumulatedFrom: 0
|
|
2779
2686
|
};
|
|
2780
2687
|
}, [sequenceContext, isActive]);
|
|
2781
|
-
return /* @__PURE__ */
|
|
2688
|
+
return /* @__PURE__ */ jsx9(TimelineContext.Provider, {
|
|
2782
2689
|
value: timelineValue,
|
|
2783
|
-
children: /* @__PURE__ */
|
|
2690
|
+
children: /* @__PURE__ */ jsx9(SequenceContext.Provider, {
|
|
2784
2691
|
value: newSequenceContext,
|
|
2785
2692
|
children
|
|
2786
2693
|
})
|
|
2787
2694
|
});
|
|
2788
2695
|
};
|
|
2696
|
+
var captionsSchema = {
|
|
2697
|
+
captions: {
|
|
2698
|
+
type: "remotion-captions",
|
|
2699
|
+
default: undefined,
|
|
2700
|
+
description: "Captions",
|
|
2701
|
+
keyframable: false
|
|
2702
|
+
}
|
|
2703
|
+
};
|
|
2704
|
+
var transformSchema = {
|
|
2705
|
+
"style.transformOrigin": {
|
|
2706
|
+
type: "transform-origin",
|
|
2707
|
+
step: 1,
|
|
2708
|
+
default: "50% 50%",
|
|
2709
|
+
description: "Transform origin"
|
|
2710
|
+
},
|
|
2711
|
+
"style.translate": {
|
|
2712
|
+
type: "translate",
|
|
2713
|
+
step: 1,
|
|
2714
|
+
default: "0px 0px",
|
|
2715
|
+
description: "Offset"
|
|
2716
|
+
},
|
|
2717
|
+
"style.scale": {
|
|
2718
|
+
type: "scale",
|
|
2719
|
+
max: 100,
|
|
2720
|
+
step: 0.01,
|
|
2721
|
+
default: 1,
|
|
2722
|
+
description: "Scale",
|
|
2723
|
+
defaultKeyframeOutput: "perceptual-scale"
|
|
2724
|
+
},
|
|
2725
|
+
"style.rotate": {
|
|
2726
|
+
type: "rotation-css",
|
|
2727
|
+
step: 1,
|
|
2728
|
+
default: "0deg",
|
|
2729
|
+
description: "Rotation"
|
|
2730
|
+
},
|
|
2731
|
+
"style.opacity": {
|
|
2732
|
+
type: "number",
|
|
2733
|
+
min: 0,
|
|
2734
|
+
max: 1,
|
|
2735
|
+
step: 0.01,
|
|
2736
|
+
default: 1,
|
|
2737
|
+
description: "Opacity",
|
|
2738
|
+
hiddenFromList: false
|
|
2739
|
+
}
|
|
2740
|
+
};
|
|
2741
|
+
var sequenceVisualStyleSchema = transformSchema;
|
|
2742
|
+
var textSchema = {
|
|
2743
|
+
"style.color": {
|
|
2744
|
+
type: "color",
|
|
2745
|
+
default: undefined,
|
|
2746
|
+
description: "Color"
|
|
2747
|
+
},
|
|
2748
|
+
"style.fontFamily": {
|
|
2749
|
+
type: "font-family",
|
|
2750
|
+
default: undefined,
|
|
2751
|
+
description: "Font family",
|
|
2752
|
+
keyframable: false
|
|
2753
|
+
},
|
|
2754
|
+
"style.fontSize": {
|
|
2755
|
+
type: "number",
|
|
2756
|
+
default: undefined,
|
|
2757
|
+
min: 0,
|
|
2758
|
+
step: 1,
|
|
2759
|
+
description: "Font size",
|
|
2760
|
+
hiddenFromList: false
|
|
2761
|
+
},
|
|
2762
|
+
"style.lineHeight": {
|
|
2763
|
+
type: "number",
|
|
2764
|
+
default: undefined,
|
|
2765
|
+
min: 0,
|
|
2766
|
+
step: 0.05,
|
|
2767
|
+
description: "Line height",
|
|
2768
|
+
hiddenFromList: false
|
|
2769
|
+
},
|
|
2770
|
+
"style.fontWeight": {
|
|
2771
|
+
type: "enum",
|
|
2772
|
+
default: "400",
|
|
2773
|
+
description: "Font weight",
|
|
2774
|
+
variants: {
|
|
2775
|
+
"100": {},
|
|
2776
|
+
"200": {},
|
|
2777
|
+
"300": {},
|
|
2778
|
+
"400": {},
|
|
2779
|
+
"500": {},
|
|
2780
|
+
"600": {},
|
|
2781
|
+
"700": {},
|
|
2782
|
+
"800": {},
|
|
2783
|
+
"900": {},
|
|
2784
|
+
normal: {},
|
|
2785
|
+
bold: {}
|
|
2786
|
+
}
|
|
2787
|
+
},
|
|
2788
|
+
"style.fontStyle": {
|
|
2789
|
+
type: "enum",
|
|
2790
|
+
default: "normal",
|
|
2791
|
+
description: "Font style",
|
|
2792
|
+
variants: {
|
|
2793
|
+
normal: {},
|
|
2794
|
+
italic: {},
|
|
2795
|
+
oblique: {}
|
|
2796
|
+
}
|
|
2797
|
+
},
|
|
2798
|
+
"style.textAlign": {
|
|
2799
|
+
type: "enum",
|
|
2800
|
+
default: "left",
|
|
2801
|
+
description: "Text align",
|
|
2802
|
+
variants: {
|
|
2803
|
+
left: {},
|
|
2804
|
+
center: {},
|
|
2805
|
+
right: {},
|
|
2806
|
+
justify: {},
|
|
2807
|
+
start: {},
|
|
2808
|
+
end: {}
|
|
2809
|
+
}
|
|
2810
|
+
},
|
|
2811
|
+
"style.letterSpacing": {
|
|
2812
|
+
type: "number",
|
|
2813
|
+
default: undefined,
|
|
2814
|
+
step: 0.1,
|
|
2815
|
+
description: "Letter spacing",
|
|
2816
|
+
hiddenFromList: false
|
|
2817
|
+
}
|
|
2818
|
+
};
|
|
2819
|
+
var borderSchema = {
|
|
2820
|
+
"style.borderWidth": {
|
|
2821
|
+
type: "number",
|
|
2822
|
+
default: undefined,
|
|
2823
|
+
min: 0,
|
|
2824
|
+
step: 1,
|
|
2825
|
+
description: "Border width",
|
|
2826
|
+
hiddenFromList: false
|
|
2827
|
+
},
|
|
2828
|
+
"style.borderStyle": {
|
|
2829
|
+
type: "enum",
|
|
2830
|
+
default: "none",
|
|
2831
|
+
description: "Border style",
|
|
2832
|
+
variants: {
|
|
2833
|
+
none: {},
|
|
2834
|
+
hidden: {},
|
|
2835
|
+
solid: {},
|
|
2836
|
+
dashed: {},
|
|
2837
|
+
dotted: {},
|
|
2838
|
+
double: {},
|
|
2839
|
+
groove: {},
|
|
2840
|
+
ridge: {},
|
|
2841
|
+
inset: {},
|
|
2842
|
+
outset: {}
|
|
2843
|
+
}
|
|
2844
|
+
},
|
|
2845
|
+
"style.borderColor": {
|
|
2846
|
+
type: "color",
|
|
2847
|
+
default: undefined,
|
|
2848
|
+
description: "Border color"
|
|
2849
|
+
}
|
|
2850
|
+
};
|
|
2851
|
+
var borderRadiusSchema = {
|
|
2852
|
+
"style.borderRadius": {
|
|
2853
|
+
type: "number",
|
|
2854
|
+
default: 0,
|
|
2855
|
+
min: 0,
|
|
2856
|
+
step: 1,
|
|
2857
|
+
description: "Border radius",
|
|
2858
|
+
hiddenFromList: false,
|
|
2859
|
+
keyframable: true
|
|
2860
|
+
},
|
|
2861
|
+
"style.borderTopLeftRadius": {
|
|
2862
|
+
type: "number",
|
|
2863
|
+
default: 0,
|
|
2864
|
+
min: 0,
|
|
2865
|
+
step: 1,
|
|
2866
|
+
description: "Top left radius",
|
|
2867
|
+
hiddenFromList: false
|
|
2868
|
+
},
|
|
2869
|
+
"style.borderTopRightRadius": {
|
|
2870
|
+
type: "number",
|
|
2871
|
+
default: 0,
|
|
2872
|
+
min: 0,
|
|
2873
|
+
step: 1,
|
|
2874
|
+
description: "Top right radius",
|
|
2875
|
+
hiddenFromList: false
|
|
2876
|
+
},
|
|
2877
|
+
"style.borderBottomRightRadius": {
|
|
2878
|
+
type: "number",
|
|
2879
|
+
default: 0,
|
|
2880
|
+
min: 0,
|
|
2881
|
+
step: 1,
|
|
2882
|
+
description: "Bottom right radius",
|
|
2883
|
+
hiddenFromList: false
|
|
2884
|
+
},
|
|
2885
|
+
"style.borderBottomLeftRadius": {
|
|
2886
|
+
type: "number",
|
|
2887
|
+
default: 0,
|
|
2888
|
+
min: 0,
|
|
2889
|
+
step: 1,
|
|
2890
|
+
description: "Bottom left radius",
|
|
2891
|
+
hiddenFromList: false
|
|
2892
|
+
}
|
|
2893
|
+
};
|
|
2894
|
+
var backgroundSchema = {
|
|
2895
|
+
"style.backgroundColor": {
|
|
2896
|
+
type: "color",
|
|
2897
|
+
default: "transparent",
|
|
2898
|
+
description: "Color"
|
|
2899
|
+
}
|
|
2900
|
+
};
|
|
2901
|
+
var svgStrokeSchema = {
|
|
2902
|
+
stroke: {
|
|
2903
|
+
type: "color",
|
|
2904
|
+
default: "none",
|
|
2905
|
+
description: "Stroke"
|
|
2906
|
+
},
|
|
2907
|
+
strokeWidth: {
|
|
2908
|
+
type: "number",
|
|
2909
|
+
default: 1,
|
|
2910
|
+
description: "Stroke width",
|
|
2911
|
+
min: 0,
|
|
2912
|
+
step: 1,
|
|
2913
|
+
hiddenFromList: false
|
|
2914
|
+
}
|
|
2915
|
+
};
|
|
2916
|
+
var svgPaintSchema = {
|
|
2917
|
+
fill: {
|
|
2918
|
+
type: "color",
|
|
2919
|
+
default: undefined,
|
|
2920
|
+
description: "Fill"
|
|
2921
|
+
},
|
|
2922
|
+
...svgStrokeSchema
|
|
2923
|
+
};
|
|
2924
|
+
var textContentSchema = {
|
|
2925
|
+
children: {
|
|
2926
|
+
type: "text-content",
|
|
2927
|
+
default: "",
|
|
2928
|
+
description: "Text",
|
|
2929
|
+
keyframable: false
|
|
2930
|
+
}
|
|
2931
|
+
};
|
|
2932
|
+
var premountSchema = {
|
|
2933
|
+
premountFor: {
|
|
2934
|
+
type: "number",
|
|
2935
|
+
default: 0,
|
|
2936
|
+
description: "Premount For",
|
|
2937
|
+
min: 0,
|
|
2938
|
+
step: 1,
|
|
2939
|
+
hiddenFromList: false,
|
|
2940
|
+
keyframable: false
|
|
2941
|
+
},
|
|
2942
|
+
postmountFor: {
|
|
2943
|
+
type: "number",
|
|
2944
|
+
default: 0,
|
|
2945
|
+
min: 0,
|
|
2946
|
+
step: 1,
|
|
2947
|
+
hiddenFromList: true,
|
|
2948
|
+
keyframable: false
|
|
2949
|
+
}
|
|
2950
|
+
};
|
|
2951
|
+
var sequencePremountSchema = {
|
|
2952
|
+
...premountSchema
|
|
2953
|
+
};
|
|
2954
|
+
var cropSchema = {
|
|
2955
|
+
cropLeft: {
|
|
2956
|
+
type: "number",
|
|
2957
|
+
default: 0,
|
|
2958
|
+
description: "Crop left",
|
|
2959
|
+
min: 0,
|
|
2960
|
+
max: 1,
|
|
2961
|
+
step: 0.01,
|
|
2962
|
+
hiddenFromList: false,
|
|
2963
|
+
keyframable: true
|
|
2964
|
+
},
|
|
2965
|
+
cropRight: {
|
|
2966
|
+
type: "number",
|
|
2967
|
+
default: 0,
|
|
2968
|
+
description: "Crop right",
|
|
2969
|
+
min: 0,
|
|
2970
|
+
max: 1,
|
|
2971
|
+
step: 0.01,
|
|
2972
|
+
hiddenFromList: false,
|
|
2973
|
+
keyframable: true
|
|
2974
|
+
},
|
|
2975
|
+
cropTop: {
|
|
2976
|
+
type: "number",
|
|
2977
|
+
default: 0,
|
|
2978
|
+
description: "Crop top",
|
|
2979
|
+
min: 0,
|
|
2980
|
+
max: 1,
|
|
2981
|
+
step: 0.01,
|
|
2982
|
+
hiddenFromList: false,
|
|
2983
|
+
keyframable: true
|
|
2984
|
+
},
|
|
2985
|
+
cropBottom: {
|
|
2986
|
+
type: "number",
|
|
2987
|
+
default: 0,
|
|
2988
|
+
description: "Crop bottom",
|
|
2989
|
+
min: 0,
|
|
2990
|
+
max: 1,
|
|
2991
|
+
step: 0.01,
|
|
2992
|
+
hiddenFromList: false,
|
|
2993
|
+
keyframable: true
|
|
2994
|
+
}
|
|
2995
|
+
};
|
|
2996
|
+
var sequenceCropSchema = cropSchema;
|
|
2997
|
+
var sequenceStyleSchema = {
|
|
2998
|
+
...sequenceCropSchema,
|
|
2999
|
+
...transformSchema,
|
|
3000
|
+
...backgroundSchema,
|
|
3001
|
+
...borderSchema,
|
|
3002
|
+
...borderRadiusSchema,
|
|
3003
|
+
...sequencePremountSchema
|
|
3004
|
+
};
|
|
3005
|
+
var hiddenField = {
|
|
3006
|
+
type: "boolean",
|
|
3007
|
+
default: false,
|
|
3008
|
+
description: "Hidden"
|
|
3009
|
+
};
|
|
3010
|
+
var showInTimelineField = {
|
|
3011
|
+
type: "hidden"
|
|
3012
|
+
};
|
|
3013
|
+
var sequenceNameField = {
|
|
3014
|
+
type: "hidden"
|
|
3015
|
+
};
|
|
3016
|
+
var extendSchemaWithSequenceName = (schema) => {
|
|
3017
|
+
return {
|
|
3018
|
+
name: sequenceNameField,
|
|
3019
|
+
...schema
|
|
3020
|
+
};
|
|
3021
|
+
};
|
|
3022
|
+
var durationInFramesField = {
|
|
3023
|
+
type: "number",
|
|
3024
|
+
default: undefined,
|
|
3025
|
+
min: 1,
|
|
3026
|
+
step: 1,
|
|
3027
|
+
hiddenFromList: true
|
|
3028
|
+
};
|
|
3029
|
+
var fromField = {
|
|
3030
|
+
type: "number",
|
|
3031
|
+
default: 0,
|
|
3032
|
+
step: 1,
|
|
3033
|
+
hiddenFromList: true
|
|
3034
|
+
};
|
|
3035
|
+
var trimBeforeField = {
|
|
3036
|
+
type: "number",
|
|
3037
|
+
default: 0,
|
|
3038
|
+
min: 0,
|
|
3039
|
+
step: 1,
|
|
3040
|
+
hiddenFromList: true
|
|
3041
|
+
};
|
|
3042
|
+
var freezeField = {
|
|
3043
|
+
type: "number",
|
|
3044
|
+
default: null,
|
|
3045
|
+
step: 1,
|
|
3046
|
+
hiddenFromList: true
|
|
3047
|
+
};
|
|
3048
|
+
var baseSchema = {
|
|
3049
|
+
durationInFrames: durationInFramesField,
|
|
3050
|
+
from: fromField,
|
|
3051
|
+
trimBefore: trimBeforeField,
|
|
3052
|
+
freeze: freezeField,
|
|
3053
|
+
hidden: hiddenField,
|
|
3054
|
+
name: sequenceNameField,
|
|
3055
|
+
showInTimeline: showInTimelineField
|
|
3056
|
+
};
|
|
3057
|
+
var sequenceSchema = {
|
|
3058
|
+
...baseSchema,
|
|
3059
|
+
layout: {
|
|
3060
|
+
type: "enum",
|
|
3061
|
+
default: "absolute-fill",
|
|
3062
|
+
description: "Layout",
|
|
3063
|
+
variants: {
|
|
3064
|
+
"absolute-fill": sequenceStyleSchema,
|
|
3065
|
+
none: {}
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
};
|
|
3069
|
+
var baseSchemaWithoutFrom = {
|
|
3070
|
+
durationInFrames: durationInFramesField,
|
|
3071
|
+
trimBefore: trimBeforeField,
|
|
3072
|
+
freeze: freezeField,
|
|
3073
|
+
hidden: hiddenField,
|
|
3074
|
+
name: sequenceNameField,
|
|
3075
|
+
showInTimeline: showInTimelineField
|
|
3076
|
+
};
|
|
3077
|
+
var sequenceSchemaWithoutFrom = {
|
|
3078
|
+
...baseSchemaWithoutFrom,
|
|
3079
|
+
layout: sequenceSchema.layout
|
|
3080
|
+
};
|
|
3081
|
+
var sequenceSchemaDefaultLayoutNone = {
|
|
3082
|
+
...sequenceSchema,
|
|
3083
|
+
layout: {
|
|
3084
|
+
...sequenceSchema.layout,
|
|
3085
|
+
default: "none"
|
|
3086
|
+
}
|
|
3087
|
+
};
|
|
2789
3088
|
var clampCrop = (value) => {
|
|
2790
3089
|
return Math.min(1, Math.max(0, value ?? 0));
|
|
2791
3090
|
};
|
|
@@ -2842,7 +3141,7 @@ var validateSequenceCrop = (crop, componentName = "<Sequence />") => {
|
|
|
2842
3141
|
}
|
|
2843
3142
|
}
|
|
2844
3143
|
};
|
|
2845
|
-
var SequenceManager =
|
|
3144
|
+
var SequenceManager = React12.createContext({
|
|
2846
3145
|
registerSequence: () => {
|
|
2847
3146
|
throw new Error("SequenceManagerContext not initialized");
|
|
2848
3147
|
},
|
|
@@ -2851,19 +3150,19 @@ var SequenceManager = React10.createContext({
|
|
|
2851
3150
|
},
|
|
2852
3151
|
sequences: []
|
|
2853
3152
|
});
|
|
2854
|
-
var SequenceManagerRefContext =
|
|
3153
|
+
var SequenceManagerRefContext = React12.createContext({
|
|
2855
3154
|
current: []
|
|
2856
3155
|
});
|
|
2857
3156
|
var makeSequencePropsSubscriptionKey = (key) => {
|
|
2858
3157
|
return `${key.absolutePath}\x00${key.nodePath.join(".")}\x00${key.sequenceKeys.join(".")}\x00${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
|
|
2859
3158
|
};
|
|
2860
|
-
var VisualModePropStatusesContext =
|
|
3159
|
+
var VisualModePropStatusesContext = React12.createContext({
|
|
2861
3160
|
propStatuses: {}
|
|
2862
3161
|
});
|
|
2863
|
-
var VisualModePropStatusesRefContext =
|
|
3162
|
+
var VisualModePropStatusesRefContext = React12.createContext({
|
|
2864
3163
|
current: {}
|
|
2865
3164
|
});
|
|
2866
|
-
var VisualModeDragOverridesContext =
|
|
3165
|
+
var VisualModeDragOverridesContext = React12.createContext({
|
|
2867
3166
|
getDragOverrides: () => {
|
|
2868
3167
|
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
2869
3168
|
},
|
|
@@ -2871,7 +3170,7 @@ var VisualModeDragOverridesContext = React10.createContext({
|
|
|
2871
3170
|
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
2872
3171
|
}
|
|
2873
3172
|
});
|
|
2874
|
-
var VisualModeSettersContext =
|
|
3173
|
+
var VisualModeSettersContext = React12.createContext({
|
|
2875
3174
|
setDragOverrides: () => {
|
|
2876
3175
|
throw new Error("VisualModeSettersContext not initialized");
|
|
2877
3176
|
},
|
|
@@ -2891,16 +3190,16 @@ var VisualModeSettersContext = React10.createContext({
|
|
|
2891
3190
|
var effectDragOverridesKey = (nodePath, effectIndex) => `${makeSequencePropsSubscriptionKey(nodePath)}.effects.${effectIndex}`;
|
|
2892
3191
|
var SequenceManagerProvider = ({ children }) => {
|
|
2893
3192
|
const [sequences, setSequences] = useState3([]);
|
|
2894
|
-
const sequencesRef =
|
|
3193
|
+
const sequencesRef = useRef4(sequences);
|
|
2895
3194
|
sequencesRef.current = sequences;
|
|
2896
3195
|
const [dragOverrides, setControlOverrides] = useState3({});
|
|
2897
|
-
const controlOverridesRef =
|
|
3196
|
+
const controlOverridesRef = useRef4(dragOverrides);
|
|
2898
3197
|
controlOverridesRef.current = dragOverrides;
|
|
2899
3198
|
const [effectDragOverridesState, setEffectDragOverridesState] = useState3({});
|
|
2900
3199
|
const [propStatuses, setPropStatusesMapState] = useState3({});
|
|
2901
|
-
const propStatusesRef =
|
|
3200
|
+
const propStatusesRef = useRef4(propStatuses);
|
|
2902
3201
|
propStatusesRef.current = propStatuses;
|
|
2903
|
-
const setDragOverrides =
|
|
3202
|
+
const setDragOverrides = useCallback5((nodePath, key, value) => {
|
|
2904
3203
|
setControlOverrides((prev) => ({
|
|
2905
3204
|
...prev,
|
|
2906
3205
|
[makeSequencePropsSubscriptionKey(nodePath)]: {
|
|
@@ -2909,7 +3208,7 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2909
3208
|
}
|
|
2910
3209
|
}));
|
|
2911
3210
|
}, []);
|
|
2912
|
-
const clearDragOverrides =
|
|
3211
|
+
const clearDragOverrides = useCallback5((nodePath) => {
|
|
2913
3212
|
setControlOverrides((prev) => {
|
|
2914
3213
|
const key = makeSequencePropsSubscriptionKey(nodePath);
|
|
2915
3214
|
if (!prev[key]) {
|
|
@@ -2920,7 +3219,7 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2920
3219
|
return next;
|
|
2921
3220
|
});
|
|
2922
3221
|
}, []);
|
|
2923
|
-
const setEffectDragOverrides =
|
|
3222
|
+
const setEffectDragOverrides = useCallback5((nodePath, effectIndex, key, value) => {
|
|
2924
3223
|
setEffectDragOverridesState((prev) => {
|
|
2925
3224
|
const mapKey = effectDragOverridesKey(nodePath, effectIndex);
|
|
2926
3225
|
return {
|
|
@@ -2932,7 +3231,7 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2932
3231
|
};
|
|
2933
3232
|
});
|
|
2934
3233
|
}, []);
|
|
2935
|
-
const clearEffectDragOverrides =
|
|
3234
|
+
const clearEffectDragOverrides = useCallback5((nodePath, effectIndex) => {
|
|
2936
3235
|
setEffectDragOverridesState((prev) => {
|
|
2937
3236
|
const mapKey = effectDragOverridesKey(nodePath, effectIndex);
|
|
2938
3237
|
if (!prev[mapKey]) {
|
|
@@ -2943,7 +3242,7 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2943
3242
|
return next;
|
|
2944
3243
|
});
|
|
2945
3244
|
}, []);
|
|
2946
|
-
const setPropStatuses =
|
|
3245
|
+
const setPropStatuses = useCallback5((nodePath, values) => {
|
|
2947
3246
|
setPropStatusesMapState((prev) => {
|
|
2948
3247
|
const key = makeSequencePropsSubscriptionKey(nodePath);
|
|
2949
3248
|
const prevKey = prev[key];
|
|
@@ -2954,39 +3253,39 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2954
3253
|
return { ...prev, [key]: newKey };
|
|
2955
3254
|
});
|
|
2956
3255
|
}, []);
|
|
2957
|
-
const registerSequence =
|
|
3256
|
+
const registerSequence = useCallback5((seq) => {
|
|
2958
3257
|
setSequences((seqs) => {
|
|
2959
3258
|
return [...seqs, seq];
|
|
2960
3259
|
});
|
|
2961
3260
|
}, []);
|
|
2962
|
-
const unregisterSequence =
|
|
3261
|
+
const unregisterSequence = useCallback5((seq) => {
|
|
2963
3262
|
setSequences((seqs) => seqs.filter((s) => s.id !== seq));
|
|
2964
3263
|
}, []);
|
|
2965
|
-
const sequenceContext =
|
|
3264
|
+
const sequenceContext = useMemo12(() => {
|
|
2966
3265
|
return {
|
|
2967
3266
|
registerSequence,
|
|
2968
3267
|
sequences,
|
|
2969
3268
|
unregisterSequence
|
|
2970
3269
|
};
|
|
2971
3270
|
}, [registerSequence, sequences, unregisterSequence]);
|
|
2972
|
-
const getDragOverrides =
|
|
3271
|
+
const getDragOverrides = useCallback5((nodePath) => {
|
|
2973
3272
|
return dragOverrides[makeSequencePropsSubscriptionKey(nodePath)] ?? {};
|
|
2974
3273
|
}, [dragOverrides]);
|
|
2975
|
-
const getEffectDragOverrides =
|
|
3274
|
+
const getEffectDragOverrides = useCallback5((nodePath, effectIndex) => {
|
|
2976
3275
|
return effectDragOverridesState[effectDragOverridesKey(nodePath, effectIndex)] ?? {};
|
|
2977
3276
|
}, [effectDragOverridesState]);
|
|
2978
|
-
const propStatusesContext =
|
|
3277
|
+
const propStatusesContext = useMemo12(() => {
|
|
2979
3278
|
return {
|
|
2980
3279
|
propStatuses
|
|
2981
3280
|
};
|
|
2982
3281
|
}, [propStatuses]);
|
|
2983
|
-
const dragOverridesContext =
|
|
3282
|
+
const dragOverridesContext = useMemo12(() => {
|
|
2984
3283
|
return {
|
|
2985
3284
|
getDragOverrides,
|
|
2986
3285
|
getEffectDragOverrides
|
|
2987
3286
|
};
|
|
2988
3287
|
}, [getDragOverrides, getEffectDragOverrides]);
|
|
2989
|
-
const settersContext =
|
|
3288
|
+
const settersContext = useMemo12(() => {
|
|
2990
3289
|
return {
|
|
2991
3290
|
setDragOverrides,
|
|
2992
3291
|
clearDragOverrides,
|
|
@@ -3001,17 +3300,17 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
3001
3300
|
clearEffectDragOverrides,
|
|
3002
3301
|
setPropStatuses
|
|
3003
3302
|
]);
|
|
3004
|
-
return /* @__PURE__ */
|
|
3303
|
+
return /* @__PURE__ */ jsx10(SequenceManagerRefContext.Provider, {
|
|
3005
3304
|
value: sequencesRef,
|
|
3006
|
-
children: /* @__PURE__ */
|
|
3305
|
+
children: /* @__PURE__ */ jsx10(SequenceManager.Provider, {
|
|
3007
3306
|
value: sequenceContext,
|
|
3008
|
-
children: /* @__PURE__ */
|
|
3307
|
+
children: /* @__PURE__ */ jsx10(VisualModePropStatusesRefContext.Provider, {
|
|
3009
3308
|
value: propStatusesRef,
|
|
3010
|
-
children: /* @__PURE__ */
|
|
3309
|
+
children: /* @__PURE__ */ jsx10(VisualModePropStatusesContext.Provider, {
|
|
3011
3310
|
value: propStatusesContext,
|
|
3012
|
-
children: /* @__PURE__ */
|
|
3311
|
+
children: /* @__PURE__ */ jsx10(VisualModeDragOverridesContext.Provider, {
|
|
3013
3312
|
value: dragOverridesContext,
|
|
3014
|
-
children: /* @__PURE__ */
|
|
3313
|
+
children: /* @__PURE__ */ jsx10(VisualModeSettersContext.Provider, {
|
|
3015
3314
|
value: settersContext,
|
|
3016
3315
|
children
|
|
3017
3316
|
})
|
|
@@ -3023,19 +3322,19 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
3023
3322
|
};
|
|
3024
3323
|
var IsInsideSeriesContext = createContext14(false);
|
|
3025
3324
|
var IsInsideSeriesContainer = ({ children }) => {
|
|
3026
|
-
return /* @__PURE__ */
|
|
3325
|
+
return /* @__PURE__ */ jsx11(IsInsideSeriesContext.Provider, {
|
|
3027
3326
|
value: true,
|
|
3028
3327
|
children
|
|
3029
3328
|
});
|
|
3030
3329
|
};
|
|
3031
3330
|
var IsNotInsideSeriesProvider = ({ children }) => {
|
|
3032
|
-
return /* @__PURE__ */
|
|
3331
|
+
return /* @__PURE__ */ jsx11(IsInsideSeriesContext.Provider, {
|
|
3033
3332
|
value: false,
|
|
3034
3333
|
children
|
|
3035
3334
|
});
|
|
3036
3335
|
};
|
|
3037
3336
|
var useRequireToBeInsideSeries = () => {
|
|
3038
|
-
const isInsideSeries =
|
|
3337
|
+
const isInsideSeries = React13.useContext(IsInsideSeriesContext);
|
|
3039
3338
|
if (!isInsideSeries) {
|
|
3040
3339
|
throw new Error("This component must be inside a <Series /> component.");
|
|
3041
3340
|
}
|
|
@@ -3057,7 +3356,7 @@ var usePremounting = ({
|
|
|
3057
3356
|
styleWhilePostmounted,
|
|
3058
3357
|
hideWhilePremounted
|
|
3059
3358
|
}) => {
|
|
3060
|
-
const parentPremountContext =
|
|
3359
|
+
const parentPremountContext = useContext15(PremountContext);
|
|
3061
3360
|
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
3062
3361
|
const environment = useRemotionEnvironment();
|
|
3063
3362
|
const { fps } = useVideoConfig();
|
|
@@ -3068,7 +3367,7 @@ var usePremounting = ({
|
|
|
3068
3367
|
const postmountingActive = !environment.isRendering && frame > endThreshold && frame <= endThreshold + effectivePostmountFor;
|
|
3069
3368
|
const isPremountingOrPostmounting = premountingActive || postmountingActive;
|
|
3070
3369
|
const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
|
|
3071
|
-
const premountingStyle =
|
|
3370
|
+
const premountingStyle = useMemo13(() => {
|
|
3072
3371
|
if (!isPremountingOrPostmounting) {
|
|
3073
3372
|
return style;
|
|
3074
3373
|
}
|
|
@@ -4875,7 +5174,7 @@ var resolvePropStatusOverrides = (propStatus, frame) => {
|
|
|
4875
5174
|
return hasAny ? out : null;
|
|
4876
5175
|
};
|
|
4877
5176
|
var useMemoizedEffectDefinitions = (effects) => {
|
|
4878
|
-
const previousRef =
|
|
5177
|
+
const previousRef = useRef5(null);
|
|
4879
5178
|
const definitions = effects.map((descriptor) => descriptor.definition);
|
|
4880
5179
|
const previous = previousRef.current;
|
|
4881
5180
|
const isSame = previous !== null && previous.length === definitions.length && previous.every((def, i) => def === definitions[i]);
|
|
@@ -4920,11 +5219,11 @@ var useMemoizedEffects = ({
|
|
|
4920
5219
|
effects,
|
|
4921
5220
|
overrideId
|
|
4922
5221
|
}) => {
|
|
4923
|
-
const previousRef =
|
|
4924
|
-
const { propStatuses } =
|
|
4925
|
-
const { getEffectDragOverrides } =
|
|
5222
|
+
const previousRef = useRef5(null);
|
|
5223
|
+
const { propStatuses } = useContext16(VisualModePropStatusesContext);
|
|
5224
|
+
const { getEffectDragOverrides } = useContext16(VisualModeDragOverridesContext);
|
|
4926
5225
|
const frame = useCurrentFrame();
|
|
4927
|
-
const { overrideIdToNodePathMappings } =
|
|
5226
|
+
const { overrideIdToNodePathMappings } = useContext16(OverrideIdsToNodePathsGettersContext);
|
|
4928
5227
|
const previous = previousRef.current;
|
|
4929
5228
|
const nodePath = overrideId ? overrideIdToNodePathMappings[overrideId] ?? null : null;
|
|
4930
5229
|
const resolved = effects.map((descriptor, index) => {
|
|
@@ -5267,22 +5566,22 @@ var withInteractivitySchema = ({
|
|
|
5267
5566
|
const cleanProps = propsWithoutInternalStack;
|
|
5268
5567
|
const env = useRemotionEnvironment();
|
|
5269
5568
|
if (!env.isStudio || env.isRendering) {
|
|
5270
|
-
return
|
|
5569
|
+
return React14.createElement(Component, {
|
|
5271
5570
|
...cleanProps,
|
|
5272
5571
|
controls: null,
|
|
5273
5572
|
ref
|
|
5274
5573
|
});
|
|
5275
5574
|
}
|
|
5276
|
-
const { propStatuses } =
|
|
5277
|
-
const { getDragOverrides } =
|
|
5278
|
-
const nodePathMapping =
|
|
5575
|
+
const { propStatuses } = useContext17(VisualModePropStatusesContext);
|
|
5576
|
+
const { getDragOverrides } = useContext17(VisualModeDragOverridesContext);
|
|
5577
|
+
const nodePathMapping = useContext17(OverrideIdsToNodePathsGettersContext);
|
|
5279
5578
|
const frame = useCurrentFrame();
|
|
5280
5579
|
if (cleanProps.controls) {
|
|
5281
5580
|
const passedControls = cleanProps.controls;
|
|
5282
5581
|
if (getStackForControls(passedControls) === null) {
|
|
5283
5582
|
setStackForControls(passedControls, internalStack);
|
|
5284
5583
|
}
|
|
5285
|
-
return
|
|
5584
|
+
return React14.createElement(Component, {
|
|
5286
5585
|
...cleanProps,
|
|
5287
5586
|
ref
|
|
5288
5587
|
});
|
|
@@ -5305,8 +5604,8 @@ var withInteractivitySchema = ({
|
|
|
5305
5604
|
key,
|
|
5306
5605
|
props: cleanProps
|
|
5307
5606
|
}));
|
|
5308
|
-
const currentRuntimeValueDotNotation =
|
|
5309
|
-
const controls =
|
|
5607
|
+
const currentRuntimeValueDotNotation = useMemo14(() => readValuesFromProps(cleanProps, flatKeys, flatSchema), runtimeValues);
|
|
5608
|
+
const controls = useMemo14(() => {
|
|
5310
5609
|
return {
|
|
5311
5610
|
schema: schemaWithSequenceName,
|
|
5312
5611
|
currentRuntimeValueDotNotation,
|
|
@@ -5317,7 +5616,7 @@ var withInteractivitySchema = ({
|
|
|
5317
5616
|
};
|
|
5318
5617
|
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
5319
5618
|
setStackForControls(controls, internalStack);
|
|
5320
|
-
const { merged: valuesDotNotation, propsToDelete } =
|
|
5619
|
+
const { merged: valuesDotNotation, propsToDelete } = useMemo14(() => {
|
|
5321
5620
|
return computeEffectiveSchemaValuesDotNotation({
|
|
5322
5621
|
schema: schemaWithSequenceName,
|
|
5323
5622
|
currentValue: currentRuntimeValueDotNotation,
|
|
@@ -5340,7 +5639,7 @@ var withInteractivitySchema = ({
|
|
|
5340
5639
|
schemaKeys: activeKeys,
|
|
5341
5640
|
propsToDelete
|
|
5342
5641
|
});
|
|
5343
|
-
return
|
|
5642
|
+
return React14.createElement(Component, {
|
|
5344
5643
|
...mergedProps,
|
|
5345
5644
|
controls,
|
|
5346
5645
|
ref
|
|
@@ -5379,7 +5678,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5379
5678
|
}, ref) => {
|
|
5380
5679
|
const { layout = "absolute-fill" } = other;
|
|
5381
5680
|
const [id] = useState5(() => String(Math.random()));
|
|
5382
|
-
const parentSequence =
|
|
5681
|
+
const parentSequence = useContext18(SequenceContext);
|
|
5383
5682
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
5384
5683
|
const nonce = useNonce();
|
|
5385
5684
|
if (layout !== "absolute-fill" && layout !== "none") {
|
|
@@ -5441,13 +5740,13 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5441
5740
|
const absoluteFrom = (parentSequence?.absoluteFrom ?? 0) + effectiveRelativeFrom;
|
|
5442
5741
|
const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - effectiveRelativeFrom, durationInFrames) : durationInFrames;
|
|
5443
5742
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
5444
|
-
const { registerSequence, unregisterSequence } =
|
|
5445
|
-
const wrapperRefForOutline =
|
|
5743
|
+
const { registerSequence, unregisterSequence } = useContext18(SequenceManager);
|
|
5744
|
+
const wrapperRefForOutline = useRef6(null);
|
|
5446
5745
|
const refForOutline = other.layout === "none" ? passedRefForOutline ?? null : passedRefForOutline ?? wrapperRefForOutline;
|
|
5447
|
-
const premounting =
|
|
5746
|
+
const premounting = useMemo15(() => {
|
|
5448
5747
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
5449
5748
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
5450
|
-
const postmounting =
|
|
5749
|
+
const postmounting = useMemo15(() => {
|
|
5451
5750
|
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
5452
5751
|
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
5453
5752
|
const currentSequenceStart = cumulatedFrom + effectiveRelativeFrom;
|
|
@@ -5455,7 +5754,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5455
5754
|
const parentFirstFrame = parentSequence ? parentSequenceStart - parentSequence.cumulatedNegativeFrom : 0;
|
|
5456
5755
|
const firstFrame = Math.max(0, parentFirstFrame, currentSequenceStart);
|
|
5457
5756
|
const cumulatedNegativeFrom = currentSequenceStart - firstFrame;
|
|
5458
|
-
const contextValue =
|
|
5757
|
+
const contextValue = useMemo15(() => {
|
|
5459
5758
|
return {
|
|
5460
5759
|
absoluteFrom,
|
|
5461
5760
|
cumulatedFrom,
|
|
@@ -5486,13 +5785,13 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5486
5785
|
postmountDisplay,
|
|
5487
5786
|
cumulatedNegativeFrom
|
|
5488
5787
|
]);
|
|
5489
|
-
const timelineClipName =
|
|
5788
|
+
const timelineClipName = useMemo15(() => {
|
|
5490
5789
|
return name ?? "";
|
|
5491
5790
|
}, [name]);
|
|
5492
5791
|
const resolvedDocumentationLink = documentationLink ?? "https://www.remotion.dev/docs/sequence";
|
|
5493
5792
|
const env = useRemotionEnvironment();
|
|
5494
|
-
const isInsideSeries =
|
|
5495
|
-
const stackRef =
|
|
5793
|
+
const isInsideSeries = useContext18(IsInsideSeriesContext);
|
|
5794
|
+
const stackRef = useRef6(null);
|
|
5496
5795
|
stackRef.current = controls ? getStackForControls(controls) ?? stack ?? null : stack ?? null;
|
|
5497
5796
|
const registeredFrozenFrame = typeof freeze === "number" ? freeze : null;
|
|
5498
5797
|
const registeredTrimBefore = trimBefore === 0 ? null : trimBefore;
|
|
@@ -5500,7 +5799,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5500
5799
|
const startMediaFrom = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom - cumulatedNegativeFrom : null;
|
|
5501
5800
|
const mediaFrameAtSequenceZero = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom : null;
|
|
5502
5801
|
const frozenMediaFrame = isMedia && isMedia.type !== "image" && mediaFrameAtSequenceZero !== null ? registeredFrozenFrame === null ? null : mediaFrameAtSequenceZero + (loopDisplay ? registeredFrozenFrame % loopDisplay.durationInFrames : registeredFrozenFrame) * isMedia.data.playbackRate : null;
|
|
5503
|
-
|
|
5802
|
+
useEffect3(() => {
|
|
5504
5803
|
if (!env.isStudio) {
|
|
5505
5804
|
return;
|
|
5506
5805
|
}
|
|
@@ -5621,7 +5920,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5621
5920
|
]);
|
|
5622
5921
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
5623
5922
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
5624
|
-
const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */
|
|
5923
|
+
const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */ jsx12(Freeze, {
|
|
5625
5924
|
frame: freeze,
|
|
5626
5925
|
children: content
|
|
5627
5926
|
});
|
|
@@ -5633,7 +5932,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5633
5932
|
bottom: resolvedCropBottom,
|
|
5634
5933
|
style: styleIfThere
|
|
5635
5934
|
});
|
|
5636
|
-
const sequenceRef =
|
|
5935
|
+
const sequenceRef = useCallback6((node) => {
|
|
5637
5936
|
wrapperRefForOutline.current = node;
|
|
5638
5937
|
if (typeof ref === "function") {
|
|
5639
5938
|
ref(node);
|
|
@@ -5641,7 +5940,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5641
5940
|
ref.current = node;
|
|
5642
5941
|
}
|
|
5643
5942
|
}, [ref]);
|
|
5644
|
-
const defaultStyle =
|
|
5943
|
+
const defaultStyle = useMemo15(() => {
|
|
5645
5944
|
return {
|
|
5646
5945
|
flexDirection: undefined,
|
|
5647
5946
|
...width ? { width } : {},
|
|
@@ -5658,9 +5957,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5658
5957
|
if (hidden) {
|
|
5659
5958
|
return null;
|
|
5660
5959
|
}
|
|
5661
|
-
return /* @__PURE__ */
|
|
5960
|
+
return /* @__PURE__ */ jsx12(SequenceContext.Provider, {
|
|
5662
5961
|
value: contextValue,
|
|
5663
|
-
children: frozenContent === null ? null : other.layout === "none" ? frozenContent : /* @__PURE__ */
|
|
5962
|
+
children: frozenContent === null ? null : other.layout === "none" ? frozenContent : /* @__PURE__ */ jsx12(AbsoluteFillElement, {
|
|
5664
5963
|
ref: sequenceRef,
|
|
5665
5964
|
style: defaultStyle,
|
|
5666
5965
|
className: other.className,
|
|
@@ -5699,10 +5998,10 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
5699
5998
|
styleWhilePostmounted: styleWhilePostmounted ?? null,
|
|
5700
5999
|
hideWhilePremounted: "opacity"
|
|
5701
6000
|
});
|
|
5702
|
-
return /* @__PURE__ */
|
|
6001
|
+
return /* @__PURE__ */ jsx12(Freeze, {
|
|
5703
6002
|
frame: freezeFrame,
|
|
5704
6003
|
active: isPremountingOrPostmounting,
|
|
5705
|
-
children: /* @__PURE__ */
|
|
6004
|
+
children: /* @__PURE__ */ jsx12(SequenceInner, {
|
|
5706
6005
|
ref,
|
|
5707
6006
|
from,
|
|
5708
6007
|
durationInFrames,
|
|
@@ -5722,14 +6021,14 @@ var SequenceRefForwardingFunction = (props, ref) => {
|
|
|
5722
6021
|
if (props.layout !== "none" && !env.isRendering) {
|
|
5723
6022
|
const effectivePremountFor = ENABLE_V5_BREAKING_CHANGES ? props.premountFor ?? fps : props.premountFor;
|
|
5724
6023
|
if (effectivePremountFor || props.postmountFor) {
|
|
5725
|
-
return /* @__PURE__ */
|
|
6024
|
+
return /* @__PURE__ */ jsx12(PremountedPostmountedSequence, {
|
|
5726
6025
|
ref,
|
|
5727
6026
|
...props,
|
|
5728
6027
|
premountFor: effectivePremountFor
|
|
5729
6028
|
});
|
|
5730
6029
|
}
|
|
5731
6030
|
}
|
|
5732
|
-
return /* @__PURE__ */
|
|
6031
|
+
return /* @__PURE__ */ jsx12(RegularSequence, {
|
|
5733
6032
|
...props,
|
|
5734
6033
|
ref
|
|
5735
6034
|
});
|
|
@@ -5781,19 +6080,19 @@ var AbsoluteFillInner = ({
|
|
|
5781
6080
|
...divProps
|
|
5782
6081
|
}) => {
|
|
5783
6082
|
const videoConfig = useUnsafeVideoConfig();
|
|
5784
|
-
const refForOutline =
|
|
5785
|
-
const callbackRef =
|
|
6083
|
+
const refForOutline = useRef7(null);
|
|
6084
|
+
const callbackRef = useCallback7((element) => {
|
|
5786
6085
|
refForOutline.current = element;
|
|
5787
6086
|
setRef(ref, element);
|
|
5788
6087
|
}, [ref]);
|
|
5789
6088
|
if (videoConfig === null) {
|
|
5790
|
-
return hidden ? null : /* @__PURE__ */
|
|
6089
|
+
return hidden ? null : /* @__PURE__ */ jsx13(AbsoluteFillElement, {
|
|
5791
6090
|
ref: callbackRef,
|
|
5792
6091
|
...divProps,
|
|
5793
6092
|
children
|
|
5794
6093
|
});
|
|
5795
6094
|
}
|
|
5796
|
-
return /* @__PURE__ */
|
|
6095
|
+
return /* @__PURE__ */ jsx13(Sequence, {
|
|
5797
6096
|
layout: "none",
|
|
5798
6097
|
from: from ?? 0,
|
|
5799
6098
|
trimBefore,
|
|
@@ -5806,7 +6105,7 @@ var AbsoluteFillInner = ({
|
|
|
5806
6105
|
_remotionInternalStack: stack,
|
|
5807
6106
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/absolute-fill",
|
|
5808
6107
|
outlineRef: refForOutline,
|
|
5809
|
-
children: /* @__PURE__ */
|
|
6108
|
+
children: /* @__PURE__ */ jsx13(AbsoluteFillElement, {
|
|
5810
6109
|
ref: callbackRef,
|
|
5811
6110
|
...divProps,
|
|
5812
6111
|
children
|
|
@@ -5821,305 +6120,6 @@ var AbsoluteFill = withInteractivitySchema({
|
|
|
5821
6120
|
supportsEffects: false
|
|
5822
6121
|
});
|
|
5823
6122
|
addSequenceStackTraces(AbsoluteFill);
|
|
5824
|
-
var rotate = {
|
|
5825
|
-
transform: `rotate(90deg)`
|
|
5826
|
-
};
|
|
5827
|
-
var ICON_SIZE = 40;
|
|
5828
|
-
var label = {
|
|
5829
|
-
color: "white",
|
|
5830
|
-
fontSize: 14,
|
|
5831
|
-
fontFamily: "sans-serif"
|
|
5832
|
-
};
|
|
5833
|
-
var container = {
|
|
5834
|
-
justifyContent: "center",
|
|
5835
|
-
alignItems: "center"
|
|
5836
|
-
};
|
|
5837
|
-
var Loading = () => {
|
|
5838
|
-
return /* @__PURE__ */ jsxs2(AbsoluteFill, {
|
|
5839
|
-
style: container,
|
|
5840
|
-
id: "remotion-comp-loading",
|
|
5841
|
-
children: [
|
|
5842
|
-
/* @__PURE__ */ jsx12("style", {
|
|
5843
|
-
type: "text/css",
|
|
5844
|
-
children: `
|
|
5845
|
-
@keyframes anim {
|
|
5846
|
-
from {
|
|
5847
|
-
opacity: 0
|
|
5848
|
-
}
|
|
5849
|
-
to {
|
|
5850
|
-
opacity: 1
|
|
5851
|
-
}
|
|
5852
|
-
}
|
|
5853
|
-
#remotion-comp-loading {
|
|
5854
|
-
animation: anim 2s;
|
|
5855
|
-
animation-fill-mode: forwards;
|
|
5856
|
-
}
|
|
5857
|
-
`
|
|
5858
|
-
}),
|
|
5859
|
-
/* @__PURE__ */ jsx12("svg", {
|
|
5860
|
-
width: ICON_SIZE,
|
|
5861
|
-
height: ICON_SIZE,
|
|
5862
|
-
viewBox: "-100 -100 400 400",
|
|
5863
|
-
style: rotate,
|
|
5864
|
-
children: /* @__PURE__ */ jsx12("path", {
|
|
5865
|
-
fill: "#555",
|
|
5866
|
-
stroke: "#555",
|
|
5867
|
-
strokeWidth: "100",
|
|
5868
|
-
strokeLinejoin: "round",
|
|
5869
|
-
d: "M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z"
|
|
5870
|
-
})
|
|
5871
|
-
}),
|
|
5872
|
-
/* @__PURE__ */ jsxs2("p", {
|
|
5873
|
-
style: label,
|
|
5874
|
-
children: [
|
|
5875
|
-
"Resolving ",
|
|
5876
|
-
"<Suspense>",
|
|
5877
|
-
"..."
|
|
5878
|
-
]
|
|
5879
|
-
})
|
|
5880
|
-
]
|
|
5881
|
-
});
|
|
5882
|
-
};
|
|
5883
|
-
var _portalNode = null;
|
|
5884
|
-
var portalNode = () => {
|
|
5885
|
-
if (!_portalNode) {
|
|
5886
|
-
if (typeof document === "undefined") {
|
|
5887
|
-
throw new Error("Tried to call an API that only works in the browser from outside the browser");
|
|
5888
|
-
}
|
|
5889
|
-
_portalNode = document.createElement("div");
|
|
5890
|
-
_portalNode.style.position = "absolute";
|
|
5891
|
-
_portalNode.style.top = "0px";
|
|
5892
|
-
_portalNode.style.left = "0px";
|
|
5893
|
-
_portalNode.style.right = "0px";
|
|
5894
|
-
_portalNode.style.bottom = "0px";
|
|
5895
|
-
_portalNode.style.width = "100%";
|
|
5896
|
-
_portalNode.style.height = "100%";
|
|
5897
|
-
_portalNode.style.display = "flex";
|
|
5898
|
-
_portalNode.style.flexDirection = "column";
|
|
5899
|
-
const containerNode = document.createElement("div");
|
|
5900
|
-
containerNode.style.position = "fixed";
|
|
5901
|
-
containerNode.style.top = -999999 + "px";
|
|
5902
|
-
containerNode.appendChild(_portalNode);
|
|
5903
|
-
document.body.appendChild(containerNode);
|
|
5904
|
-
}
|
|
5905
|
-
return _portalNode;
|
|
5906
|
-
};
|
|
5907
|
-
var useLazyComponent = ({
|
|
5908
|
-
compProps,
|
|
5909
|
-
componentName,
|
|
5910
|
-
noSuspense
|
|
5911
|
-
}) => {
|
|
5912
|
-
const componentRef = useRef7(null);
|
|
5913
|
-
if ("component" in compProps) {
|
|
5914
|
-
componentRef.current = compProps.component;
|
|
5915
|
-
}
|
|
5916
|
-
const lazy = useMemo15(() => {
|
|
5917
|
-
if ("component" in compProps) {
|
|
5918
|
-
if (typeof document === "undefined" || noSuspense) {
|
|
5919
|
-
return compProps.component;
|
|
5920
|
-
}
|
|
5921
|
-
if (typeof compProps.component === "undefined") {
|
|
5922
|
-
throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
5923
|
-
}
|
|
5924
|
-
const Wrapper = (props) => {
|
|
5925
|
-
const Comp = componentRef.current;
|
|
5926
|
-
return React15.createElement(Comp, props);
|
|
5927
|
-
};
|
|
5928
|
-
return Wrapper;
|
|
5929
|
-
}
|
|
5930
|
-
if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
|
|
5931
|
-
if (typeof compProps.lazyComponent === "undefined") {
|
|
5932
|
-
throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
5933
|
-
}
|
|
5934
|
-
return React15.lazy(compProps.lazyComponent);
|
|
5935
|
-
}
|
|
5936
|
-
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
5937
|
-
}, [compProps.lazyComponent]);
|
|
5938
|
-
return lazy;
|
|
5939
|
-
};
|
|
5940
|
-
var getRegex2 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
5941
|
-
var isCompositionIdValid = (id) => id.match(getRegex2());
|
|
5942
|
-
var validateCompositionId = (id) => {
|
|
5943
|
-
if (!isCompositionIdValid(id)) {
|
|
5944
|
-
throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`);
|
|
5945
|
-
}
|
|
5946
|
-
};
|
|
5947
|
-
var invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex2())}`;
|
|
5948
|
-
var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
5949
|
-
if (!defaultProps) {
|
|
5950
|
-
return;
|
|
5951
|
-
}
|
|
5952
|
-
if (typeof defaultProps !== "object") {
|
|
5953
|
-
throw new Error(`"${name}" must be an object, but you passed a value of type ${typeof defaultProps}`);
|
|
5954
|
-
}
|
|
5955
|
-
if (Array.isArray(defaultProps)) {
|
|
5956
|
-
throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
|
|
5957
|
-
}
|
|
5958
|
-
};
|
|
5959
|
-
var Fallback = () => {
|
|
5960
|
-
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
5961
|
-
useEffect3(() => {
|
|
5962
|
-
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
5963
|
-
return () => continueRender2(fallback);
|
|
5964
|
-
}, [continueRender2, delayRender2]);
|
|
5965
|
-
return null;
|
|
5966
|
-
};
|
|
5967
|
-
var InnerComposition = ({
|
|
5968
|
-
width,
|
|
5969
|
-
height,
|
|
5970
|
-
fps,
|
|
5971
|
-
durationInFrames,
|
|
5972
|
-
id,
|
|
5973
|
-
defaultProps,
|
|
5974
|
-
schema,
|
|
5975
|
-
...compProps
|
|
5976
|
-
}) => {
|
|
5977
|
-
const compManager = useContext18(CompositionSetters);
|
|
5978
|
-
const { registerComposition, unregisterComposition } = compManager;
|
|
5979
|
-
const video = useVideo();
|
|
5980
|
-
const lazy = useLazyComponent({
|
|
5981
|
-
compProps,
|
|
5982
|
-
componentName: "Composition",
|
|
5983
|
-
noSuspense: false
|
|
5984
|
-
});
|
|
5985
|
-
const nonce = useNonce();
|
|
5986
|
-
const isPlayer = useIsPlayer();
|
|
5987
|
-
const environment = useRemotionEnvironment();
|
|
5988
|
-
const canUseComposition = useContext18(CanUseRemotionHooks);
|
|
5989
|
-
if (typeof window !== "undefined") {
|
|
5990
|
-
window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
|
|
5991
|
-
}
|
|
5992
|
-
if (canUseComposition) {
|
|
5993
|
-
if (isPlayer) {
|
|
5994
|
-
throw new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
5995
|
-
}
|
|
5996
|
-
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
5997
|
-
}
|
|
5998
|
-
const { folderName, parentName } = useContext18(FolderContext);
|
|
5999
|
-
const stack = compProps._remotionInternalStack ?? null;
|
|
6000
|
-
const componentFromProps = "component" in compProps ? compProps.component : null;
|
|
6001
|
-
useEffect3(() => {
|
|
6002
|
-
if (!id) {
|
|
6003
|
-
throw new Error("No id for composition passed.");
|
|
6004
|
-
}
|
|
6005
|
-
validateCompositionId(id);
|
|
6006
|
-
validateDefaultAndInputProps(defaultProps, "defaultProps", id);
|
|
6007
|
-
registerComposition({
|
|
6008
|
-
durationInFrames: durationInFrames ?? undefined,
|
|
6009
|
-
fps: fps ?? undefined,
|
|
6010
|
-
height: height ?? undefined,
|
|
6011
|
-
width: width ?? undefined,
|
|
6012
|
-
id,
|
|
6013
|
-
folderName,
|
|
6014
|
-
component: lazy,
|
|
6015
|
-
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
6016
|
-
nonce: nonce.get(),
|
|
6017
|
-
parentFolderName: parentName,
|
|
6018
|
-
componentFromProps,
|
|
6019
|
-
schema: schema ?? null,
|
|
6020
|
-
calculateMetadata: compProps.calculateMetadata ?? null,
|
|
6021
|
-
stack
|
|
6022
|
-
});
|
|
6023
|
-
return () => {
|
|
6024
|
-
unregisterComposition(id);
|
|
6025
|
-
};
|
|
6026
|
-
}, [
|
|
6027
|
-
durationInFrames,
|
|
6028
|
-
fps,
|
|
6029
|
-
height,
|
|
6030
|
-
lazy,
|
|
6031
|
-
id,
|
|
6032
|
-
folderName,
|
|
6033
|
-
defaultProps,
|
|
6034
|
-
width,
|
|
6035
|
-
nonce,
|
|
6036
|
-
parentName,
|
|
6037
|
-
componentFromProps,
|
|
6038
|
-
schema,
|
|
6039
|
-
compProps.calculateMetadata,
|
|
6040
|
-
stack,
|
|
6041
|
-
registerComposition,
|
|
6042
|
-
unregisterComposition
|
|
6043
|
-
]);
|
|
6044
|
-
const resolved = useResolvedVideoConfig(id);
|
|
6045
|
-
const { setError, clearError } = useContext18(CompositionRenderErrorContext);
|
|
6046
|
-
const onError = useCallback7((error2) => {
|
|
6047
|
-
setError(error2);
|
|
6048
|
-
}, [setError]);
|
|
6049
|
-
const onClear = useCallback7(() => {
|
|
6050
|
-
clearError();
|
|
6051
|
-
}, [clearError]);
|
|
6052
|
-
if (environment.isStudio && video && video.component === lazy && video.id === id) {
|
|
6053
|
-
const Comp = lazy;
|
|
6054
|
-
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
6055
|
-
return null;
|
|
6056
|
-
}
|
|
6057
|
-
return createPortal(/* @__PURE__ */ jsx13(CanUseRemotionHooksProvider, {
|
|
6058
|
-
children: /* @__PURE__ */ jsx13(CompositionErrorBoundary, {
|
|
6059
|
-
onError,
|
|
6060
|
-
onClear,
|
|
6061
|
-
children: /* @__PURE__ */ jsx13(Suspense, {
|
|
6062
|
-
fallback: /* @__PURE__ */ jsx13(Loading, {}),
|
|
6063
|
-
children: /* @__PURE__ */ jsx13(Comp, {
|
|
6064
|
-
...resolved.result.props ?? {}
|
|
6065
|
-
})
|
|
6066
|
-
})
|
|
6067
|
-
})
|
|
6068
|
-
}), portalNode());
|
|
6069
|
-
}
|
|
6070
|
-
if (environment.isRendering && video && video.component === lazy && video.id === id) {
|
|
6071
|
-
const Comp = lazy;
|
|
6072
|
-
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
6073
|
-
return null;
|
|
6074
|
-
}
|
|
6075
|
-
return createPortal(/* @__PURE__ */ jsx13(CanUseRemotionHooksProvider, {
|
|
6076
|
-
children: /* @__PURE__ */ jsx13(Suspense, {
|
|
6077
|
-
fallback: /* @__PURE__ */ jsx13(Fallback, {}),
|
|
6078
|
-
children: /* @__PURE__ */ jsx13(Comp, {
|
|
6079
|
-
...resolved.result.props ?? {}
|
|
6080
|
-
})
|
|
6081
|
-
})
|
|
6082
|
-
}), portalNode());
|
|
6083
|
-
}
|
|
6084
|
-
return null;
|
|
6085
|
-
};
|
|
6086
|
-
var Composition = (props) => {
|
|
6087
|
-
const { onlyRenderComposition } = useContext18(CompositionSetters);
|
|
6088
|
-
if (onlyRenderComposition && onlyRenderComposition !== props.id) {
|
|
6089
|
-
return null;
|
|
6090
|
-
}
|
|
6091
|
-
return /* @__PURE__ */ jsx13(InnerComposition, {
|
|
6092
|
-
...props
|
|
6093
|
-
});
|
|
6094
|
-
};
|
|
6095
|
-
var VERSION = "4.0.501";
|
|
6096
|
-
var checkMultipleRemotionVersions = () => {
|
|
6097
|
-
if (typeof globalThis === "undefined") {
|
|
6098
|
-
return;
|
|
6099
|
-
}
|
|
6100
|
-
const set = () => {
|
|
6101
|
-
globalThis.remotion_imported = VERSION;
|
|
6102
|
-
if (typeof window !== "undefined") {
|
|
6103
|
-
window.remotion_imported = VERSION;
|
|
6104
|
-
}
|
|
6105
|
-
};
|
|
6106
|
-
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
6107
|
-
if (alreadyImported) {
|
|
6108
|
-
if (alreadyImported === VERSION) {
|
|
6109
|
-
return;
|
|
6110
|
-
}
|
|
6111
|
-
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
6112
|
-
set();
|
|
6113
|
-
return;
|
|
6114
|
-
}
|
|
6115
|
-
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
6116
|
-
VERSION,
|
|
6117
|
-
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
6118
|
-
].filter(truthy).join(" and ")}. This will cause things to break in an unexpected way.
|
|
6119
|
-
Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
|
|
6120
|
-
}
|
|
6121
|
-
set();
|
|
6122
|
-
};
|
|
6123
6123
|
var useCropStyle = ({
|
|
6124
6124
|
cropLeft,
|
|
6125
6125
|
cropRight,
|
|
@@ -14405,7 +14405,7 @@ import { useMemo as useMemo55 } from "react";
|
|
|
14405
14405
|
|
|
14406
14406
|
// ../design/dist/esm/index.mjs
|
|
14407
14407
|
import * as React25 from "react";
|
|
14408
|
-
import * as
|
|
14408
|
+
import * as React8 from "react";
|
|
14409
14409
|
import { Fragment as Fragment22, jsx as jsx46 } from "react/jsx-runtime";
|
|
14410
14410
|
import React52, { useCallback as useCallback28, useRef as useRef210, useState as useState22 } from "react";
|
|
14411
14411
|
|
|
@@ -21442,21 +21442,21 @@ import { jsx as jsx113 } from "react/jsx-runtime";
|
|
|
21442
21442
|
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
21443
21443
|
import * as React362 from "react";
|
|
21444
21444
|
import * as ReactDOM4 from "react-dom";
|
|
21445
|
-
import
|
|
21445
|
+
import React11 from "react";
|
|
21446
21446
|
import * as React82 from "react";
|
|
21447
21447
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
21448
|
-
import * as
|
|
21449
|
-
import * as
|
|
21448
|
+
import * as React92 from "react";
|
|
21449
|
+
import * as React10 from "react";
|
|
21450
21450
|
import { Fragment as Fragment5, jsx as jsx142 } from "react/jsx-runtime";
|
|
21451
21451
|
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
21452
21452
|
import * as React122 from "react";
|
|
21453
21453
|
import { jsx as jsx162 } from "react/jsx-runtime";
|
|
21454
21454
|
import * as React16 from "react";
|
|
21455
|
-
import * as
|
|
21455
|
+
import * as React132 from "react";
|
|
21456
21456
|
import * as ReactDOM from "react-dom";
|
|
21457
21457
|
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
21458
|
-
import * as
|
|
21459
|
-
import * as
|
|
21458
|
+
import * as React142 from "react";
|
|
21459
|
+
import * as React15 from "react";
|
|
21460
21460
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
21461
21461
|
import * as React172 from "react";
|
|
21462
21462
|
import * as React182 from "react";
|
|
@@ -21553,7 +21553,7 @@ function composeRefs(...refs) {
|
|
|
21553
21553
|
};
|
|
21554
21554
|
}
|
|
21555
21555
|
function useComposedRefs(...refs) {
|
|
21556
|
-
return
|
|
21556
|
+
return React8.useCallback(composeRefs(...refs), refs);
|
|
21557
21557
|
}
|
|
21558
21558
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
21559
21559
|
var use = React25[" use ".trim().toString()];
|
|
@@ -22342,45 +22342,45 @@ function composeRefs2(...refs) {
|
|
|
22342
22342
|
return (node) => refs.forEach((ref) => setRef22(ref, node));
|
|
22343
22343
|
}
|
|
22344
22344
|
function useComposedRefs2(...refs) {
|
|
22345
|
-
return
|
|
22345
|
+
return React92.useCallback(composeRefs2(...refs), refs);
|
|
22346
22346
|
}
|
|
22347
|
-
var Slot2 =
|
|
22347
|
+
var Slot2 = React10.forwardRef((props, forwardedRef) => {
|
|
22348
22348
|
const { children, ...slotProps } = props;
|
|
22349
|
-
const childrenArray =
|
|
22349
|
+
const childrenArray = React10.Children.toArray(children);
|
|
22350
22350
|
const slottable = childrenArray.find(isSlottable2);
|
|
22351
22351
|
if (slottable) {
|
|
22352
22352
|
const newElement = slottable.props.children;
|
|
22353
22353
|
const newChildren = childrenArray.map((child) => {
|
|
22354
22354
|
if (child === slottable) {
|
|
22355
|
-
if (
|
|
22356
|
-
return
|
|
22357
|
-
return
|
|
22355
|
+
if (React10.Children.count(newElement) > 1)
|
|
22356
|
+
return React10.Children.only(null);
|
|
22357
|
+
return React10.isValidElement(newElement) ? newElement.props.children : null;
|
|
22358
22358
|
} else {
|
|
22359
22359
|
return child;
|
|
22360
22360
|
}
|
|
22361
22361
|
});
|
|
22362
|
-
return /* @__PURE__ */ jsx142(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
22362
|
+
return /* @__PURE__ */ jsx142(SlotClone, { ...slotProps, ref: forwardedRef, children: React10.isValidElement(newElement) ? React10.cloneElement(newElement, undefined, newChildren) : null });
|
|
22363
22363
|
}
|
|
22364
22364
|
return /* @__PURE__ */ jsx142(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
22365
22365
|
});
|
|
22366
22366
|
Slot2.displayName = "Slot";
|
|
22367
|
-
var SlotClone =
|
|
22367
|
+
var SlotClone = React10.forwardRef((props, forwardedRef) => {
|
|
22368
22368
|
const { children, ...slotProps } = props;
|
|
22369
|
-
if (
|
|
22369
|
+
if (React10.isValidElement(children)) {
|
|
22370
22370
|
const childrenRef = getElementRef2(children);
|
|
22371
|
-
return
|
|
22371
|
+
return React10.cloneElement(children, {
|
|
22372
22372
|
...mergeProps2(slotProps, children.props),
|
|
22373
22373
|
ref: forwardedRef ? composeRefs2(forwardedRef, childrenRef) : childrenRef
|
|
22374
22374
|
});
|
|
22375
22375
|
}
|
|
22376
|
-
return
|
|
22376
|
+
return React10.Children.count(children) > 1 ? React10.Children.only(null) : null;
|
|
22377
22377
|
});
|
|
22378
22378
|
SlotClone.displayName = "SlotClone";
|
|
22379
22379
|
var Slottable2 = ({ children }) => {
|
|
22380
22380
|
return /* @__PURE__ */ jsx142(Fragment5, { children });
|
|
22381
22381
|
};
|
|
22382
22382
|
function isSlottable2(child) {
|
|
22383
|
-
return
|
|
22383
|
+
return React10.isValidElement(child) && child.type === Slottable2;
|
|
22384
22384
|
}
|
|
22385
22385
|
function mergeProps2(slotProps, childProps) {
|
|
22386
22386
|
const overrideProps = { ...childProps };
|
|
@@ -22424,13 +22424,13 @@ function createCollection(name) {
|
|
|
22424
22424
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map });
|
|
22425
22425
|
const CollectionProvider = (props) => {
|
|
22426
22426
|
const { scope, children } = props;
|
|
22427
|
-
const ref =
|
|
22428
|
-
const itemMap =
|
|
22427
|
+
const ref = React11.useRef(null);
|
|
22428
|
+
const itemMap = React11.useRef(/* @__PURE__ */ new Map).current;
|
|
22429
22429
|
return /* @__PURE__ */ jsx152(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
22430
22430
|
};
|
|
22431
22431
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
22432
22432
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
22433
|
-
const CollectionSlot =
|
|
22433
|
+
const CollectionSlot = React11.forwardRef((props, forwardedRef) => {
|
|
22434
22434
|
const { scope, children } = props;
|
|
22435
22435
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
22436
22436
|
const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);
|
|
@@ -22439,12 +22439,12 @@ function createCollection(name) {
|
|
|
22439
22439
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
22440
22440
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
22441
22441
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
22442
|
-
const CollectionItemSlot =
|
|
22442
|
+
const CollectionItemSlot = React11.forwardRef((props, forwardedRef) => {
|
|
22443
22443
|
const { scope, children, ...itemData } = props;
|
|
22444
|
-
const ref =
|
|
22444
|
+
const ref = React11.useRef(null);
|
|
22445
22445
|
const composedRefs = useComposedRefs2(forwardedRef, ref);
|
|
22446
22446
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
22447
|
-
|
|
22447
|
+
React11.useEffect(() => {
|
|
22448
22448
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
22449
22449
|
return () => void context.itemMap.delete(ref);
|
|
22450
22450
|
});
|
|
@@ -22453,7 +22453,7 @@ function createCollection(name) {
|
|
|
22453
22453
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
22454
22454
|
function useCollection(scope) {
|
|
22455
22455
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
22456
|
-
const getItems =
|
|
22456
|
+
const getItems = React11.useCallback(() => {
|
|
22457
22457
|
const collectionNode = context.collectionRef.current;
|
|
22458
22458
|
if (!collectionNode)
|
|
22459
22459
|
return [];
|
|
@@ -22494,7 +22494,7 @@ var NODES = [
|
|
|
22494
22494
|
"ul"
|
|
22495
22495
|
];
|
|
22496
22496
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
22497
|
-
const Node2 =
|
|
22497
|
+
const Node2 = React132.forwardRef((props, forwardedRef) => {
|
|
22498
22498
|
const { asChild, ...primitiveProps } = props;
|
|
22499
22499
|
const Comp = asChild ? Slot2 : node;
|
|
22500
22500
|
if (typeof window !== "undefined") {
|
|
@@ -22510,15 +22510,15 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
22510
22510
|
ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
22511
22511
|
}
|
|
22512
22512
|
function useCallbackRef(callback) {
|
|
22513
|
-
const callbackRef =
|
|
22514
|
-
|
|
22513
|
+
const callbackRef = React142.useRef(callback);
|
|
22514
|
+
React142.useEffect(() => {
|
|
22515
22515
|
callbackRef.current = callback;
|
|
22516
22516
|
});
|
|
22517
|
-
return
|
|
22517
|
+
return React142.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
22518
22518
|
}
|
|
22519
22519
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
22520
22520
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
22521
|
-
|
|
22521
|
+
React15.useEffect(() => {
|
|
22522
22522
|
const handleKeyDown = (event) => {
|
|
22523
22523
|
if (event.key === "Escape") {
|
|
22524
22524
|
onEscapeKeyDown(event);
|
|
@@ -29452,14 +29452,16 @@ import { jsx as jsx48, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
|
29452
29452
|
var container3 = {
|
|
29453
29453
|
display: "flex",
|
|
29454
29454
|
flexDirection: "row",
|
|
29455
|
-
alignItems: "
|
|
29455
|
+
alignItems: "flex-start",
|
|
29456
29456
|
gap: "10px"
|
|
29457
29457
|
};
|
|
29458
29458
|
var greyCircle = {
|
|
29459
29459
|
width: 20,
|
|
29460
29460
|
height: 20,
|
|
29461
29461
|
borderRadius: 10,
|
|
29462
|
-
backgroundColor: "var(--footer-border)"
|
|
29462
|
+
backgroundColor: "var(--footer-border)",
|
|
29463
|
+
flexShrink: 0,
|
|
29464
|
+
marginTop: 4
|
|
29463
29465
|
};
|
|
29464
29466
|
var PricingBulletPoint = ({ text, checked, children }) => {
|
|
29465
29467
|
const checkmarkSVG = /* @__PURE__ */ jsxs9("svg", {
|
|
@@ -29469,7 +29471,8 @@ var PricingBulletPoint = ({ text, checked, children }) => {
|
|
|
29469
29471
|
fill: "none",
|
|
29470
29472
|
xmlns: "http://www.w3.org/2000/svg",
|
|
29471
29473
|
style: {
|
|
29472
|
-
flexShrink: 0
|
|
29474
|
+
flexShrink: 0,
|
|
29475
|
+
marginTop: 4
|
|
29473
29476
|
},
|
|
29474
29477
|
children: [
|
|
29475
29478
|
/* @__PURE__ */ jsx48("circle", {
|
|
@@ -29519,7 +29522,7 @@ var Title = ({ children }) => {
|
|
|
29519
29522
|
};
|
|
29520
29523
|
var Audience = ({ children }) => {
|
|
29521
29524
|
return /* @__PURE__ */ jsx50("div", {
|
|
29522
|
-
className: "fontbrand text-lg leading-
|
|
29525
|
+
className: "fontbrand text-lg leading-snug",
|
|
29523
29526
|
children
|
|
29524
29527
|
});
|
|
29525
29528
|
};
|
|
@@ -30536,7 +30539,7 @@ import {
|
|
|
30536
30539
|
useRef as useRef122,
|
|
30537
30540
|
useState as useState132
|
|
30538
30541
|
} from "react";
|
|
30539
|
-
import
|
|
30542
|
+
import React102, {
|
|
30540
30543
|
Suspense as Suspense2,
|
|
30541
30544
|
forwardRef as forwardRef36,
|
|
30542
30545
|
useCallback as useCallback102,
|
|
@@ -32222,7 +32225,7 @@ import {
|
|
|
32222
32225
|
useRef as useRef142,
|
|
32223
32226
|
useState as useState142
|
|
32224
32227
|
} from "react";
|
|
32225
|
-
import
|
|
32228
|
+
import React133, {
|
|
32226
32229
|
forwardRef as forwardRef37,
|
|
32227
32230
|
Suspense as Suspense22,
|
|
32228
32231
|
useCallback as useCallback122,
|
|
@@ -34601,7 +34604,7 @@ var useClickPreventionOnDoubleClick = (onClick, onDoubleClick, doubleClickToFull
|
|
|
34601
34604
|
}, [doubleClickToFullscreen, handleDoubleClick, handlePointerDown, onClick]);
|
|
34602
34605
|
return returnValue;
|
|
34603
34606
|
};
|
|
34604
|
-
var reactVersion =
|
|
34607
|
+
var reactVersion = React102.version.split(".")[0];
|
|
34605
34608
|
if (reactVersion === "0") {
|
|
34606
34609
|
throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
|
|
34607
34610
|
}
|
|
@@ -35618,7 +35621,7 @@ var useThumbnail = () => {
|
|
|
35618
35621
|
}, [emitter]);
|
|
35619
35622
|
return returnValue;
|
|
35620
35623
|
};
|
|
35621
|
-
var reactVersion2 =
|
|
35624
|
+
var reactVersion2 = React133.version.split(".")[0];
|
|
35622
35625
|
if (reactVersion2 === "0") {
|
|
35623
35626
|
throw new Error(`Version ${reactVersion2} of "react" is not supported by Remotion`);
|
|
35624
35627
|
}
|
|
@@ -44013,7 +44016,7 @@ import {
|
|
|
44013
44016
|
import { BufferTarget, StreamTarget } from "mediabunny";
|
|
44014
44017
|
|
|
44015
44018
|
// ../core/dist/esm/version.mjs
|
|
44016
|
-
var VERSION2 = "4.0.
|
|
44019
|
+
var VERSION2 = "4.0.503";
|
|
44017
44020
|
|
|
44018
44021
|
// ../web-renderer/dist/esm/index.mjs
|
|
44019
44022
|
import { AudioSample, VideoSample } from "mediabunny";
|
|
@@ -44588,15 +44591,17 @@ var runNestedHtmlInCanvasProbe = () => {
|
|
|
44588
44591
|
const innerTarget = document.createElement("div");
|
|
44589
44592
|
const outerCtx = outer.getContext("2d");
|
|
44590
44593
|
const innerCtx = inner2.getContext("2d");
|
|
44594
|
+
const density = devicePixelRatio;
|
|
44595
|
+
const canvasSize = Math.ceil(4 * density);
|
|
44591
44596
|
if (!outerCtx || !innerCtx || typeof outer.requestPaint !== "function" || typeof inner2.requestPaint !== "function") {
|
|
44592
44597
|
return Promise.resolve(false);
|
|
44593
44598
|
}
|
|
44594
44599
|
outer.layoutSubtree = true;
|
|
44595
44600
|
inner2.layoutSubtree = true;
|
|
44596
|
-
outer.width =
|
|
44597
|
-
outer.height =
|
|
44598
|
-
inner2.width =
|
|
44599
|
-
inner2.height =
|
|
44601
|
+
outer.width = canvasSize;
|
|
44602
|
+
outer.height = canvasSize;
|
|
44603
|
+
inner2.width = canvasSize;
|
|
44604
|
+
inner2.height = canvasSize;
|
|
44600
44605
|
Object.assign(outer.style, {
|
|
44601
44606
|
display: "block",
|
|
44602
44607
|
height: "4px",
|
|
@@ -44647,10 +44652,10 @@ var runNestedHtmlInCanvasProbe = () => {
|
|
|
44647
44652
|
inner2.addEventListener("paint", () => {
|
|
44648
44653
|
try {
|
|
44649
44654
|
innerCtx.reset();
|
|
44655
|
+
innerCtx.scale(density, density);
|
|
44650
44656
|
const transform = innerCtx.drawElementImage(innerTarget, 0, 0, 4, 4);
|
|
44651
44657
|
innerTarget.style.transform = transform.toString();
|
|
44652
44658
|
innerPainted = true;
|
|
44653
|
-
requestAnimationFrame(() => outer.requestPaint());
|
|
44654
44659
|
} catch {
|
|
44655
44660
|
settle(false);
|
|
44656
44661
|
}
|
|
@@ -44661,6 +44666,7 @@ var runNestedHtmlInCanvasProbe = () => {
|
|
|
44661
44666
|
}
|
|
44662
44667
|
try {
|
|
44663
44668
|
outerCtx.reset();
|
|
44669
|
+
outerCtx.scale(density, density);
|
|
44664
44670
|
if (typeof outer.captureElementImage !== "function") {
|
|
44665
44671
|
settle(false);
|
|
44666
44672
|
return;
|
|
@@ -44669,13 +44675,15 @@ var runNestedHtmlInCanvasProbe = () => {
|
|
|
44669
44675
|
const transform = outerCtx.drawElementImage(elementImage, 0, 0, 4, 4);
|
|
44670
44676
|
elementImage.close();
|
|
44671
44677
|
outerTarget.style.transform = transform.toString();
|
|
44672
|
-
const
|
|
44678
|
+
const sampleCoordinate = Math.floor(canvasSize / 2);
|
|
44679
|
+
const pixel = outerCtx.getImageData(sampleCoordinate, sampleCoordinate, 1, 1).data;
|
|
44673
44680
|
settle(pixel[0] > 200 && pixel[1] < 20 && pixel[2] < 20 && pixel[3] > 200);
|
|
44674
44681
|
} catch {
|
|
44675
44682
|
settle(false);
|
|
44676
44683
|
}
|
|
44677
44684
|
});
|
|
44678
44685
|
inner2.requestPaint();
|
|
44686
|
+
outer.requestPaint();
|
|
44679
44687
|
});
|
|
44680
44688
|
};
|
|
44681
44689
|
var supportsNestedHtmlInCanvas = () => {
|
|
@@ -45061,7 +45069,110 @@ var getRealFrameRange = (durationInFrames, frameRange) => {
|
|
|
45061
45069
|
}
|
|
45062
45070
|
return resolved;
|
|
45063
45071
|
};
|
|
45064
|
-
var
|
|
45072
|
+
var makeMaskImageLoaderState = ({
|
|
45073
|
+
signal,
|
|
45074
|
+
timeoutInMilliseconds
|
|
45075
|
+
}) => {
|
|
45076
|
+
const images = new Set;
|
|
45077
|
+
return {
|
|
45078
|
+
cache: new Map,
|
|
45079
|
+
images,
|
|
45080
|
+
signal,
|
|
45081
|
+
timeoutInMilliseconds,
|
|
45082
|
+
[Symbol.dispose]: () => {
|
|
45083
|
+
for (const image of images) {
|
|
45084
|
+
image.close();
|
|
45085
|
+
}
|
|
45086
|
+
images.clear();
|
|
45087
|
+
}
|
|
45088
|
+
};
|
|
45089
|
+
};
|
|
45090
|
+
var validateMaskImageUrl = (src) => {
|
|
45091
|
+
const url = new URL(src, document.baseURI);
|
|
45092
|
+
if (url.protocol === "data:" || url.protocol === "blob:") {
|
|
45093
|
+
return url.href;
|
|
45094
|
+
}
|
|
45095
|
+
if ((url.protocol === "http:" || url.protocol === "https:") && url.origin === window.location.origin) {
|
|
45096
|
+
return url.href;
|
|
45097
|
+
}
|
|
45098
|
+
throw new Error(`@remotion/web-renderer only supports same-origin, data:, and blob: mask-image URLs. Received: ${url.href}`);
|
|
45099
|
+
};
|
|
45100
|
+
var loadMaskImage = async ({
|
|
45101
|
+
src,
|
|
45102
|
+
state
|
|
45103
|
+
}) => {
|
|
45104
|
+
const resolvedSrc = validateMaskImageUrl(src);
|
|
45105
|
+
if (state.signal?.aborted) {
|
|
45106
|
+
throw new Error(`Loading mask-image URL was cancelled: ${resolvedSrc}`);
|
|
45107
|
+
}
|
|
45108
|
+
const controller = new AbortController;
|
|
45109
|
+
let timedOut = false;
|
|
45110
|
+
const onAbort = () => controller.abort();
|
|
45111
|
+
state.signal?.addEventListener("abort", onAbort, { once: true });
|
|
45112
|
+
const timeout = window.setTimeout(() => {
|
|
45113
|
+
timedOut = true;
|
|
45114
|
+
controller.abort();
|
|
45115
|
+
}, state.timeoutInMilliseconds);
|
|
45116
|
+
const operation = (async () => {
|
|
45117
|
+
const response = await fetch(resolvedSrc, {
|
|
45118
|
+
credentials: "same-origin",
|
|
45119
|
+
signal: controller.signal
|
|
45120
|
+
});
|
|
45121
|
+
if (!response.ok) {
|
|
45122
|
+
throw new Error(`HTTP ${response.status} ${response.statusText}`);
|
|
45123
|
+
}
|
|
45124
|
+
const blob = await response.blob();
|
|
45125
|
+
const contentType = blob.type.toLowerCase().split(";")[0];
|
|
45126
|
+
if (!contentType.startsWith("image/") || contentType === "image/svg+xml") {
|
|
45127
|
+
throw new Error(`Expected a raster image, but received Content-Type "${blob.type || "unknown"}"`);
|
|
45128
|
+
}
|
|
45129
|
+
return createImageBitmap(blob);
|
|
45130
|
+
})();
|
|
45131
|
+
operation.then((image) => {
|
|
45132
|
+
if (controller.signal.aborted) {
|
|
45133
|
+
image.close();
|
|
45134
|
+
}
|
|
45135
|
+
}, () => {
|
|
45136
|
+
return;
|
|
45137
|
+
});
|
|
45138
|
+
const aborted = new Promise((_, reject) => {
|
|
45139
|
+
controller.signal.addEventListener("abort", () => reject(new Error("Mask image loading was aborted")), { once: true });
|
|
45140
|
+
});
|
|
45141
|
+
try {
|
|
45142
|
+
const image = await Promise.race([operation, aborted]);
|
|
45143
|
+
state.images.add(image);
|
|
45144
|
+
return image;
|
|
45145
|
+
} catch (error2) {
|
|
45146
|
+
if (timedOut) {
|
|
45147
|
+
throw new Error(`Timed out loading mask-image URL after ${state.timeoutInMilliseconds}ms: ${resolvedSrc}`);
|
|
45148
|
+
}
|
|
45149
|
+
if (state.signal?.aborted) {
|
|
45150
|
+
throw new Error(`Loading mask-image URL was cancelled: ${resolvedSrc}`);
|
|
45151
|
+
}
|
|
45152
|
+
const detail = error2 instanceof Error ? error2.message : String(error2);
|
|
45153
|
+
throw new Error(`Could not load mask-image URL ${resolvedSrc}: ${detail}`);
|
|
45154
|
+
} finally {
|
|
45155
|
+
window.clearTimeout(timeout);
|
|
45156
|
+
state.signal?.removeEventListener("abort", onAbort);
|
|
45157
|
+
}
|
|
45158
|
+
};
|
|
45159
|
+
var getMaskImage = ({
|
|
45160
|
+
src,
|
|
45161
|
+
state
|
|
45162
|
+
}) => {
|
|
45163
|
+
const cached = state.cache.get(src);
|
|
45164
|
+
if (cached) {
|
|
45165
|
+
return cached;
|
|
45166
|
+
}
|
|
45167
|
+
const promise = loadMaskImage({ src, state });
|
|
45168
|
+
state.cache.set(src, promise);
|
|
45169
|
+
promise.catch(() => state.cache.delete(src));
|
|
45170
|
+
return promise;
|
|
45171
|
+
};
|
|
45172
|
+
var makeInternalState = ({
|
|
45173
|
+
signal = null,
|
|
45174
|
+
maskImageTimeoutInMilliseconds = 30000
|
|
45175
|
+
} = {}) => {
|
|
45065
45176
|
let drawnPrecomposedPixels = 0;
|
|
45066
45177
|
let precomposedTextures = 0;
|
|
45067
45178
|
let waitForReadyTime = 0;
|
|
@@ -45071,6 +45182,10 @@ var makeInternalState = () => {
|
|
|
45071
45182
|
const helperCanvasState = {
|
|
45072
45183
|
current: null
|
|
45073
45184
|
};
|
|
45185
|
+
const maskImageLoaderState = makeMaskImageLoaderState({
|
|
45186
|
+
signal,
|
|
45187
|
+
timeoutInMilliseconds: maskImageTimeoutInMilliseconds
|
|
45188
|
+
});
|
|
45074
45189
|
return {
|
|
45075
45190
|
getDrawn3dPixels: () => drawnPrecomposedPixels,
|
|
45076
45191
|
getPrecomposedTiles: () => precomposedTextures,
|
|
@@ -45082,10 +45197,12 @@ var makeInternalState = () => {
|
|
|
45082
45197
|
precomposedTextures++;
|
|
45083
45198
|
},
|
|
45084
45199
|
helperCanvasState,
|
|
45200
|
+
maskImageLoaderState,
|
|
45085
45201
|
[Symbol.dispose]: () => {
|
|
45086
45202
|
if (helperCanvasState.current) {
|
|
45087
45203
|
helperCanvasState.current.cleanup();
|
|
45088
45204
|
}
|
|
45205
|
+
maskImageLoaderState[Symbol.dispose]();
|
|
45089
45206
|
},
|
|
45090
45207
|
getWaitForReadyTime: () => waitForReadyTime,
|
|
45091
45208
|
addWaitForReadyTime: (time) => {
|
|
@@ -45977,8 +46094,133 @@ var getMaskImageValue = (computedStyle) => {
|
|
|
45977
46094
|
}
|
|
45978
46095
|
return value;
|
|
45979
46096
|
};
|
|
46097
|
+
var parseUrlFunction = (value) => {
|
|
46098
|
+
const trimmed = value.trim();
|
|
46099
|
+
if (!trimmed.toLowerCase().startsWith("url(")) {
|
|
46100
|
+
return null;
|
|
46101
|
+
}
|
|
46102
|
+
let index2 = 4;
|
|
46103
|
+
while (/\s/.test(trimmed[index2] ?? "")) {
|
|
46104
|
+
index2++;
|
|
46105
|
+
}
|
|
46106
|
+
const quote = trimmed[index2] === '"' || trimmed[index2] === "'" ? trimmed[index2] : null;
|
|
46107
|
+
if (quote) {
|
|
46108
|
+
index2++;
|
|
46109
|
+
}
|
|
46110
|
+
let url = "";
|
|
46111
|
+
let closedQuote = quote === null;
|
|
46112
|
+
for (;index2 < trimmed.length; index2++) {
|
|
46113
|
+
const char = trimmed[index2];
|
|
46114
|
+
if (char === "\\") {
|
|
46115
|
+
const next = trimmed[index2 + 1];
|
|
46116
|
+
if (next === undefined) {
|
|
46117
|
+
return null;
|
|
46118
|
+
}
|
|
46119
|
+
url += next;
|
|
46120
|
+
index2++;
|
|
46121
|
+
continue;
|
|
46122
|
+
}
|
|
46123
|
+
if (quote && char === quote) {
|
|
46124
|
+
closedQuote = true;
|
|
46125
|
+
index2++;
|
|
46126
|
+
break;
|
|
46127
|
+
}
|
|
46128
|
+
if (!quote && char === ")") {
|
|
46129
|
+
break;
|
|
46130
|
+
}
|
|
46131
|
+
url += char;
|
|
46132
|
+
}
|
|
46133
|
+
if (!closedQuote) {
|
|
46134
|
+
return null;
|
|
46135
|
+
}
|
|
46136
|
+
while (/\s/.test(trimmed[index2] ?? "")) {
|
|
46137
|
+
index2++;
|
|
46138
|
+
}
|
|
46139
|
+
if (trimmed[index2] !== ")") {
|
|
46140
|
+
return null;
|
|
46141
|
+
}
|
|
46142
|
+
index2++;
|
|
46143
|
+
while (/\s/.test(trimmed[index2] ?? "")) {
|
|
46144
|
+
index2++;
|
|
46145
|
+
}
|
|
46146
|
+
if (index2 !== trimmed.length) {
|
|
46147
|
+
return null;
|
|
46148
|
+
}
|
|
46149
|
+
return url.trim();
|
|
46150
|
+
};
|
|
46151
|
+
var getMaskProperty = ({
|
|
46152
|
+
standard,
|
|
46153
|
+
prefixed
|
|
46154
|
+
}) => standard || prefixed;
|
|
46155
|
+
var normalizeCssValue = (value) => value.trim().toLowerCase().replace(/\s+/g, " ");
|
|
46156
|
+
var validateUrlMaskImageStyle = (computedStyle) => {
|
|
46157
|
+
const maskSize = normalizeCssValue(getMaskProperty({
|
|
46158
|
+
standard: computedStyle.maskSize,
|
|
46159
|
+
prefixed: computedStyle.webkitMaskSize
|
|
46160
|
+
}));
|
|
46161
|
+
const maskPosition = normalizeCssValue(getMaskProperty({
|
|
46162
|
+
standard: computedStyle.maskPosition,
|
|
46163
|
+
prefixed: computedStyle.webkitMaskPosition
|
|
46164
|
+
}));
|
|
46165
|
+
const maskRepeat = normalizeCssValue(getMaskProperty({
|
|
46166
|
+
standard: computedStyle.maskRepeat,
|
|
46167
|
+
prefixed: computedStyle.webkitMaskRepeat
|
|
46168
|
+
}));
|
|
46169
|
+
const maskMode = normalizeCssValue(computedStyle.maskMode);
|
|
46170
|
+
const maskOrigin = normalizeCssValue(getMaskProperty({
|
|
46171
|
+
standard: computedStyle.maskOrigin,
|
|
46172
|
+
prefixed: computedStyle.webkitMaskOrigin
|
|
46173
|
+
}));
|
|
46174
|
+
const maskClip = normalizeCssValue(getMaskProperty({
|
|
46175
|
+
standard: computedStyle.maskClip,
|
|
46176
|
+
prefixed: computedStyle.webkitMaskClip
|
|
46177
|
+
}));
|
|
46178
|
+
const isSupportedPosition = maskPosition === "0% 0%" || maskPosition === "0px 0px" || maskPosition === "left top";
|
|
46179
|
+
const unsupportedProperties = [
|
|
46180
|
+
maskSize !== "100% 100%" ? `mask-size: ${maskSize}` : null,
|
|
46181
|
+
!isSupportedPosition ? `mask-position: ${maskPosition}` : null,
|
|
46182
|
+
maskRepeat !== "no-repeat" ? `mask-repeat: ${maskRepeat}` : null,
|
|
46183
|
+
maskMode !== "" && maskMode !== "alpha" && maskMode !== "match-source" ? `mask-mode: ${maskMode}` : null,
|
|
46184
|
+
maskOrigin !== "border-box" ? `mask-origin: ${maskOrigin}` : null,
|
|
46185
|
+
maskClip !== "border-box" ? `mask-clip: ${maskClip}` : null
|
|
46186
|
+
].filter((property) => property !== null);
|
|
46187
|
+
if (unsupportedProperties.length > 0) {
|
|
46188
|
+
throw new Error(`@remotion/web-renderer only supports URL masks with mask-size: 100% 100%, mask-position: 0% 0%, mask-repeat: no-repeat, the border box as origin and clip, and alpha semantics. Unsupported value${unsupportedProperties.length === 1 ? "" : "s"}: ${unsupportedProperties.join(", ")}`);
|
|
46189
|
+
}
|
|
46190
|
+
};
|
|
45980
46191
|
var parseMaskImage = (maskImageValue) => {
|
|
45981
|
-
|
|
46192
|
+
const gradientInfo = parseLinearGradient(maskImageValue);
|
|
46193
|
+
if (gradientInfo) {
|
|
46194
|
+
return { type: "linear-gradient", gradientInfo };
|
|
46195
|
+
}
|
|
46196
|
+
const url = parseUrlFunction(maskImageValue);
|
|
46197
|
+
if (url !== null) {
|
|
46198
|
+
if (!url) {
|
|
46199
|
+
throw new Error("mask-image: url() must contain a URL");
|
|
46200
|
+
}
|
|
46201
|
+
return { type: "url", src: new URL(url, document.baseURI).href };
|
|
46202
|
+
}
|
|
46203
|
+
if (maskImageValue.trim().toLowerCase().startsWith("url(")) {
|
|
46204
|
+
throw new Error("@remotion/web-renderer only supports a single mask-image: url() layer");
|
|
46205
|
+
}
|
|
46206
|
+
return null;
|
|
46207
|
+
};
|
|
46208
|
+
var elementHasUrlMaskImage = (element) => {
|
|
46209
|
+
const value = getMaskImageValue(getComputedStyle(element));
|
|
46210
|
+
return value?.trim().toLowerCase().startsWith("url(") ?? false;
|
|
46211
|
+
};
|
|
46212
|
+
var containsUrlMaskImage = (element) => {
|
|
46213
|
+
if (elementHasUrlMaskImage(element)) {
|
|
46214
|
+
return true;
|
|
46215
|
+
}
|
|
46216
|
+
const children = element.querySelectorAll("*");
|
|
46217
|
+
for (let index2 = 0;index2 < children.length; index2++) {
|
|
46218
|
+
const child = children[index2];
|
|
46219
|
+
if (elementHasUrlMaskImage(child)) {
|
|
46220
|
+
return true;
|
|
46221
|
+
}
|
|
46222
|
+
}
|
|
46223
|
+
return false;
|
|
45982
46224
|
};
|
|
45983
46225
|
var parseTransformOrigin = (transformOrigin2) => {
|
|
45984
46226
|
if (transformOrigin2.trim() === "") {
|
|
@@ -46083,6 +46325,9 @@ var calculateTransforms = ({
|
|
|
46083
46325
|
opacity2 = parseFloat(computedStyle.opacity);
|
|
46084
46326
|
const maskImageValue = getMaskImageValue(computedStyle);
|
|
46085
46327
|
maskImageInfo = maskImageValue ? parseMaskImage(maskImageValue) : null;
|
|
46328
|
+
if (maskImageInfo?.type === "url") {
|
|
46329
|
+
validateUrlMaskImageStyle(computedStyle);
|
|
46330
|
+
}
|
|
46086
46331
|
filterForPrecompositing = filterRequiresPrecompositing(computedStyle.filter);
|
|
46087
46332
|
const originalMaskImage = parent.style.maskImage;
|
|
46088
46333
|
const originalWebkitMaskImage = parent.style.webkitMaskImage;
|
|
@@ -47914,24 +48159,34 @@ var getPrecomposeRectForMask = (element) => {
|
|
|
47914
48159
|
const boundingRect = getBiggestBoundingClientRect(element);
|
|
47915
48160
|
return boundingRect;
|
|
47916
48161
|
};
|
|
47917
|
-
var handleMask = ({
|
|
47918
|
-
|
|
48162
|
+
var handleMask = async ({
|
|
48163
|
+
maskImageInfo,
|
|
47919
48164
|
maskRect,
|
|
47920
48165
|
precomposeRect,
|
|
47921
48166
|
tempContext,
|
|
47922
|
-
scale
|
|
48167
|
+
scale,
|
|
48168
|
+
internalState
|
|
47923
48169
|
}) => {
|
|
47924
48170
|
const rectToFill = new DOMRect((maskRect.left - precomposeRect.left) * scale, (maskRect.top - precomposeRect.top) * scale, maskRect.width * scale, maskRect.height * scale);
|
|
47925
|
-
|
|
47926
|
-
|
|
47927
|
-
|
|
47928
|
-
|
|
47929
|
-
|
|
47930
|
-
|
|
48171
|
+
if (maskImageInfo.type === "linear-gradient") {
|
|
48172
|
+
const gradient = createCanvasGradient({
|
|
48173
|
+
ctx: tempContext,
|
|
48174
|
+
rect: rectToFill,
|
|
48175
|
+
gradientInfo: maskImageInfo.gradientInfo,
|
|
48176
|
+
offsetLeft: 0,
|
|
48177
|
+
offsetTop: 0
|
|
48178
|
+
});
|
|
48179
|
+
tempContext.globalCompositeOperation = "destination-in";
|
|
48180
|
+
tempContext.fillStyle = gradient;
|
|
48181
|
+
tempContext.fillRect(rectToFill.left, rectToFill.top, rectToFill.width, rectToFill.height);
|
|
48182
|
+
return;
|
|
48183
|
+
}
|
|
48184
|
+
const image = await getMaskImage({
|
|
48185
|
+
src: maskImageInfo.src,
|
|
48186
|
+
state: internalState.maskImageLoaderState
|
|
47931
48187
|
});
|
|
47932
48188
|
tempContext.globalCompositeOperation = "destination-in";
|
|
47933
|
-
tempContext.
|
|
47934
|
-
tempContext.fillRect(rectToFill.left, rectToFill.top, rectToFill.width, rectToFill.height);
|
|
48189
|
+
tempContext.drawImage(image, rectToFill.left, rectToFill.top, rectToFill.width, rectToFill.height);
|
|
47935
48190
|
};
|
|
47936
48191
|
var scaleRect = ({
|
|
47937
48192
|
rect,
|
|
@@ -48048,12 +48303,13 @@ var processNode = async ({
|
|
|
48048
48303
|
})
|
|
48049
48304
|
}));
|
|
48050
48305
|
if (precompositing.needsMaskImage) {
|
|
48051
|
-
handleMask({
|
|
48052
|
-
|
|
48306
|
+
await handleMask({
|
|
48307
|
+
maskImageInfo: precompositing.needsMaskImage,
|
|
48053
48308
|
maskRect: dimensions,
|
|
48054
48309
|
precomposeRect,
|
|
48055
48310
|
tempContext,
|
|
48056
|
-
scale
|
|
48311
|
+
scale,
|
|
48312
|
+
internalState
|
|
48057
48313
|
});
|
|
48058
48314
|
if (waitForPageResponsiveness !== null) {
|
|
48059
48315
|
await waitForPageResponsiveness();
|
|
@@ -48076,9 +48332,21 @@ var processNode = async ({
|
|
|
48076
48332
|
}
|
|
48077
48333
|
}
|
|
48078
48334
|
const previousTransform = context.getTransform();
|
|
48079
|
-
|
|
48335
|
+
const is3DPrecomposition = precompositing.needs3DTransformViaWebGL;
|
|
48336
|
+
if (is3DPrecomposition) {
|
|
48337
|
+
context.setTransform(new DOMMatrix);
|
|
48338
|
+
} else {
|
|
48339
|
+
setTransform({
|
|
48340
|
+
ctx: context,
|
|
48341
|
+
transform: totalMatrix,
|
|
48342
|
+
parentRect,
|
|
48343
|
+
scale
|
|
48344
|
+
});
|
|
48345
|
+
}
|
|
48346
|
+
const destinationRect = is3DPrecomposition ? rectAfterTransforms : precomposeRect;
|
|
48347
|
+
const parentOffsetScale = is3DPrecomposition ? scale : 1;
|
|
48080
48348
|
const drawPrecomposedCanvas = () => {
|
|
48081
|
-
context.drawImage(drawable, 0, 0, drawable.width, drawable.height,
|
|
48349
|
+
context.drawImage(drawable, 0, 0, drawable.width, drawable.height, destinationRect.left - parentRect.x * parentOffsetScale, destinationRect.top - parentRect.y * parentOffsetScale, destinationRect.width, destinationRect.height);
|
|
48082
48350
|
};
|
|
48083
48351
|
if (precompositing.needsFilterPrecompositing) {
|
|
48084
48352
|
applyFilterToDrawOperation({
|
|
@@ -48157,6 +48425,36 @@ var findWords = (span) => {
|
|
|
48157
48425
|
}
|
|
48158
48426
|
return tokens;
|
|
48159
48427
|
};
|
|
48428
|
+
var fontStretchOptions = [
|
|
48429
|
+
{ keyword: "ultra-condensed", percentage: 50 },
|
|
48430
|
+
{ keyword: "extra-condensed", percentage: 62.5 },
|
|
48431
|
+
{ keyword: "condensed", percentage: 75 },
|
|
48432
|
+
{ keyword: "semi-condensed", percentage: 87.5 },
|
|
48433
|
+
{ keyword: "normal", percentage: 100 },
|
|
48434
|
+
{ keyword: "semi-expanded", percentage: 112.5 },
|
|
48435
|
+
{ keyword: "expanded", percentage: 125 },
|
|
48436
|
+
{ keyword: "extra-expanded", percentage: 150 },
|
|
48437
|
+
{ keyword: "ultra-expanded", percentage: 200 }
|
|
48438
|
+
];
|
|
48439
|
+
var getCanvasFontStretch = (fontStretch) => {
|
|
48440
|
+
const keyword = fontStretchOptions.find((option) => option.keyword === fontStretch);
|
|
48441
|
+
if (keyword) {
|
|
48442
|
+
return keyword.keyword;
|
|
48443
|
+
}
|
|
48444
|
+
const percentage = Number.parseFloat(fontStretch);
|
|
48445
|
+
if (!Number.isFinite(percentage)) {
|
|
48446
|
+
return "normal";
|
|
48447
|
+
}
|
|
48448
|
+
let closest = fontStretchOptions[0];
|
|
48449
|
+
for (const option of fontStretchOptions.slice(1)) {
|
|
48450
|
+
const distance2 = Math.abs(option.percentage - percentage);
|
|
48451
|
+
const closestDistance = Math.abs(closest.percentage - percentage);
|
|
48452
|
+
if (distance2 < closestDistance || distance2 === closestDistance && percentage >= 100) {
|
|
48453
|
+
closest = option;
|
|
48454
|
+
}
|
|
48455
|
+
}
|
|
48456
|
+
return closest.keyword;
|
|
48457
|
+
};
|
|
48160
48458
|
var parsePaintOrder = (paintOrder) => {
|
|
48161
48459
|
const paintOrderValue = paintOrder || "normal";
|
|
48162
48460
|
const paintOrderParts = paintOrderValue === "normal" ? ["fill", "stroke"] : paintOrderValue.split(/\s+/).filter(Boolean);
|
|
@@ -48415,7 +48713,7 @@ var drawText = ({
|
|
|
48415
48713
|
contextToDraw.font = `${fontStyle} ${fontWeight} ${fontSizePx}px ${fontFamily}`;
|
|
48416
48714
|
contextToDraw.fontVariantCaps = fontVariantCaps;
|
|
48417
48715
|
contextToDraw.fontKerning = fontKerning;
|
|
48418
|
-
contextToDraw.fontStretch = fontStretch;
|
|
48716
|
+
contextToDraw.fontStretch = getCanvasFontStretch(fontStretch);
|
|
48419
48717
|
contextToDraw.textRendering = textRendering;
|
|
48420
48718
|
contextToDraw.fillStyle = onlyBackgroundClipText ? "black" : webkitTextFillColor;
|
|
48421
48719
|
contextToDraw.letterSpacing = letterSpacing;
|
|
@@ -48654,26 +48952,34 @@ var createLayer = async ({
|
|
|
48654
48952
|
const scaledWidth = Math.ceil(cutout.width * scale);
|
|
48655
48953
|
const scaledHeight = Math.ceil(cutout.height * scale);
|
|
48656
48954
|
if (!onlyBackgroundClipText && element instanceof HTMLElement && htmlInCanvasContext && onHtmlInCanvasLayerOutcome) {
|
|
48657
|
-
|
|
48658
|
-
try {
|
|
48659
|
-
const offCtx = await drawWithHtmlInCanvas({
|
|
48660
|
-
htmlInCanvasContext,
|
|
48661
|
-
element,
|
|
48662
|
-
scaledWidth,
|
|
48663
|
-
scaledHeight,
|
|
48664
|
-
waitForRenderReady,
|
|
48665
|
-
useElementImage: hasNestedHtmlInCanvas
|
|
48666
|
-
});
|
|
48667
|
-
onHtmlInCanvasLayerOutcome({ native: true });
|
|
48668
|
-
return offCtx;
|
|
48669
|
-
} catch (err) {
|
|
48670
|
-
const detail = err instanceof Error ? err.message : JSON.stringify(err);
|
|
48955
|
+
if (containsUrlMaskImage(element)) {
|
|
48671
48956
|
onHtmlInCanvasLayerOutcome({
|
|
48672
48957
|
native: false,
|
|
48673
|
-
reason:
|
|
48674
|
-
shouldWarn:
|
|
48958
|
+
reason: "URL masks are loaded by the built-in DOM composer to guarantee deterministic rendering.",
|
|
48959
|
+
shouldWarn: false
|
|
48675
48960
|
});
|
|
48676
|
-
|
|
48961
|
+
} else {
|
|
48962
|
+
const hasNestedHtmlInCanvas = containsLayoutSubtreeCanvas(element);
|
|
48963
|
+
try {
|
|
48964
|
+
const offCtx = await drawWithHtmlInCanvas({
|
|
48965
|
+
htmlInCanvasContext,
|
|
48966
|
+
element,
|
|
48967
|
+
scaledWidth,
|
|
48968
|
+
scaledHeight,
|
|
48969
|
+
waitForRenderReady,
|
|
48970
|
+
useElementImage: hasNestedHtmlInCanvas
|
|
48971
|
+
});
|
|
48972
|
+
onHtmlInCanvasLayerOutcome({ native: true });
|
|
48973
|
+
return offCtx;
|
|
48974
|
+
} catch (err) {
|
|
48975
|
+
const detail = err instanceof Error ? err.message : JSON.stringify(err);
|
|
48976
|
+
onHtmlInCanvasLayerOutcome({
|
|
48977
|
+
native: false,
|
|
48978
|
+
reason: `drawElementImage failed (${detail}); falling back to the built-in DOM composer.`,
|
|
48979
|
+
shouldWarn: true
|
|
48980
|
+
});
|
|
48981
|
+
Internals.Log.verbose({ logLevel, tag: "@remotion/web-renderer" }, "HTML-in-canvas capture failed, falling back to software compose", err);
|
|
48982
|
+
}
|
|
48677
48983
|
}
|
|
48678
48984
|
}
|
|
48679
48985
|
const canvas = new OffscreenCanvas(scaledWidth, scaledHeight);
|
|
@@ -49005,7 +49311,10 @@ var internalRenderMediaOnWeb = async ({
|
|
|
49005
49311
|
errorHolder,
|
|
49006
49312
|
htmlInCanvasContext
|
|
49007
49313
|
} = scaffold;
|
|
49008
|
-
const internalState = __using2(__stack2, makeInternalState(
|
|
49314
|
+
const internalState = __using2(__stack2, makeInternalState({
|
|
49315
|
+
signal,
|
|
49316
|
+
maskImageTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds
|
|
49317
|
+
}), 0);
|
|
49009
49318
|
const pageResponsivenessController = createPageResponsivenessController({
|
|
49010
49319
|
intervalInMilliseconds: pageResponsivenessIntervalInMilliseconds,
|
|
49011
49320
|
now: () => performance.now(),
|
|
@@ -50638,7 +50947,7 @@ var useTransparentVideoSource = ({
|
|
|
50638
50947
|
fallbackVideoSrc,
|
|
50639
50948
|
videoSrc
|
|
50640
50949
|
}) => {
|
|
50641
|
-
const [src, setSrc] = useState59(
|
|
50950
|
+
const [src, setSrc] = useState59(null);
|
|
50642
50951
|
useEffect60(() => {
|
|
50643
50952
|
setSrc(isWebkit() ? fallbackVideoSrc : videoSrc);
|
|
50644
50953
|
}, [fallbackVideoSrc, videoSrc]);
|
|
@@ -50694,7 +51003,7 @@ var MakeVideosAgentically = ({
|
|
|
50694
51003
|
children: [
|
|
50695
51004
|
/* @__PURE__ */ jsx121("div", {
|
|
50696
51005
|
className: "flex aspect-square w-full items-start",
|
|
50697
|
-
children: showVideo ? /* @__PURE__ */ jsx121("video", {
|
|
51006
|
+
children: showVideo && src ? /* @__PURE__ */ jsx121("video", {
|
|
50698
51007
|
ref: videoRef,
|
|
50699
51008
|
src,
|
|
50700
51009
|
muted: true,
|
|
@@ -50761,7 +51070,7 @@ var MakeVideosInteractively = ({
|
|
|
50761
51070
|
children: [
|
|
50762
51071
|
/* @__PURE__ */ jsx125("div", {
|
|
50763
51072
|
className: "flex aspect-square w-full items-start",
|
|
50764
|
-
children: showVideo ? /* @__PURE__ */ jsx125("video", {
|
|
51073
|
+
children: showVideo && src ? /* @__PURE__ */ jsx125("video", {
|
|
50765
51074
|
src,
|
|
50766
51075
|
autoPlay: true,
|
|
50767
51076
|
muted: true,
|
|
@@ -50824,7 +51133,7 @@ var MakeVideosProgrammatically = ({
|
|
|
50824
51133
|
children: [
|
|
50825
51134
|
/* @__PURE__ */ jsx127("div", {
|
|
50826
51135
|
className: "flex aspect-square w-full items-start",
|
|
50827
|
-
children: showVideo ? /* @__PURE__ */ jsx127("video", {
|
|
51136
|
+
children: showVideo && src ? /* @__PURE__ */ jsx127("video", {
|
|
50828
51137
|
src,
|
|
50829
51138
|
muted: true,
|
|
50830
51139
|
autoPlay: true,
|