@remotion/promo-pages 4.0.463 → 4.0.465
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 +1150 -965
- package/dist/design.js +890 -810
- package/dist/experts/experts-data.js +16 -5
- package/dist/experts.js +736 -656
- package/dist/homepage/Pricing.js +879 -799
- package/dist/prompts/PromptsGallery.js +888 -808
- package/dist/prompts/PromptsShow.css +2578 -0
- package/dist/prompts/PromptsShow.js +845 -765
- package/dist/prompts/PromptsSubmit.js +852 -772
- package/dist/tailwind.css +6 -4
- package/dist/team.js +875 -795
- package/dist/template-modal-content.css +35 -0
- package/dist/template-modal-content.js +891 -811
- package/dist/templates.js +876 -795
- package/package.json +13 -13
package/dist/Homepage.js
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
1
3
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
7
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
8
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
+
for (let key of __getOwnPropNames(mod))
|
|
10
|
+
if (!__hasOwnProp.call(to, key))
|
|
11
|
+
__defProp(to, key, {
|
|
12
|
+
get: () => mod[key],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
6
17
|
var __export = (target, all) => {
|
|
7
18
|
for (var name in all)
|
|
8
19
|
__defProp(target, name, {
|
|
9
20
|
get: all[name],
|
|
10
21
|
enumerable: true,
|
|
11
22
|
configurable: true,
|
|
12
|
-
set:
|
|
23
|
+
set: (newValue) => all[name] = () => newValue
|
|
13
24
|
});
|
|
14
25
|
};
|
|
15
26
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -900,7 +911,7 @@ var experts = [
|
|
|
900
911
|
}
|
|
901
912
|
];
|
|
902
913
|
// src/components/experts/ExpertsPage.tsx
|
|
903
|
-
import { useMemo as
|
|
914
|
+
import { useMemo as useMemo39 } from "react";
|
|
904
915
|
|
|
905
916
|
// ../core/dist/esm/index.mjs
|
|
906
917
|
import { createContext } from "react";
|
|
@@ -930,13 +941,6 @@ import * as React6 from "react";
|
|
|
930
941
|
import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
|
|
931
942
|
import { useContext as useContext8, useMemo as useMemo7 } from "react";
|
|
932
943
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
933
|
-
import {
|
|
934
|
-
forwardRef as forwardRef4,
|
|
935
|
-
useCallback as useCallback6,
|
|
936
|
-
useEffect as useEffect5,
|
|
937
|
-
useMemo as useMemo16,
|
|
938
|
-
useState as useState6
|
|
939
|
-
} from "react";
|
|
940
944
|
import {
|
|
941
945
|
forwardRef as forwardRef3,
|
|
942
946
|
useContext as useContext17,
|
|
@@ -944,6 +948,7 @@ import {
|
|
|
944
948
|
useMemo as useMemo14,
|
|
945
949
|
useState as useState5
|
|
946
950
|
} from "react";
|
|
951
|
+
import { useRef as useRef6 } from "react";
|
|
947
952
|
import { useContext as useContext14, useMemo as useMemo11 } from "react";
|
|
948
953
|
import { createContext as createContext12 } from "react";
|
|
949
954
|
import { useContext as useContext10, useMemo as useMemo9 } from "react";
|
|
@@ -966,18 +971,25 @@ import React12, { forwardRef as forwardRef2, useState as useState4, useContext a
|
|
|
966
971
|
import { useContext as useContext15, useRef as useRef5 } from "react";
|
|
967
972
|
import { createContext as createContext15 } from "react";
|
|
968
973
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
969
|
-
import {
|
|
974
|
+
import {
|
|
975
|
+
forwardRef as forwardRef4,
|
|
976
|
+
useEffect as useEffect5,
|
|
977
|
+
useImperativeHandle as useImperativeHandle2,
|
|
978
|
+
useLayoutEffect as useLayoutEffect2,
|
|
979
|
+
useRef as useRef9,
|
|
980
|
+
useState as useState6
|
|
981
|
+
} from "react";
|
|
982
|
+
import React14, { useCallback as useCallback6, useImperativeHandle, useMemo as useMemo16, useRef as useRef8 } from "react";
|
|
983
|
+
import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef7 } from "react";
|
|
970
984
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
985
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
971
986
|
import {
|
|
972
987
|
forwardRef as forwardRef5,
|
|
988
|
+
useCallback as useCallback7,
|
|
973
989
|
useEffect as useEffect6,
|
|
974
|
-
|
|
975
|
-
useLayoutEffect as useLayoutEffect2,
|
|
976
|
-
useRef as useRef8,
|
|
990
|
+
useMemo as useMemo17,
|
|
977
991
|
useState as useState7
|
|
978
992
|
} from "react";
|
|
979
|
-
import React15, { useCallback as useCallback7, useImperativeHandle, useRef as useRef7 } from "react";
|
|
980
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
981
993
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
982
994
|
import {
|
|
983
995
|
createContext as createContext16,
|
|
@@ -985,78 +997,78 @@ import {
|
|
|
985
997
|
useCallback as useCallback8,
|
|
986
998
|
useContext as useContext18,
|
|
987
999
|
useLayoutEffect as useLayoutEffect3,
|
|
988
|
-
useMemo as
|
|
989
|
-
useRef as
|
|
990
|
-
useState as useState8
|
|
1000
|
+
useMemo as useMemo18,
|
|
1001
|
+
useRef as useRef10
|
|
991
1002
|
} from "react";
|
|
992
1003
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
993
|
-
import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as
|
|
1004
|
+
import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as useState9 } from "react";
|
|
994
1005
|
import {
|
|
995
1006
|
createContext as createContext17,
|
|
996
1007
|
useCallback as useCallback9,
|
|
997
1008
|
useImperativeHandle as useImperativeHandle3,
|
|
998
1009
|
useLayoutEffect as useLayoutEffect4,
|
|
999
|
-
useMemo as
|
|
1000
|
-
useRef as
|
|
1001
|
-
useState as
|
|
1010
|
+
useMemo as useMemo19,
|
|
1011
|
+
useRef as useRef11,
|
|
1012
|
+
useState as useState8
|
|
1002
1013
|
} from "react";
|
|
1003
1014
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1004
|
-
import { forwardRef as forwardRef9, useCallback as
|
|
1005
|
-
import React17, { createContext as createContext18, useMemo as
|
|
1015
|
+
import { forwardRef as forwardRef9, useCallback as useCallback15, useContext as useContext31 } from "react";
|
|
1016
|
+
import React17, { createContext as createContext18, useMemo as useMemo20 } from "react";
|
|
1006
1017
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1007
1018
|
import { useContext as useContext20 } from "react";
|
|
1008
|
-
import { createContext as createContext19, useEffect as useEffect7, useState as
|
|
1019
|
+
import { createContext as createContext19, useEffect as useEffect7, useState as useState10 } from "react";
|
|
1009
1020
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1010
|
-
import { createContext as createContext20, useMemo as
|
|
1021
|
+
import { createContext as createContext20, useMemo as useMemo21, useReducer } from "react";
|
|
1011
1022
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1023
|
+
import { useCallback as useCallback14 } from "react";
|
|
1012
1024
|
import React23, {
|
|
1013
1025
|
forwardRef as forwardRef7,
|
|
1014
1026
|
useContext as useContext29,
|
|
1015
1027
|
useEffect as useEffect14,
|
|
1016
1028
|
useImperativeHandle as useImperativeHandle4,
|
|
1017
|
-
useMemo as
|
|
1018
|
-
useRef as
|
|
1019
|
-
useState as
|
|
1029
|
+
useMemo as useMemo29,
|
|
1030
|
+
useRef as useRef19,
|
|
1031
|
+
useState as useState15
|
|
1020
1032
|
} from "react";
|
|
1021
|
-
import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as
|
|
1033
|
+
import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as useRef14 } from "react";
|
|
1022
1034
|
import React20, {
|
|
1023
1035
|
createContext as createContext21,
|
|
1024
1036
|
createRef as createRef2,
|
|
1025
1037
|
useCallback as useCallback10,
|
|
1026
1038
|
useContext as useContext21,
|
|
1027
|
-
useMemo as
|
|
1028
|
-
useRef as
|
|
1029
|
-
useState as
|
|
1039
|
+
useMemo as useMemo23,
|
|
1040
|
+
useRef as useRef12,
|
|
1041
|
+
useState as useState11
|
|
1030
1042
|
} from "react";
|
|
1031
|
-
import { useMemo as
|
|
1043
|
+
import { useMemo as useMemo22 } from "react";
|
|
1032
1044
|
import { jsx as jsx20, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1033
|
-
import { useRef as
|
|
1034
|
-
import { useContext as useContext24, useEffect as useEffect8, useMemo as
|
|
1045
|
+
import { useRef as useRef13 } from "react";
|
|
1046
|
+
import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo24, useState as useState12 } from "react";
|
|
1035
1047
|
import { useContext as useContext23 } from "react";
|
|
1036
1048
|
import {
|
|
1037
1049
|
useCallback as useCallback13,
|
|
1038
1050
|
useContext as useContext27,
|
|
1039
1051
|
useEffect as useEffect12,
|
|
1040
1052
|
useLayoutEffect as useLayoutEffect8,
|
|
1041
|
-
useRef as
|
|
1053
|
+
useRef as useRef18
|
|
1042
1054
|
} from "react";
|
|
1043
|
-
import { useCallback as useCallback12, useMemo as
|
|
1044
|
-
import { useContext as useContext26, useMemo as
|
|
1055
|
+
import { useCallback as useCallback12, useMemo as useMemo27, useRef as useRef16 } from "react";
|
|
1056
|
+
import { useContext as useContext26, useMemo as useMemo26 } from "react";
|
|
1045
1057
|
import React21, {
|
|
1046
1058
|
useCallback as useCallback11,
|
|
1047
1059
|
useContext as useContext25,
|
|
1048
1060
|
useEffect as useEffect9,
|
|
1049
1061
|
useLayoutEffect as useLayoutEffect7,
|
|
1050
|
-
useMemo as
|
|
1051
|
-
useRef as
|
|
1052
|
-
useState as
|
|
1062
|
+
useMemo as useMemo25,
|
|
1063
|
+
useRef as useRef15,
|
|
1064
|
+
useState as useState13
|
|
1053
1065
|
} from "react";
|
|
1054
1066
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1055
1067
|
import React22 from "react";
|
|
1056
|
-
import { useEffect as useEffect10, useState as
|
|
1057
|
-
import { useEffect as useEffect11, useRef as
|
|
1068
|
+
import { useEffect as useEffect10, useState as useState14 } from "react";
|
|
1069
|
+
import { useEffect as useEffect11, useRef as useRef17 } from "react";
|
|
1058
1070
|
import { useEffect as useEffect13 } from "react";
|
|
1059
|
-
import { createContext as createContext22, useContext as useContext28, useMemo as
|
|
1071
|
+
import { createContext as createContext22, useContext as useContext28, useMemo as useMemo28 } from "react";
|
|
1060
1072
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
1061
1073
|
import {
|
|
1062
1074
|
forwardRef as forwardRef8,
|
|
@@ -1064,47 +1076,46 @@ import {
|
|
|
1064
1076
|
useEffect as useEffect15,
|
|
1065
1077
|
useImperativeHandle as useImperativeHandle5,
|
|
1066
1078
|
useLayoutEffect as useLayoutEffect9,
|
|
1067
|
-
useMemo as
|
|
1068
|
-
useRef as
|
|
1079
|
+
useMemo as useMemo30,
|
|
1080
|
+
useRef as useRef20
|
|
1069
1081
|
} from "react";
|
|
1070
1082
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1071
1083
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1072
|
-
import { forwardRef as forwardRef10, useCallback as
|
|
1084
|
+
import { forwardRef as forwardRef10, useCallback as useCallback16, useState as useState16 } from "react";
|
|
1073
1085
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1074
1086
|
import {
|
|
1075
|
-
useCallback as
|
|
1087
|
+
useCallback as useCallback17,
|
|
1076
1088
|
useContext as useContext32,
|
|
1077
1089
|
useImperativeHandle as useImperativeHandle6,
|
|
1078
1090
|
useLayoutEffect as useLayoutEffect10,
|
|
1079
|
-
useRef as
|
|
1080
|
-
useState as useState18
|
|
1091
|
+
useRef as useRef21
|
|
1081
1092
|
} from "react";
|
|
1082
1093
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1083
1094
|
import { createRef as createRef3 } from "react";
|
|
1084
1095
|
import React28 from "react";
|
|
1085
1096
|
import {
|
|
1086
|
-
useCallback as
|
|
1097
|
+
useCallback as useCallback18,
|
|
1087
1098
|
useImperativeHandle as useImperativeHandle7,
|
|
1088
|
-
useMemo as
|
|
1089
|
-
useRef as
|
|
1090
|
-
useState as
|
|
1099
|
+
useMemo as useMemo31,
|
|
1100
|
+
useRef as useRef22,
|
|
1101
|
+
useState as useState17
|
|
1091
1102
|
} from "react";
|
|
1092
1103
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1093
1104
|
import React29 from "react";
|
|
1094
|
-
import { useMemo as
|
|
1095
|
-
import { createContext as createContext23, useContext as useContext33, useMemo as
|
|
1105
|
+
import { useMemo as useMemo33 } from "react";
|
|
1106
|
+
import { createContext as createContext23, useContext as useContext33, useMemo as useMemo32 } from "react";
|
|
1096
1107
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1097
1108
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1098
1109
|
import React31 from "react";
|
|
1099
1110
|
import React32, { createContext as createContext24 } from "react";
|
|
1100
|
-
import { useCallback as
|
|
1111
|
+
import { useCallback as useCallback21 } from "react";
|
|
1101
1112
|
import {
|
|
1102
|
-
useCallback as
|
|
1113
|
+
useCallback as useCallback19,
|
|
1103
1114
|
useContext as useContext34,
|
|
1104
1115
|
useEffect as useEffect16,
|
|
1105
1116
|
useLayoutEffect as useLayoutEffect11,
|
|
1106
|
-
useMemo as
|
|
1107
|
-
useState as
|
|
1117
|
+
useMemo as useMemo34,
|
|
1118
|
+
useState as useState18
|
|
1108
1119
|
} from "react";
|
|
1109
1120
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1110
1121
|
import React34, {
|
|
@@ -1112,45 +1123,42 @@ import React34, {
|
|
|
1112
1123
|
useContext as useContext35,
|
|
1113
1124
|
useEffect as useEffect18,
|
|
1114
1125
|
useImperativeHandle as useImperativeHandle8,
|
|
1115
|
-
useMemo as
|
|
1116
|
-
useRef as
|
|
1117
|
-
useState as
|
|
1126
|
+
useMemo as useMemo35,
|
|
1127
|
+
useRef as useRef23,
|
|
1128
|
+
useState as useState19,
|
|
1129
|
+
useCallback as useCallback20
|
|
1118
1130
|
} from "react";
|
|
1119
1131
|
import { useEffect as useEffect17 } from "react";
|
|
1120
1132
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1121
1133
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1122
|
-
import React36, { useMemo as
|
|
1134
|
+
import React36, { useMemo as useMemo36 } from "react";
|
|
1123
1135
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1124
|
-
import { Children, forwardRef as forwardRef12, useMemo as
|
|
1136
|
+
import { Children, forwardRef as forwardRef12, useMemo as useMemo37 } from "react";
|
|
1125
1137
|
import React37 from "react";
|
|
1126
1138
|
import React38, { createContext as createContext25 } from "react";
|
|
1127
1139
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1128
1140
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1129
1141
|
import React40 from "react";
|
|
1130
|
-
import { forwardRef as forwardRef14, useCallback as
|
|
1142
|
+
import { forwardRef as forwardRef14, useCallback as useCallback22, useContext as useContext37 } from "react";
|
|
1131
1143
|
import {
|
|
1132
1144
|
forwardRef as forwardRef13,
|
|
1133
1145
|
useContext as useContext36,
|
|
1134
1146
|
useEffect as useEffect19,
|
|
1135
1147
|
useImperativeHandle as useImperativeHandle9,
|
|
1136
1148
|
useLayoutEffect as useLayoutEffect12,
|
|
1137
|
-
useMemo as
|
|
1138
|
-
useRef as
|
|
1149
|
+
useMemo as useMemo38,
|
|
1150
|
+
useRef as useRef24
|
|
1139
1151
|
} from "react";
|
|
1140
1152
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1141
1153
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1142
1154
|
var __defProp2 = Object.defineProperty;
|
|
1143
|
-
var __returnValue2 = (v) => v;
|
|
1144
|
-
function __exportSetter2(name, newValue) {
|
|
1145
|
-
this[name] = __returnValue2.bind(null, newValue);
|
|
1146
|
-
}
|
|
1147
1155
|
var __export2 = (target, all) => {
|
|
1148
1156
|
for (var name in all)
|
|
1149
1157
|
__defProp2(target, name, {
|
|
1150
1158
|
get: all[name],
|
|
1151
1159
|
enumerable: true,
|
|
1152
1160
|
configurable: true,
|
|
1153
|
-
set:
|
|
1161
|
+
set: (newValue) => all[name] = () => newValue
|
|
1154
1162
|
});
|
|
1155
1163
|
};
|
|
1156
1164
|
if (typeof createContext !== "function") {
|
|
@@ -1179,20 +1187,70 @@ var CompositionRenderErrorContext = createContext3({
|
|
|
1179
1187
|
setError: () => {},
|
|
1180
1188
|
clearError: () => {}
|
|
1181
1189
|
});
|
|
1190
|
+
var getHot = () => {
|
|
1191
|
+
try {
|
|
1192
|
+
if (typeof __webpack_module__ === "undefined") {
|
|
1193
|
+
return null;
|
|
1194
|
+
}
|
|
1195
|
+
return __webpack_module__.hot ?? null;
|
|
1196
|
+
} catch {
|
|
1197
|
+
return null;
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1182
1200
|
|
|
1183
1201
|
class CompositionErrorBoundary extends React2.Component {
|
|
1184
1202
|
state = { hasError: false };
|
|
1203
|
+
hmrStatusHandler = null;
|
|
1185
1204
|
static getDerivedStateFromError() {
|
|
1186
1205
|
return { hasError: true };
|
|
1187
1206
|
}
|
|
1188
1207
|
componentDidCatch(error) {
|
|
1189
1208
|
this.props.onError(error);
|
|
1209
|
+
this.subscribeToHmrReset();
|
|
1190
1210
|
}
|
|
1191
|
-
|
|
1211
|
+
componentDidMount() {
|
|
1192
1212
|
if (!this.state.hasError) {
|
|
1193
1213
|
this.props.onClear();
|
|
1194
1214
|
}
|
|
1195
1215
|
}
|
|
1216
|
+
componentDidUpdate(_prevProps, prevState) {
|
|
1217
|
+
if (prevState.hasError && !this.state.hasError) {
|
|
1218
|
+
this.props.onClear();
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
componentWillUnmount() {
|
|
1222
|
+
this.unsubscribeFromHmrReset();
|
|
1223
|
+
}
|
|
1224
|
+
subscribeToHmrReset() {
|
|
1225
|
+
if (this.hmrStatusHandler) {
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
const hot = getHot();
|
|
1229
|
+
if (!hot) {
|
|
1230
|
+
return;
|
|
1231
|
+
}
|
|
1232
|
+
const handler = (status) => {
|
|
1233
|
+
if (status !== "idle") {
|
|
1234
|
+
return;
|
|
1235
|
+
}
|
|
1236
|
+
this.unsubscribeFromHmrReset();
|
|
1237
|
+
this.setState({ hasError: false });
|
|
1238
|
+
};
|
|
1239
|
+
this.hmrStatusHandler = handler;
|
|
1240
|
+
hot.addStatusHandler(handler);
|
|
1241
|
+
}
|
|
1242
|
+
unsubscribeFromHmrReset() {
|
|
1243
|
+
const handler = this.hmrStatusHandler;
|
|
1244
|
+
if (!handler) {
|
|
1245
|
+
return;
|
|
1246
|
+
}
|
|
1247
|
+
this.hmrStatusHandler = null;
|
|
1248
|
+
const hot = getHot();
|
|
1249
|
+
if (!hot) {
|
|
1250
|
+
return;
|
|
1251
|
+
}
|
|
1252
|
+
hot.removeStatusHandler(handler);
|
|
1253
|
+
}
|
|
1196
1254
|
render() {
|
|
1197
1255
|
if (this.state.hasError) {
|
|
1198
1256
|
return null;
|
|
@@ -2215,75 +2273,33 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
|
2215
2273
|
var addSequenceStackTraces = (component) => {
|
|
2216
2274
|
componentsToAddStacksTo.push(component);
|
|
2217
2275
|
};
|
|
2218
|
-
var
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
default: "0px 0px",
|
|
2223
|
-
description: "Offset"
|
|
2224
|
-
},
|
|
2225
|
-
"style.scale": {
|
|
2226
|
-
type: "number",
|
|
2227
|
-
min: 0.05,
|
|
2228
|
-
max: 100,
|
|
2229
|
-
step: 0.01,
|
|
2230
|
-
default: 1,
|
|
2231
|
-
description: "Scale"
|
|
2232
|
-
},
|
|
2233
|
-
"style.rotate": {
|
|
2234
|
-
type: "rotation",
|
|
2235
|
-
step: 1,
|
|
2236
|
-
default: "0deg",
|
|
2237
|
-
description: "Rotation"
|
|
2238
|
-
},
|
|
2239
|
-
"style.opacity": {
|
|
2240
|
-
type: "number",
|
|
2241
|
-
min: 0,
|
|
2242
|
-
max: 1,
|
|
2243
|
-
step: 0.01,
|
|
2244
|
-
default: 1,
|
|
2245
|
-
description: "Opacity"
|
|
2246
|
-
},
|
|
2247
|
-
premountFor: {
|
|
2248
|
-
type: "number",
|
|
2249
|
-
default: 0,
|
|
2250
|
-
description: "Premount For",
|
|
2251
|
-
min: 0,
|
|
2252
|
-
step: 1
|
|
2253
|
-
},
|
|
2254
|
-
postmountFor: {
|
|
2255
|
-
type: "hidden"
|
|
2256
|
-
},
|
|
2257
|
-
styleWhilePremounted: {
|
|
2258
|
-
type: "hidden"
|
|
2259
|
-
},
|
|
2260
|
-
styleWhilePostmounted: {
|
|
2261
|
-
type: "hidden"
|
|
2276
|
+
var VERSION = "4.0.465";
|
|
2277
|
+
var checkMultipleRemotionVersions = () => {
|
|
2278
|
+
if (typeof globalThis === "undefined") {
|
|
2279
|
+
return;
|
|
2262
2280
|
}
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
description: "Hidden"
|
|
2268
|
-
};
|
|
2269
|
-
var sequenceSchema = {
|
|
2270
|
-
hidden: hiddenField,
|
|
2271
|
-
layout: {
|
|
2272
|
-
type: "enum",
|
|
2273
|
-
default: "absolute-fill",
|
|
2274
|
-
description: "Layout",
|
|
2275
|
-
variants: {
|
|
2276
|
-
"absolute-fill": sequenceStyleSchema,
|
|
2277
|
-
none: {}
|
|
2281
|
+
const set = () => {
|
|
2282
|
+
globalThis.remotion_imported = VERSION;
|
|
2283
|
+
if (typeof window !== "undefined") {
|
|
2284
|
+
window.remotion_imported = VERSION;
|
|
2278
2285
|
}
|
|
2286
|
+
};
|
|
2287
|
+
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
2288
|
+
if (alreadyImported) {
|
|
2289
|
+
if (alreadyImported === VERSION) {
|
|
2290
|
+
return;
|
|
2291
|
+
}
|
|
2292
|
+
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
2293
|
+
set();
|
|
2294
|
+
return;
|
|
2295
|
+
}
|
|
2296
|
+
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
2297
|
+
VERSION,
|
|
2298
|
+
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
2299
|
+
].filter(truthy).join(" and ")}. This will cause things to break in an unexpected way.
|
|
2300
|
+
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.`);
|
|
2279
2301
|
}
|
|
2280
|
-
|
|
2281
|
-
var sequenceSchemaDefaultLayoutNone = {
|
|
2282
|
-
...sequenceSchema,
|
|
2283
|
-
layout: {
|
|
2284
|
-
...sequenceSchema.layout,
|
|
2285
|
-
default: "none"
|
|
2286
|
-
}
|
|
2302
|
+
set();
|
|
2287
2303
|
};
|
|
2288
2304
|
var SequenceContext = createContext12(null);
|
|
2289
2305
|
var exports_timeline_position_state = {};
|
|
@@ -2619,6 +2635,82 @@ var Freeze = ({
|
|
|
2619
2635
|
var PremountContext = createContext14({
|
|
2620
2636
|
premountFramesRemaining: 0
|
|
2621
2637
|
});
|
|
2638
|
+
var sequenceVisualStyleSchema = {
|
|
2639
|
+
"style.translate": {
|
|
2640
|
+
type: "translate",
|
|
2641
|
+
step: 1,
|
|
2642
|
+
default: "0px 0px",
|
|
2643
|
+
description: "Offset"
|
|
2644
|
+
},
|
|
2645
|
+
"style.scale": {
|
|
2646
|
+
type: "number",
|
|
2647
|
+
min: 0.05,
|
|
2648
|
+
max: 100,
|
|
2649
|
+
step: 0.01,
|
|
2650
|
+
default: 1,
|
|
2651
|
+
description: "Scale"
|
|
2652
|
+
},
|
|
2653
|
+
"style.rotate": {
|
|
2654
|
+
type: "rotation",
|
|
2655
|
+
step: 1,
|
|
2656
|
+
default: "0deg",
|
|
2657
|
+
description: "Rotation"
|
|
2658
|
+
},
|
|
2659
|
+
"style.opacity": {
|
|
2660
|
+
type: "number",
|
|
2661
|
+
min: 0,
|
|
2662
|
+
max: 1,
|
|
2663
|
+
step: 0.01,
|
|
2664
|
+
default: 1,
|
|
2665
|
+
description: "Opacity"
|
|
2666
|
+
}
|
|
2667
|
+
};
|
|
2668
|
+
var sequencePremountSchema = {
|
|
2669
|
+
premountFor: {
|
|
2670
|
+
type: "number",
|
|
2671
|
+
default: 0,
|
|
2672
|
+
description: "Premount For",
|
|
2673
|
+
min: 0,
|
|
2674
|
+
step: 1
|
|
2675
|
+
},
|
|
2676
|
+
postmountFor: {
|
|
2677
|
+
type: "hidden"
|
|
2678
|
+
},
|
|
2679
|
+
styleWhilePremounted: {
|
|
2680
|
+
type: "hidden"
|
|
2681
|
+
},
|
|
2682
|
+
styleWhilePostmounted: {
|
|
2683
|
+
type: "hidden"
|
|
2684
|
+
}
|
|
2685
|
+
};
|
|
2686
|
+
var sequenceStyleSchema = {
|
|
2687
|
+
...sequenceVisualStyleSchema,
|
|
2688
|
+
...sequencePremountSchema
|
|
2689
|
+
};
|
|
2690
|
+
var hiddenField = {
|
|
2691
|
+
type: "boolean",
|
|
2692
|
+
default: false,
|
|
2693
|
+
description: "Hidden"
|
|
2694
|
+
};
|
|
2695
|
+
var sequenceSchema = {
|
|
2696
|
+
hidden: hiddenField,
|
|
2697
|
+
layout: {
|
|
2698
|
+
type: "enum",
|
|
2699
|
+
default: "absolute-fill",
|
|
2700
|
+
description: "Layout",
|
|
2701
|
+
variants: {
|
|
2702
|
+
"absolute-fill": sequenceStyleSchema,
|
|
2703
|
+
none: {}
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
};
|
|
2707
|
+
var sequenceSchemaDefaultLayoutNone = {
|
|
2708
|
+
...sequenceSchema,
|
|
2709
|
+
layout: {
|
|
2710
|
+
...sequenceSchema.layout,
|
|
2711
|
+
default: "none"
|
|
2712
|
+
}
|
|
2713
|
+
};
|
|
2622
2714
|
var SequenceManager = React11.createContext({
|
|
2623
2715
|
registerSequence: () => {
|
|
2624
2716
|
throw new Error("SequenceManagerContext not initialized");
|
|
@@ -3226,7 +3318,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3226
3318
|
showInTimeline = true,
|
|
3227
3319
|
hidden = false,
|
|
3228
3320
|
_experimentalControls: controls,
|
|
3229
|
-
|
|
3321
|
+
_remotionInternalEffects,
|
|
3230
3322
|
_remotionInternalLoopDisplay: loopDisplay,
|
|
3231
3323
|
_remotionInternalStack: stack,
|
|
3232
3324
|
_remotionInternalPremountDisplay: premountDisplay,
|
|
@@ -3301,34 +3393,56 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3301
3393
|
}, [name]);
|
|
3302
3394
|
const env = useRemotionEnvironment();
|
|
3303
3395
|
const inheritedStack = other?.stack ?? null;
|
|
3304
|
-
const
|
|
3396
|
+
const stackRef = useRef6(null);
|
|
3397
|
+
stackRef.current = stack ?? inheritedStack;
|
|
3305
3398
|
useEffect3(() => {
|
|
3306
3399
|
if (!env.isStudio) {
|
|
3307
3400
|
return;
|
|
3308
3401
|
}
|
|
3309
3402
|
if (isMedia) {
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3403
|
+
if (isMedia.type === "image") {
|
|
3404
|
+
registerSequence({
|
|
3405
|
+
type: "image",
|
|
3406
|
+
controls: controls ?? null,
|
|
3407
|
+
effects: _remotionInternalEffects ?? [],
|
|
3408
|
+
displayName: timelineClipName,
|
|
3409
|
+
duration: actualDurationInFrames,
|
|
3410
|
+
from,
|
|
3411
|
+
id,
|
|
3412
|
+
loopDisplay,
|
|
3413
|
+
nonce: nonce.get(),
|
|
3414
|
+
parent: parentSequence?.id ?? null,
|
|
3415
|
+
postmountDisplay: postmountDisplay ?? null,
|
|
3416
|
+
premountDisplay: premountDisplay ?? null,
|
|
3417
|
+
rootId,
|
|
3418
|
+
showInTimeline,
|
|
3419
|
+
src: isMedia.src,
|
|
3420
|
+
getStack: () => stackRef.current
|
|
3421
|
+
});
|
|
3422
|
+
} else {
|
|
3423
|
+
registerSequence({
|
|
3424
|
+
type: isMedia.type,
|
|
3425
|
+
controls: controls ?? null,
|
|
3426
|
+
effects: _remotionInternalEffects ?? [],
|
|
3427
|
+
displayName: timelineClipName,
|
|
3428
|
+
doesVolumeChange: isMedia.data.doesVolumeChange,
|
|
3429
|
+
duration: actualDurationInFrames,
|
|
3430
|
+
from,
|
|
3431
|
+
id,
|
|
3432
|
+
loopDisplay,
|
|
3433
|
+
nonce: nonce.get(),
|
|
3434
|
+
parent: parentSequence?.id ?? null,
|
|
3435
|
+
playbackRate: isMedia.data.playbackRate,
|
|
3436
|
+
postmountDisplay: postmountDisplay ?? null,
|
|
3437
|
+
premountDisplay: premountDisplay ?? null,
|
|
3438
|
+
rootId,
|
|
3439
|
+
showInTimeline,
|
|
3440
|
+
src: isMedia.data.src,
|
|
3441
|
+
getStack: () => stackRef.current,
|
|
3442
|
+
startMediaFrom: isMedia.data.startMediaFrom,
|
|
3443
|
+
volume: isMedia.data.volumes
|
|
3444
|
+
});
|
|
3445
|
+
}
|
|
3332
3446
|
return () => {
|
|
3333
3447
|
unregisterSequence(id);
|
|
3334
3448
|
};
|
|
@@ -3344,11 +3458,11 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3344
3458
|
showInTimeline,
|
|
3345
3459
|
nonce: nonce.get(),
|
|
3346
3460
|
loopDisplay,
|
|
3347
|
-
|
|
3461
|
+
getStack: () => stackRef.current,
|
|
3348
3462
|
premountDisplay: premountDisplay ?? null,
|
|
3349
3463
|
postmountDisplay: postmountDisplay ?? null,
|
|
3350
3464
|
controls: controls ?? null,
|
|
3351
|
-
effects:
|
|
3465
|
+
effects: _remotionInternalEffects ?? []
|
|
3352
3466
|
});
|
|
3353
3467
|
return () => {
|
|
3354
3468
|
unregisterSequence(id);
|
|
@@ -3367,12 +3481,11 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3367
3481
|
showInTimeline,
|
|
3368
3482
|
nonce,
|
|
3369
3483
|
loopDisplay,
|
|
3370
|
-
stackDoesntChange,
|
|
3371
3484
|
premountDisplay,
|
|
3372
3485
|
postmountDisplay,
|
|
3373
3486
|
env.isStudio,
|
|
3374
3487
|
controls,
|
|
3375
|
-
|
|
3488
|
+
_remotionInternalEffects,
|
|
3376
3489
|
isMedia
|
|
3377
3490
|
]);
|
|
3378
3491
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
@@ -3476,6 +3589,10 @@ var SequenceRefForwardingFunction = (props, ref) => {
|
|
|
3476
3589
|
};
|
|
3477
3590
|
var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
|
|
3478
3591
|
var Sequence = wrapInSchema(SequenceInner, sequenceSchema);
|
|
3592
|
+
var WEBGL_CONTEXT_DOCS_URL = "https://remotion.dev/docs/troubleshooting/webgl2-context";
|
|
3593
|
+
var webGlContextErrorMessage = (versionLabel, effectName) => `Failed to acquire ${versionLabel} context for ${effectName}. ` + 'Pass --gl=angle when using the CLI, set chromiumOptions: { gl: "angle" } when using SSR APIs, ' + 'or set "OpenGL render backend" to "angle" in the Advanced section when rendering in the Studio. ' + `See ${WEBGL_CONTEXT_DOCS_URL}`;
|
|
3594
|
+
var createWebGLContextError = (effectName) => new Error(webGlContextErrorMessage("WebGL", effectName));
|
|
3595
|
+
var createWebGL2ContextError = (effectName) => new Error(webGlContextErrorMessage("WebGL2", effectName));
|
|
3479
3596
|
|
|
3480
3597
|
class CanvasPool {
|
|
3481
3598
|
width;
|
|
@@ -3524,7 +3641,7 @@ class CanvasPool {
|
|
|
3524
3641
|
preserveDrawingBuffer: true
|
|
3525
3642
|
});
|
|
3526
3643
|
if (!ctx) {
|
|
3527
|
-
throw
|
|
3644
|
+
throw createWebGL2ContextError("canvas effect");
|
|
3528
3645
|
}
|
|
3529
3646
|
canvas.addEventListener("webglcontextlost", (e) => {
|
|
3530
3647
|
e.preventDefault();
|
|
@@ -3646,6 +3763,7 @@ var runEffectChain = async ({
|
|
|
3646
3763
|
if (isCancelled()) {
|
|
3647
3764
|
return false;
|
|
3648
3765
|
}
|
|
3766
|
+
let flipWebGLSourceY = true;
|
|
3649
3767
|
for (let runIndex = 0;runIndex < runs.length; runIndex++) {
|
|
3650
3768
|
const run = runs[runIndex];
|
|
3651
3769
|
const [a, b] = state.pool.getPair(run.backend);
|
|
@@ -3660,9 +3778,11 @@ var runEffectChain = async ({
|
|
|
3660
3778
|
params: eff.params,
|
|
3661
3779
|
width,
|
|
3662
3780
|
height,
|
|
3663
|
-
gpuDevice
|
|
3781
|
+
gpuDevice,
|
|
3782
|
+
flipSourceY: run.backend === "webgl2" ? flipWebGLSourceY : false
|
|
3664
3783
|
});
|
|
3665
3784
|
if (run.backend === "webgl2") {
|
|
3785
|
+
flipWebGLSourceY = false;
|
|
3666
3786
|
state.pool.assertContextNotLost(dst);
|
|
3667
3787
|
}
|
|
3668
3788
|
currentImage = dst;
|
|
@@ -3671,12 +3791,20 @@ var runEffectChain = async ({
|
|
|
3671
3791
|
lastTarget = currentImage ?? lastTarget;
|
|
3672
3792
|
const nextRun = runs[runIndex + 1];
|
|
3673
3793
|
if (nextRun && nextRun.backend !== run.backend && lastTarget) {
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3794
|
+
if (run.backend === "2d" && nextRun.backend === "webgl2") {
|
|
3795
|
+
currentImage = lastTarget;
|
|
3796
|
+
flipWebGLSourceY = true;
|
|
3797
|
+
} else {
|
|
3798
|
+
const bitmap = await createImageBitmap(lastTarget);
|
|
3799
|
+
if (isCancelled()) {
|
|
3800
|
+
bitmap.close();
|
|
3801
|
+
return false;
|
|
3802
|
+
}
|
|
3803
|
+
currentImage = bitmap;
|
|
3804
|
+
if (nextRun.backend === "webgl2") {
|
|
3805
|
+
flipWebGLSourceY = false;
|
|
3806
|
+
}
|
|
3678
3807
|
}
|
|
3679
|
-
currentImage = bitmap;
|
|
3680
3808
|
}
|
|
3681
3809
|
}
|
|
3682
3810
|
if (!lastTarget) {
|
|
@@ -3691,8 +3819,8 @@ var runEffectChain = async ({
|
|
|
3691
3819
|
return true;
|
|
3692
3820
|
};
|
|
3693
3821
|
var useEffectChainState = () => {
|
|
3694
|
-
const chainStateRef =
|
|
3695
|
-
const sizeRef =
|
|
3822
|
+
const chainStateRef = useRef7(null);
|
|
3823
|
+
const sizeRef = useRef7(null);
|
|
3696
3824
|
useEffect4(() => {
|
|
3697
3825
|
return () => {
|
|
3698
3826
|
if (chainStateRef.current) {
|
|
@@ -3713,186 +3841,6 @@ var useEffectChainState = () => {
|
|
|
3713
3841
|
}
|
|
3714
3842
|
}), []);
|
|
3715
3843
|
};
|
|
3716
|
-
var solidSchema = {
|
|
3717
|
-
color: {
|
|
3718
|
-
type: "color",
|
|
3719
|
-
default: "#ffffff",
|
|
3720
|
-
description: "Color"
|
|
3721
|
-
},
|
|
3722
|
-
width: {
|
|
3723
|
-
type: "number",
|
|
3724
|
-
min: 1,
|
|
3725
|
-
step: 1,
|
|
3726
|
-
default: 1920,
|
|
3727
|
-
description: "Width"
|
|
3728
|
-
},
|
|
3729
|
-
height: {
|
|
3730
|
-
type: "number",
|
|
3731
|
-
min: 1,
|
|
3732
|
-
step: 1,
|
|
3733
|
-
default: 1080,
|
|
3734
|
-
description: "Height"
|
|
3735
|
-
},
|
|
3736
|
-
...sequenceStyleSchema
|
|
3737
|
-
};
|
|
3738
|
-
var SolidInner = ({
|
|
3739
|
-
color,
|
|
3740
|
-
width,
|
|
3741
|
-
height,
|
|
3742
|
-
_experimentalEffects: experimentalEffects = [],
|
|
3743
|
-
className,
|
|
3744
|
-
style,
|
|
3745
|
-
overrideId,
|
|
3746
|
-
ref
|
|
3747
|
-
}) => {
|
|
3748
|
-
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
3749
|
-
const [outputCanvas, setOutputCanvas] = useState6(null);
|
|
3750
|
-
const memoizedEffects = useMemoizedEffects({
|
|
3751
|
-
effects: experimentalEffects,
|
|
3752
|
-
overrideId: overrideId ?? null
|
|
3753
|
-
});
|
|
3754
|
-
const sourceCanvas = useMemo16(() => {
|
|
3755
|
-
if (typeof document === "undefined") {
|
|
3756
|
-
return null;
|
|
3757
|
-
}
|
|
3758
|
-
const canvas = document.createElement("canvas");
|
|
3759
|
-
canvas.width = 1;
|
|
3760
|
-
canvas.height = 1;
|
|
3761
|
-
return canvas;
|
|
3762
|
-
}, []);
|
|
3763
|
-
const chainState = useEffectChainState();
|
|
3764
|
-
const canvasRef = useCallback6((canvas) => {
|
|
3765
|
-
setOutputCanvas(canvas);
|
|
3766
|
-
if (typeof ref === "function") {
|
|
3767
|
-
ref(canvas);
|
|
3768
|
-
} else if (ref) {
|
|
3769
|
-
ref.current = canvas;
|
|
3770
|
-
}
|
|
3771
|
-
}, [ref]);
|
|
3772
|
-
useEffect5(() => {
|
|
3773
|
-
if (!outputCanvas || !sourceCanvas) {
|
|
3774
|
-
return;
|
|
3775
|
-
}
|
|
3776
|
-
const handle = delayRender2("Solid effect chain");
|
|
3777
|
-
if (!chainState) {
|
|
3778
|
-
continueRender2(handle);
|
|
3779
|
-
return () => {
|
|
3780
|
-
continueRender2(handle);
|
|
3781
|
-
};
|
|
3782
|
-
}
|
|
3783
|
-
const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
|
|
3784
|
-
if (!ctx) {
|
|
3785
|
-
cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
|
|
3786
|
-
return;
|
|
3787
|
-
}
|
|
3788
|
-
ctx.fillStyle = color;
|
|
3789
|
-
ctx.fillRect(0, 0, 1, 1);
|
|
3790
|
-
runEffectChain({
|
|
3791
|
-
state: chainState.get(width, height),
|
|
3792
|
-
source: sourceCanvas,
|
|
3793
|
-
effects: memoizedEffects,
|
|
3794
|
-
output: outputCanvas,
|
|
3795
|
-
width,
|
|
3796
|
-
height
|
|
3797
|
-
}).then((completed) => {
|
|
3798
|
-
if (completed) {
|
|
3799
|
-
continueRender2(handle);
|
|
3800
|
-
}
|
|
3801
|
-
}).catch((err) => {
|
|
3802
|
-
cancelRender2(err);
|
|
3803
|
-
});
|
|
3804
|
-
return () => {
|
|
3805
|
-
continueRender2(handle);
|
|
3806
|
-
};
|
|
3807
|
-
}, [
|
|
3808
|
-
color,
|
|
3809
|
-
outputCanvas,
|
|
3810
|
-
sourceCanvas,
|
|
3811
|
-
chainState,
|
|
3812
|
-
width,
|
|
3813
|
-
height,
|
|
3814
|
-
delayRender2,
|
|
3815
|
-
continueRender2,
|
|
3816
|
-
cancelRender2,
|
|
3817
|
-
memoizedEffects
|
|
3818
|
-
]);
|
|
3819
|
-
return /* @__PURE__ */ jsx12("canvas", {
|
|
3820
|
-
ref: canvasRef,
|
|
3821
|
-
width,
|
|
3822
|
-
height,
|
|
3823
|
-
className,
|
|
3824
|
-
style
|
|
3825
|
-
});
|
|
3826
|
-
};
|
|
3827
|
-
var SolidOuter = forwardRef4(({
|
|
3828
|
-
_experimentalEffects = [],
|
|
3829
|
-
_experimentalControls: controls,
|
|
3830
|
-
color,
|
|
3831
|
-
height,
|
|
3832
|
-
width,
|
|
3833
|
-
className,
|
|
3834
|
-
durationInFrames,
|
|
3835
|
-
style,
|
|
3836
|
-
name,
|
|
3837
|
-
from,
|
|
3838
|
-
hidden,
|
|
3839
|
-
showInTimeline,
|
|
3840
|
-
...props
|
|
3841
|
-
}, ref) => {
|
|
3842
|
-
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
|
|
3843
|
-
return /* @__PURE__ */ jsx12(Sequence, {
|
|
3844
|
-
layout: "none",
|
|
3845
|
-
from,
|
|
3846
|
-
hidden,
|
|
3847
|
-
showInTimeline,
|
|
3848
|
-
_experimentalControls: controls,
|
|
3849
|
-
_experimentalEffects: memoizedEffectDefinitions,
|
|
3850
|
-
durationInFrames,
|
|
3851
|
-
name: name ?? "<Solid>",
|
|
3852
|
-
...props,
|
|
3853
|
-
children: /* @__PURE__ */ jsx12(SolidInner, {
|
|
3854
|
-
ref,
|
|
3855
|
-
overrideId: controls?.overrideId ?? null,
|
|
3856
|
-
color,
|
|
3857
|
-
height,
|
|
3858
|
-
width,
|
|
3859
|
-
className,
|
|
3860
|
-
style,
|
|
3861
|
-
_experimentalEffects
|
|
3862
|
-
})
|
|
3863
|
-
});
|
|
3864
|
-
});
|
|
3865
|
-
var Solid = wrapInSchema(SolidOuter, solidSchema);
|
|
3866
|
-
Solid.displayName = "Solid";
|
|
3867
|
-
addSequenceStackTraces(Solid);
|
|
3868
|
-
var VERSION = "4.0.463";
|
|
3869
|
-
var checkMultipleRemotionVersions = () => {
|
|
3870
|
-
if (typeof globalThis === "undefined") {
|
|
3871
|
-
return;
|
|
3872
|
-
}
|
|
3873
|
-
const set = () => {
|
|
3874
|
-
globalThis.remotion_imported = VERSION;
|
|
3875
|
-
if (typeof window !== "undefined") {
|
|
3876
|
-
window.remotion_imported = VERSION;
|
|
3877
|
-
}
|
|
3878
|
-
};
|
|
3879
|
-
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
3880
|
-
if (alreadyImported) {
|
|
3881
|
-
if (alreadyImported === VERSION) {
|
|
3882
|
-
return;
|
|
3883
|
-
}
|
|
3884
|
-
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
3885
|
-
set();
|
|
3886
|
-
return;
|
|
3887
|
-
}
|
|
3888
|
-
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
3889
|
-
VERSION,
|
|
3890
|
-
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
3891
|
-
].filter(truthy).join(" and ")}. This will cause things to break in an unexpected way.
|
|
3892
|
-
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.`);
|
|
3893
|
-
}
|
|
3894
|
-
set();
|
|
3895
|
-
};
|
|
3896
3844
|
var calcArgs = (fit, frameSize, canvasSize) => {
|
|
3897
3845
|
switch (fit) {
|
|
3898
3846
|
case "fill": {
|
|
@@ -3941,29 +3889,49 @@ var calcArgs = (fit, frameSize, canvasSize) => {
|
|
|
3941
3889
|
throw new Error("Unknown fit: " + fit);
|
|
3942
3890
|
}
|
|
3943
3891
|
};
|
|
3944
|
-
var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
|
|
3945
|
-
const canvasRef =
|
|
3946
|
-
const
|
|
3892
|
+
var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects }, ref) => {
|
|
3893
|
+
const canvasRef = useRef8(null);
|
|
3894
|
+
const chainState = useEffectChainState();
|
|
3895
|
+
const sourceCanvas = useMemo16(() => {
|
|
3896
|
+
if (typeof document === "undefined") {
|
|
3897
|
+
return null;
|
|
3898
|
+
}
|
|
3899
|
+
return document.createElement("canvas");
|
|
3900
|
+
}, []);
|
|
3901
|
+
const draw = useCallback6(async (imageData) => {
|
|
3947
3902
|
const canvas = canvasRef.current;
|
|
3948
3903
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
3949
3904
|
const canvasHeight = height ?? imageData.displayHeight;
|
|
3950
3905
|
if (!canvas) {
|
|
3951
3906
|
throw new Error("Canvas ref is not set");
|
|
3952
3907
|
}
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
throw new Error("Could not get 2d context");
|
|
3908
|
+
if (!sourceCanvas) {
|
|
3909
|
+
throw new Error("Source canvas is not available");
|
|
3956
3910
|
}
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3911
|
+
sourceCanvas.width = canvasWidth;
|
|
3912
|
+
sourceCanvas.height = canvasHeight;
|
|
3913
|
+
const sourceCtx = sourceCanvas.getContext("2d");
|
|
3914
|
+
if (!sourceCtx) {
|
|
3915
|
+
throw new Error("Could not get 2d context for source canvas");
|
|
3916
|
+
}
|
|
3917
|
+
sourceCtx.drawImage(imageData, ...calcArgs(fit, {
|
|
3960
3918
|
height: imageData.displayHeight,
|
|
3961
3919
|
width: imageData.displayWidth
|
|
3962
3920
|
}, {
|
|
3963
3921
|
width: canvasWidth,
|
|
3964
3922
|
height: canvasHeight
|
|
3965
3923
|
}));
|
|
3966
|
-
|
|
3924
|
+
canvas.width = canvasWidth;
|
|
3925
|
+
canvas.height = canvasHeight;
|
|
3926
|
+
return runEffectChain({
|
|
3927
|
+
state: chainState.get(canvasWidth, canvasHeight),
|
|
3928
|
+
source: sourceCanvas,
|
|
3929
|
+
effects,
|
|
3930
|
+
output: canvas,
|
|
3931
|
+
width: canvasWidth,
|
|
3932
|
+
height: canvasHeight
|
|
3933
|
+
});
|
|
3934
|
+
}, [chainState, effects, fit, height, sourceCanvas, width]);
|
|
3967
3935
|
useImperativeHandle(ref, () => {
|
|
3968
3936
|
return {
|
|
3969
3937
|
draw,
|
|
@@ -3982,13 +3950,13 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref
|
|
|
3982
3950
|
}
|
|
3983
3951
|
};
|
|
3984
3952
|
}, [draw]);
|
|
3985
|
-
return /* @__PURE__ */
|
|
3953
|
+
return /* @__PURE__ */ jsx12("canvas", {
|
|
3986
3954
|
ref: canvasRef,
|
|
3987
3955
|
className,
|
|
3988
3956
|
style
|
|
3989
3957
|
});
|
|
3990
3958
|
};
|
|
3991
|
-
var Canvas =
|
|
3959
|
+
var Canvas = React14.forwardRef(CanvasRefForwardingFunction);
|
|
3992
3960
|
var CACHE_SIZE = 5;
|
|
3993
3961
|
var getActualTime = ({
|
|
3994
3962
|
loopBehavior,
|
|
@@ -4144,10 +4112,10 @@ var animatedImageSchema = {
|
|
|
4144
4112
|
default: 1,
|
|
4145
4113
|
description: "Playback Rate"
|
|
4146
4114
|
},
|
|
4147
|
-
...
|
|
4115
|
+
...sequenceVisualStyleSchema,
|
|
4148
4116
|
hidden: hiddenField
|
|
4149
4117
|
};
|
|
4150
|
-
var AnimatedImageContent =
|
|
4118
|
+
var AnimatedImageContent = forwardRef4(({
|
|
4151
4119
|
src,
|
|
4152
4120
|
width,
|
|
4153
4121
|
height,
|
|
@@ -4155,26 +4123,24 @@ var AnimatedImageContent = forwardRef5(({
|
|
|
4155
4123
|
loopBehavior = "loop",
|
|
4156
4124
|
playbackRate = 1,
|
|
4157
4125
|
fit = "fill",
|
|
4126
|
+
effects,
|
|
4127
|
+
controls,
|
|
4158
4128
|
...props
|
|
4159
4129
|
}, canvasRef) => {
|
|
4160
|
-
const mountState = useRef8({ isMounted: true });
|
|
4161
|
-
useEffect6(() => {
|
|
4162
|
-
const { current } = mountState;
|
|
4163
|
-
current.isMounted = true;
|
|
4164
|
-
return () => {
|
|
4165
|
-
current.isMounted = false;
|
|
4166
|
-
};
|
|
4167
|
-
}, []);
|
|
4168
4130
|
const resolvedSrc = resolveAnimatedImageSource(src);
|
|
4169
|
-
const [imageDecoder, setImageDecoder] =
|
|
4131
|
+
const [imageDecoder, setImageDecoder] = useState6(null);
|
|
4170
4132
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
4171
|
-
const [decodeHandle] =
|
|
4133
|
+
const [decodeHandle] = useState6(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
|
|
4172
4134
|
const frame = useCurrentFrame();
|
|
4173
4135
|
const { fps } = useVideoConfig();
|
|
4174
4136
|
const currentTime = frame / playbackRate / fps;
|
|
4175
|
-
const currentTimeRef =
|
|
4137
|
+
const currentTimeRef = useRef9(currentTime);
|
|
4176
4138
|
currentTimeRef.current = currentTime;
|
|
4177
|
-
const ref =
|
|
4139
|
+
const ref = useRef9(null);
|
|
4140
|
+
const memoizedEffects = useMemoizedEffects({
|
|
4141
|
+
effects,
|
|
4142
|
+
overrideId: controls?.overrideId ?? null
|
|
4143
|
+
});
|
|
4178
4144
|
useImperativeHandle2(canvasRef, () => {
|
|
4179
4145
|
const c = ref.current?.getCanvas();
|
|
4180
4146
|
if (!c) {
|
|
@@ -4182,8 +4148,8 @@ var AnimatedImageContent = forwardRef5(({
|
|
|
4182
4148
|
}
|
|
4183
4149
|
return c;
|
|
4184
4150
|
}, []);
|
|
4185
|
-
const [initialLoopBehavior] =
|
|
4186
|
-
|
|
4151
|
+
const [initialLoopBehavior] = useState6(() => loopBehavior);
|
|
4152
|
+
useEffect5(() => {
|
|
4187
4153
|
const controller = new AbortController;
|
|
4188
4154
|
decodeImage({
|
|
4189
4155
|
resolvedSrc,
|
|
@@ -4220,16 +4186,24 @@ var AnimatedImageContent = forwardRef5(({
|
|
|
4220
4186
|
return;
|
|
4221
4187
|
}
|
|
4222
4188
|
const delay = delayRender2(`Rendering frame at ${currentTime} of <AnimatedImage src="${src}"/>`);
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4189
|
+
let cancelled = false;
|
|
4190
|
+
imageDecoder.getFrame(currentTime, loopBehavior).then(async (videoFrame) => {
|
|
4191
|
+
if (cancelled) {
|
|
4192
|
+
return;
|
|
4193
|
+
}
|
|
4194
|
+
if (videoFrame === null) {
|
|
4195
|
+
ref.current?.clear();
|
|
4196
|
+
continueRender2(delay);
|
|
4197
|
+
return;
|
|
4198
|
+
}
|
|
4199
|
+
const completed = await ref.current?.draw(videoFrame.frame);
|
|
4200
|
+
if (completed && !cancelled) {
|
|
4201
|
+
continueRender2(delay);
|
|
4230
4202
|
}
|
|
4231
|
-
continueRender2(delay);
|
|
4232
4203
|
}).catch((err) => {
|
|
4204
|
+
if (cancelled) {
|
|
4205
|
+
return;
|
|
4206
|
+
}
|
|
4233
4207
|
if (onError) {
|
|
4234
4208
|
onError(err);
|
|
4235
4209
|
continueRender2(delay);
|
|
@@ -4237,6 +4211,10 @@ var AnimatedImageContent = forwardRef5(({
|
|
|
4237
4211
|
cancelRender(err);
|
|
4238
4212
|
}
|
|
4239
4213
|
});
|
|
4214
|
+
return () => {
|
|
4215
|
+
cancelled = true;
|
|
4216
|
+
continueRender2(delay);
|
|
4217
|
+
};
|
|
4240
4218
|
}, [
|
|
4241
4219
|
currentTime,
|
|
4242
4220
|
imageDecoder,
|
|
@@ -4244,13 +4222,18 @@ var AnimatedImageContent = forwardRef5(({
|
|
|
4244
4222
|
onError,
|
|
4245
4223
|
src,
|
|
4246
4224
|
continueRender2,
|
|
4247
|
-
delayRender2
|
|
4225
|
+
delayRender2,
|
|
4226
|
+
memoizedEffects,
|
|
4227
|
+
fit,
|
|
4228
|
+
width,
|
|
4229
|
+
height
|
|
4248
4230
|
]);
|
|
4249
|
-
return /* @__PURE__ */
|
|
4231
|
+
return /* @__PURE__ */ jsx13(Canvas, {
|
|
4250
4232
|
ref,
|
|
4251
4233
|
width,
|
|
4252
4234
|
height,
|
|
4253
4235
|
fit,
|
|
4236
|
+
effects: memoizedEffects,
|
|
4254
4237
|
...props
|
|
4255
4238
|
});
|
|
4256
4239
|
});
|
|
@@ -4267,12 +4250,14 @@ var AnimatedImageInner = ({
|
|
|
4267
4250
|
className,
|
|
4268
4251
|
style,
|
|
4269
4252
|
durationInFrames,
|
|
4253
|
+
effects = [],
|
|
4270
4254
|
_experimentalControls: controls,
|
|
4271
4255
|
ref,
|
|
4272
4256
|
...sequenceProps
|
|
4273
4257
|
}) => {
|
|
4274
4258
|
const { durationInFrames: videoDuration } = useVideoConfig();
|
|
4275
4259
|
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
4260
|
+
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
4276
4261
|
const animatedImageProps = {
|
|
4277
4262
|
src,
|
|
4278
4263
|
width,
|
|
@@ -4285,21 +4270,179 @@ var AnimatedImageInner = ({
|
|
|
4285
4270
|
className,
|
|
4286
4271
|
style
|
|
4287
4272
|
};
|
|
4288
|
-
return /* @__PURE__ */
|
|
4273
|
+
return /* @__PURE__ */ jsx13(Sequence, {
|
|
4289
4274
|
layout: "none",
|
|
4290
4275
|
durationInFrames: resolvedDuration,
|
|
4291
4276
|
name: "<AnimatedImage>",
|
|
4292
4277
|
_experimentalControls: controls,
|
|
4278
|
+
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
4293
4279
|
...sequenceProps,
|
|
4294
|
-
children: /* @__PURE__ */
|
|
4280
|
+
children: /* @__PURE__ */ jsx13(AnimatedImageContent, {
|
|
4295
4281
|
...animatedImageProps,
|
|
4296
|
-
ref
|
|
4282
|
+
ref,
|
|
4283
|
+
effects,
|
|
4284
|
+
controls
|
|
4297
4285
|
})
|
|
4298
4286
|
});
|
|
4299
4287
|
};
|
|
4300
4288
|
var AnimatedImage = wrapInSchema(AnimatedImageInner, animatedImageSchema);
|
|
4301
4289
|
AnimatedImage.displayName = "AnimatedImage";
|
|
4302
4290
|
addSequenceStackTraces(AnimatedImage);
|
|
4291
|
+
var solidSchema = {
|
|
4292
|
+
color: {
|
|
4293
|
+
type: "color",
|
|
4294
|
+
default: "transparent",
|
|
4295
|
+
description: "Color"
|
|
4296
|
+
},
|
|
4297
|
+
width: {
|
|
4298
|
+
type: "number",
|
|
4299
|
+
min: 1,
|
|
4300
|
+
step: 1,
|
|
4301
|
+
default: 1920,
|
|
4302
|
+
description: "Width"
|
|
4303
|
+
},
|
|
4304
|
+
height: {
|
|
4305
|
+
type: "number",
|
|
4306
|
+
min: 1,
|
|
4307
|
+
step: 1,
|
|
4308
|
+
default: 1080,
|
|
4309
|
+
description: "Height"
|
|
4310
|
+
},
|
|
4311
|
+
...sequenceVisualStyleSchema
|
|
4312
|
+
};
|
|
4313
|
+
var SolidInner = ({
|
|
4314
|
+
color,
|
|
4315
|
+
width,
|
|
4316
|
+
height,
|
|
4317
|
+
effects = [],
|
|
4318
|
+
className,
|
|
4319
|
+
style,
|
|
4320
|
+
overrideId,
|
|
4321
|
+
ref
|
|
4322
|
+
}) => {
|
|
4323
|
+
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
4324
|
+
const [outputCanvas, setOutputCanvas] = useState7(null);
|
|
4325
|
+
const memoizedEffects = useMemoizedEffects({
|
|
4326
|
+
effects,
|
|
4327
|
+
overrideId: overrideId ?? null
|
|
4328
|
+
});
|
|
4329
|
+
const sourceCanvas = useMemo17(() => {
|
|
4330
|
+
if (typeof document === "undefined") {
|
|
4331
|
+
return null;
|
|
4332
|
+
}
|
|
4333
|
+
const canvas = document.createElement("canvas");
|
|
4334
|
+
canvas.width = 1;
|
|
4335
|
+
canvas.height = 1;
|
|
4336
|
+
return canvas;
|
|
4337
|
+
}, []);
|
|
4338
|
+
const chainState = useEffectChainState();
|
|
4339
|
+
const canvasRef = useCallback7((canvas) => {
|
|
4340
|
+
setOutputCanvas(canvas);
|
|
4341
|
+
if (typeof ref === "function") {
|
|
4342
|
+
ref(canvas);
|
|
4343
|
+
} else if (ref) {
|
|
4344
|
+
ref.current = canvas;
|
|
4345
|
+
}
|
|
4346
|
+
}, [ref]);
|
|
4347
|
+
useEffect6(() => {
|
|
4348
|
+
if (!outputCanvas || !sourceCanvas) {
|
|
4349
|
+
return;
|
|
4350
|
+
}
|
|
4351
|
+
const handle = delayRender2("Solid effect chain");
|
|
4352
|
+
if (!chainState) {
|
|
4353
|
+
continueRender2(handle);
|
|
4354
|
+
return () => {
|
|
4355
|
+
continueRender2(handle);
|
|
4356
|
+
};
|
|
4357
|
+
}
|
|
4358
|
+
const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
|
|
4359
|
+
if (!ctx) {
|
|
4360
|
+
cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
|
|
4361
|
+
return;
|
|
4362
|
+
}
|
|
4363
|
+
ctx.clearRect(0, 0, 1, 1);
|
|
4364
|
+
if (color !== undefined) {
|
|
4365
|
+
ctx.fillStyle = color;
|
|
4366
|
+
ctx.fillRect(0, 0, 1, 1);
|
|
4367
|
+
}
|
|
4368
|
+
runEffectChain({
|
|
4369
|
+
state: chainState.get(width, height),
|
|
4370
|
+
source: sourceCanvas,
|
|
4371
|
+
effects: memoizedEffects,
|
|
4372
|
+
output: outputCanvas,
|
|
4373
|
+
width,
|
|
4374
|
+
height
|
|
4375
|
+
}).then((completed) => {
|
|
4376
|
+
if (completed) {
|
|
4377
|
+
continueRender2(handle);
|
|
4378
|
+
}
|
|
4379
|
+
}).catch((err) => {
|
|
4380
|
+
cancelRender2(err);
|
|
4381
|
+
});
|
|
4382
|
+
return () => {
|
|
4383
|
+
continueRender2(handle);
|
|
4384
|
+
};
|
|
4385
|
+
}, [
|
|
4386
|
+
color,
|
|
4387
|
+
outputCanvas,
|
|
4388
|
+
sourceCanvas,
|
|
4389
|
+
chainState,
|
|
4390
|
+
width,
|
|
4391
|
+
height,
|
|
4392
|
+
delayRender2,
|
|
4393
|
+
continueRender2,
|
|
4394
|
+
cancelRender2,
|
|
4395
|
+
memoizedEffects
|
|
4396
|
+
]);
|
|
4397
|
+
return /* @__PURE__ */ jsx14("canvas", {
|
|
4398
|
+
ref: canvasRef,
|
|
4399
|
+
width,
|
|
4400
|
+
height,
|
|
4401
|
+
className,
|
|
4402
|
+
style
|
|
4403
|
+
});
|
|
4404
|
+
};
|
|
4405
|
+
var SolidOuter = forwardRef5(({
|
|
4406
|
+
effects = [],
|
|
4407
|
+
_experimentalControls: controls,
|
|
4408
|
+
color,
|
|
4409
|
+
height,
|
|
4410
|
+
width,
|
|
4411
|
+
className,
|
|
4412
|
+
durationInFrames,
|
|
4413
|
+
style,
|
|
4414
|
+
name,
|
|
4415
|
+
from,
|
|
4416
|
+
hidden,
|
|
4417
|
+
showInTimeline,
|
|
4418
|
+
...props
|
|
4419
|
+
}, ref) => {
|
|
4420
|
+
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
4421
|
+
return /* @__PURE__ */ jsx14(Sequence, {
|
|
4422
|
+
layout: "none",
|
|
4423
|
+
from,
|
|
4424
|
+
hidden,
|
|
4425
|
+
showInTimeline,
|
|
4426
|
+
_experimentalControls: controls,
|
|
4427
|
+
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
4428
|
+
durationInFrames,
|
|
4429
|
+
name: name ?? "<Solid>",
|
|
4430
|
+
...props,
|
|
4431
|
+
children: /* @__PURE__ */ jsx14(SolidInner, {
|
|
4432
|
+
ref,
|
|
4433
|
+
overrideId: controls?.overrideId ?? null,
|
|
4434
|
+
color,
|
|
4435
|
+
height,
|
|
4436
|
+
width,
|
|
4437
|
+
className,
|
|
4438
|
+
style,
|
|
4439
|
+
effects
|
|
4440
|
+
})
|
|
4441
|
+
});
|
|
4442
|
+
});
|
|
4443
|
+
var Solid = wrapInSchema(SolidOuter, solidSchema);
|
|
4444
|
+
Solid.displayName = "Solid";
|
|
4445
|
+
addSequenceStackTraces(Solid);
|
|
4303
4446
|
var cachedSupport = null;
|
|
4304
4447
|
var isHtmlInCanvasSupported = () => {
|
|
4305
4448
|
if (cachedSupport !== null) {
|
|
@@ -4310,7 +4453,7 @@ var isHtmlInCanvasSupported = () => {
|
|
|
4310
4453
|
}
|
|
4311
4454
|
const canvas = document.createElement("canvas");
|
|
4312
4455
|
const ctx = canvas.getContext("2d");
|
|
4313
|
-
cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function";
|
|
4456
|
+
cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function" && "transferControlToOffscreen" in HTMLCanvasElement.prototype;
|
|
4314
4457
|
return cachedSupport;
|
|
4315
4458
|
};
|
|
4316
4459
|
var HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";
|
|
@@ -4346,8 +4489,10 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4346
4489
|
if (!isHtmlInCanvasSupported()) {
|
|
4347
4490
|
cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
|
|
4348
4491
|
}
|
|
4349
|
-
const canvas2dRef =
|
|
4350
|
-
const
|
|
4492
|
+
const canvas2dRef = useRef10(null);
|
|
4493
|
+
const offscreenRef = useRef10(null);
|
|
4494
|
+
const divRef = useRef10(null);
|
|
4495
|
+
const canvasSizeKey = `${width}x${height}`;
|
|
4351
4496
|
const setLayoutCanvasRef = useCallback8((node) => {
|
|
4352
4497
|
canvas2dRef.current = node;
|
|
4353
4498
|
if (typeof ref === "function") {
|
|
@@ -4356,45 +4501,48 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4356
4501
|
ref.current = node;
|
|
4357
4502
|
}
|
|
4358
4503
|
}, [ref]);
|
|
4359
|
-
const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
|
|
4360
4504
|
const chainState = useEffectChainState();
|
|
4361
4505
|
const memoizedEffects = useMemoizedEffects({
|
|
4362
4506
|
effects,
|
|
4363
4507
|
overrideId: controls?.overrideId ?? null
|
|
4364
4508
|
});
|
|
4365
|
-
const effectsRef =
|
|
4509
|
+
const effectsRef = useRef10(memoizedEffects);
|
|
4366
4510
|
effectsRef.current = memoizedEffects;
|
|
4367
|
-
const onPaintRef =
|
|
4511
|
+
const onPaintRef = useRef10(onPaint);
|
|
4368
4512
|
onPaintRef.current = onPaint;
|
|
4369
|
-
const onInitRef =
|
|
4513
|
+
const onInitRef = useRef10(onInit);
|
|
4370
4514
|
onInitRef.current = onInit;
|
|
4371
|
-
const initializedRef =
|
|
4372
|
-
const onInitCleanupRef =
|
|
4373
|
-
const unmountedRef =
|
|
4515
|
+
const initializedRef = useRef10(false);
|
|
4516
|
+
const onInitCleanupRef = useRef10(null);
|
|
4517
|
+
const unmountedRef = useRef10(false);
|
|
4374
4518
|
const onPaintCb = useCallback8(async () => {
|
|
4375
4519
|
const element = divRef.current;
|
|
4376
4520
|
if (!element) {
|
|
4377
4521
|
throw new Error("Canvas or scene element not found");
|
|
4378
4522
|
}
|
|
4379
|
-
|
|
4380
|
-
|
|
4523
|
+
const offscreen = offscreenRef.current;
|
|
4524
|
+
if (!offscreen) {
|
|
4525
|
+
throw new Error("HtmlInCanvas: offscreen canvas not ready (transferControlToOffscreen failed or canvas is remounting)");
|
|
4526
|
+
}
|
|
4527
|
+
offscreen.width = width;
|
|
4528
|
+
offscreen.height = height;
|
|
4381
4529
|
try {
|
|
4382
|
-
const
|
|
4383
|
-
if (!
|
|
4530
|
+
const placeholderCanvas = canvas2dRef.current;
|
|
4531
|
+
if (!placeholderCanvas) {
|
|
4384
4532
|
throw new Error("Canvas not found");
|
|
4385
4533
|
}
|
|
4386
|
-
const
|
|
4387
|
-
if (!
|
|
4388
|
-
throw new Error("Failed to acquire 2D context for <HtmlInCanvas>
|
|
4534
|
+
const offscreen2d = offscreen.getContext("2d");
|
|
4535
|
+
if (!offscreen2d) {
|
|
4536
|
+
throw new Error("Failed to acquire 2D context for <HtmlInCanvas> offscreen canvas");
|
|
4389
4537
|
}
|
|
4390
4538
|
const handle = delayRender("onPaint");
|
|
4391
4539
|
if (!initializedRef.current) {
|
|
4392
4540
|
initializedRef.current = true;
|
|
4393
|
-
const initImage =
|
|
4541
|
+
const initImage = placeholderCanvas.captureElementImage(element);
|
|
4394
4542
|
const currentOnInit = onInitRef.current;
|
|
4395
4543
|
if (currentOnInit) {
|
|
4396
4544
|
const cleanup = await currentOnInit({
|
|
4397
|
-
canvas:
|
|
4545
|
+
canvas: offscreen,
|
|
4398
4546
|
element,
|
|
4399
4547
|
elementImage: initImage
|
|
4400
4548
|
});
|
|
@@ -4409,17 +4557,17 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4409
4557
|
}
|
|
4410
4558
|
}
|
|
4411
4559
|
const handler = onPaintRef.current ?? defaultOnPaint;
|
|
4412
|
-
const elImage =
|
|
4560
|
+
const elImage = placeholderCanvas.captureElementImage(element);
|
|
4413
4561
|
await handler({
|
|
4414
|
-
canvas:
|
|
4562
|
+
canvas: offscreen,
|
|
4415
4563
|
element,
|
|
4416
4564
|
elementImage: elImage
|
|
4417
4565
|
});
|
|
4418
4566
|
await runEffectChain({
|
|
4419
4567
|
state: chainState.get(width, height),
|
|
4420
|
-
source:
|
|
4568
|
+
source: offscreen,
|
|
4421
4569
|
effects: effectsRef.current,
|
|
4422
|
-
output:
|
|
4570
|
+
output: offscreen,
|
|
4423
4571
|
width,
|
|
4424
4572
|
height
|
|
4425
4573
|
});
|
|
@@ -4427,29 +4575,30 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4427
4575
|
} catch (error2) {
|
|
4428
4576
|
cancelRender2(error2);
|
|
4429
4577
|
}
|
|
4430
|
-
}, [
|
|
4431
|
-
chainState,
|
|
4432
|
-
continueRender2,
|
|
4433
|
-
cancelRender2,
|
|
4434
|
-
width,
|
|
4435
|
-
height,
|
|
4436
|
-
offscreenCanvas
|
|
4437
|
-
]);
|
|
4578
|
+
}, [chainState, continueRender2, cancelRender2, width, height]);
|
|
4438
4579
|
useLayoutEffect3(() => {
|
|
4439
|
-
const
|
|
4440
|
-
if (!
|
|
4580
|
+
const placeholder = canvas2dRef.current;
|
|
4581
|
+
if (!placeholder) {
|
|
4441
4582
|
throw new Error("Canvas not found");
|
|
4442
4583
|
}
|
|
4443
|
-
|
|
4444
|
-
|
|
4584
|
+
placeholder.layoutSubtree = true;
|
|
4585
|
+
const offscreen = placeholder.transferControlToOffscreen();
|
|
4586
|
+
offscreenRef.current = offscreen;
|
|
4587
|
+
offscreen.width = width;
|
|
4588
|
+
offscreen.height = height;
|
|
4589
|
+
initializedRef.current = false;
|
|
4590
|
+
unmountedRef.current = false;
|
|
4591
|
+
placeholder.addEventListener("paint", onPaintCb);
|
|
4445
4592
|
return () => {
|
|
4446
|
-
|
|
4593
|
+
placeholder.removeEventListener("paint", onPaintCb);
|
|
4594
|
+
offscreenRef.current = null;
|
|
4595
|
+
initializedRef.current = false;
|
|
4447
4596
|
unmountedRef.current = true;
|
|
4448
4597
|
onInitCleanupRef.current?.();
|
|
4449
4598
|
onInitCleanupRef.current = null;
|
|
4450
4599
|
};
|
|
4451
|
-
}, [onPaintCb, cancelRender2]);
|
|
4452
|
-
const onPaintChangedRef =
|
|
4600
|
+
}, [onPaintCb, cancelRender2, width, height]);
|
|
4601
|
+
const onPaintChangedRef = useRef10(false);
|
|
4453
4602
|
useLayoutEffect3(() => {
|
|
4454
4603
|
if (!onPaintChangedRef.current) {
|
|
4455
4604
|
onPaintChangedRef.current = true;
|
|
@@ -4473,8 +4622,8 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4473
4622
|
return () => {
|
|
4474
4623
|
continueRender2(handle);
|
|
4475
4624
|
};
|
|
4476
|
-
}, [width, height, continueRender2]);
|
|
4477
|
-
const innerStyle =
|
|
4625
|
+
}, [width, height, continueRender2, canvasSizeKey]);
|
|
4626
|
+
const innerStyle = useMemo18(() => {
|
|
4478
4627
|
return {
|
|
4479
4628
|
width,
|
|
4480
4629
|
height
|
|
@@ -4495,14 +4644,14 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4495
4644
|
style: innerStyle,
|
|
4496
4645
|
children
|
|
4497
4646
|
})
|
|
4498
|
-
})
|
|
4647
|
+
}, canvasSizeKey)
|
|
4499
4648
|
});
|
|
4500
4649
|
});
|
|
4501
4650
|
HtmlInCanvasContent.displayName = "HtmlInCanvasContent";
|
|
4502
4651
|
var HtmlInCanvasInner = forwardRef6(({
|
|
4503
4652
|
width,
|
|
4504
4653
|
height,
|
|
4505
|
-
|
|
4654
|
+
effects = [],
|
|
4506
4655
|
children,
|
|
4507
4656
|
onPaint,
|
|
4508
4657
|
onInit,
|
|
@@ -4519,7 +4668,7 @@ var HtmlInCanvasInner = forwardRef6(({
|
|
|
4519
4668
|
durationInFrames: resolvedDuration,
|
|
4520
4669
|
name: name ?? "<HtmlInCanvas>",
|
|
4521
4670
|
_experimentalControls: controls,
|
|
4522
|
-
|
|
4671
|
+
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
4523
4672
|
layout: "none",
|
|
4524
4673
|
...sequenceProps,
|
|
4525
4674
|
children: /* @__PURE__ */ jsx15(HtmlInCanvasContent, {
|
|
@@ -4537,7 +4686,7 @@ var HtmlInCanvasInner = forwardRef6(({
|
|
|
4537
4686
|
});
|
|
4538
4687
|
HtmlInCanvasInner.displayName = "HtmlInCanvas";
|
|
4539
4688
|
var htmlInCanvasSchema = {
|
|
4540
|
-
...
|
|
4689
|
+
...sequenceVisualStyleSchema,
|
|
4541
4690
|
hidden: hiddenField
|
|
4542
4691
|
};
|
|
4543
4692
|
var HtmlInCanvasWrapped = wrapInSchema(HtmlInCanvasInner, htmlInCanvasSchema);
|
|
@@ -4585,8 +4734,8 @@ var RenderAssetManager = createContext17({
|
|
|
4585
4734
|
renderAssets: []
|
|
4586
4735
|
});
|
|
4587
4736
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
4588
|
-
const [renderAssets, setRenderAssets] =
|
|
4589
|
-
const renderAssetsRef =
|
|
4737
|
+
const [renderAssets, setRenderAssets] = useState8([]);
|
|
4738
|
+
const renderAssetsRef = useRef11([]);
|
|
4590
4739
|
const registerRenderAsset = useCallback9((renderAsset) => {
|
|
4591
4740
|
validateRenderAsset(renderAsset);
|
|
4592
4741
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
@@ -4618,7 +4767,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
4618
4767
|
};
|
|
4619
4768
|
}
|
|
4620
4769
|
}, []);
|
|
4621
|
-
const contextValue =
|
|
4770
|
+
const contextValue = useMemo19(() => {
|
|
4622
4771
|
return {
|
|
4623
4772
|
registerRenderAsset,
|
|
4624
4773
|
unregisterRenderAsset,
|
|
@@ -4635,7 +4784,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
4635
4784
|
const { registerRenderAsset, unregisterRenderAsset } = useContext19(RenderAssetManager);
|
|
4636
4785
|
const env = useRemotionEnvironment();
|
|
4637
4786
|
const frame = useCurrentFrame();
|
|
4638
|
-
const [id] =
|
|
4787
|
+
const [id] = useState9(() => {
|
|
4639
4788
|
return String(Math.random());
|
|
4640
4789
|
});
|
|
4641
4790
|
useLayoutEffect5(() => {
|
|
@@ -4747,14 +4896,14 @@ var Loop = ({
|
|
|
4747
4896
|
const iteration = Math.floor(currentFrame / durationInFrames);
|
|
4748
4897
|
const start = iteration * durationInFrames;
|
|
4749
4898
|
const from = Math.min(start, maxFrame);
|
|
4750
|
-
const loopDisplay =
|
|
4899
|
+
const loopDisplay = useMemo20(() => {
|
|
4751
4900
|
return {
|
|
4752
4901
|
numberOfTimes: Math.min(compDuration / durationInFrames, times),
|
|
4753
4902
|
startOffset: -from,
|
|
4754
4903
|
durationInFrames
|
|
4755
4904
|
};
|
|
4756
4905
|
}, [compDuration, durationInFrames, from, times]);
|
|
4757
|
-
const loopContext =
|
|
4906
|
+
const loopContext = useMemo20(() => {
|
|
4758
4907
|
return {
|
|
4759
4908
|
iteration: Math.floor(currentFrame / durationInFrames),
|
|
4760
4909
|
durationInFrames
|
|
@@ -4792,7 +4941,7 @@ var setPreloads = (updater) => {
|
|
|
4792
4941
|
updaters.forEach((u) => u());
|
|
4793
4942
|
};
|
|
4794
4943
|
var PrefetchProvider = ({ children }) => {
|
|
4795
|
-
const [_preloads, _setPreloads] =
|
|
4944
|
+
const [_preloads, _setPreloads] = useState10(() => preloads);
|
|
4796
4945
|
useEffect7(() => {
|
|
4797
4946
|
const updaterFunction = () => {
|
|
4798
4947
|
_setPreloads(preloads);
|
|
@@ -5116,7 +5265,7 @@ var DurationsContext = createContext20({
|
|
|
5116
5265
|
});
|
|
5117
5266
|
var DurationsContextProvider = ({ children }) => {
|
|
5118
5267
|
const [durations, setDurations] = useReducer(durationReducer, {});
|
|
5119
|
-
const value =
|
|
5268
|
+
const value = useMemo21(() => {
|
|
5120
5269
|
return {
|
|
5121
5270
|
durations,
|
|
5122
5271
|
setDurations
|
|
@@ -5250,7 +5399,7 @@ var useSingletonAudioContext = ({
|
|
|
5250
5399
|
audioEnabled
|
|
5251
5400
|
}) => {
|
|
5252
5401
|
const env = useRemotionEnvironment();
|
|
5253
|
-
const context =
|
|
5402
|
+
const context = useMemo22(() => {
|
|
5254
5403
|
if (env.isRendering) {
|
|
5255
5404
|
return null;
|
|
5256
5405
|
}
|
|
@@ -5331,11 +5480,11 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
5331
5480
|
latencyHint: audioLatencyHint,
|
|
5332
5481
|
audioEnabled
|
|
5333
5482
|
});
|
|
5334
|
-
const audioContextIsPlayingEventually =
|
|
5335
|
-
const isResuming =
|
|
5336
|
-
const audioSyncAnchor =
|
|
5337
|
-
const audioSyncAnchorListeners =
|
|
5338
|
-
const audioSyncAnchorEmitter =
|
|
5483
|
+
const audioContextIsPlayingEventually = useRef12(false);
|
|
5484
|
+
const isResuming = useRef12(null);
|
|
5485
|
+
const audioSyncAnchor = useMemo23(() => ({ value: 0 }), []);
|
|
5486
|
+
const audioSyncAnchorListeners = useRef12([]);
|
|
5487
|
+
const audioSyncAnchorEmitter = useMemo23(() => {
|
|
5339
5488
|
return {
|
|
5340
5489
|
dispatch: (event) => {
|
|
5341
5490
|
audioSyncAnchorListeners.current.forEach((l) => l(event));
|
|
@@ -5350,12 +5499,12 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
5350
5499
|
}
|
|
5351
5500
|
};
|
|
5352
5501
|
}, []);
|
|
5353
|
-
const prevEndTimes =
|
|
5354
|
-
const nodesToResume =
|
|
5502
|
+
const prevEndTimes = useRef12({ scheduledEndTime: null, mediaEndTime: null });
|
|
5503
|
+
const nodesToResume = useRef12(new Map);
|
|
5355
5504
|
const unscheduleAudioNode = useCallback10((node) => {
|
|
5356
5505
|
nodesToResume.current.delete(node);
|
|
5357
5506
|
}, []);
|
|
5358
|
-
const scheduleAudioNode =
|
|
5507
|
+
const scheduleAudioNode = useMemo23(() => {
|
|
5359
5508
|
return ({
|
|
5360
5509
|
node,
|
|
5361
5510
|
mediaTimestamp,
|
|
@@ -5440,7 +5589,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
5440
5589
|
audioContextIsPlayingEventually.current = false;
|
|
5441
5590
|
ctxAndGain.audioContext.suspend();
|
|
5442
5591
|
}, [ctxAndGain]);
|
|
5443
|
-
const audioContextValue =
|
|
5592
|
+
const audioContextValue = useMemo23(() => {
|
|
5444
5593
|
return {
|
|
5445
5594
|
audioContext: ctxAndGain?.audioContext ?? null,
|
|
5446
5595
|
gainNode: ctxAndGain?.gainNode ?? null,
|
|
@@ -5468,8 +5617,8 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
5468
5617
|
});
|
|
5469
5618
|
};
|
|
5470
5619
|
var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
5471
|
-
const audios =
|
|
5472
|
-
const [initialNumberOfAudioTags] =
|
|
5620
|
+
const audios = useRef12([]);
|
|
5621
|
+
const [initialNumberOfAudioTags] = useState11(numberOfAudioTags);
|
|
5473
5622
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
5474
5623
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
5475
5624
|
}
|
|
@@ -5479,7 +5628,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
5479
5628
|
const audioCtx = useContext21(SharedAudioContext);
|
|
5480
5629
|
const audioContext = audioCtx?.audioContext ?? null;
|
|
5481
5630
|
const resume = audioCtx?.resume;
|
|
5482
|
-
const refs =
|
|
5631
|
+
const refs = useMemo23(() => {
|
|
5483
5632
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
5484
5633
|
const ref = createRef2();
|
|
5485
5634
|
return {
|
|
@@ -5502,7 +5651,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
5502
5651
|
});
|
|
5503
5652
|
};
|
|
5504
5653
|
}, [refs]);
|
|
5505
|
-
const takenAudios =
|
|
5654
|
+
const takenAudios = useRef12(new Array(numberOfAudioTags).fill(false));
|
|
5506
5655
|
const rerenderAudios = useCallback10(() => {
|
|
5507
5656
|
refs.forEach(({ ref, id }) => {
|
|
5508
5657
|
const data = audios.current?.find((a) => a.id === id);
|
|
@@ -5616,7 +5765,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
5616
5765
|
});
|
|
5617
5766
|
resume?.();
|
|
5618
5767
|
}, [logLevel, mountTime, refs, env.isPlayer, resume]);
|
|
5619
|
-
const audioTagsValue =
|
|
5768
|
+
const audioTagsValue = useMemo23(() => {
|
|
5620
5769
|
return {
|
|
5621
5770
|
registerAudio,
|
|
5622
5771
|
unregisterAudio,
|
|
@@ -5653,7 +5802,7 @@ var useSharedAudio = ({
|
|
|
5653
5802
|
}) => {
|
|
5654
5803
|
const audioCtx = useContext21(SharedAudioContext);
|
|
5655
5804
|
const tagsCtx = useContext21(SharedAudioTagsContext);
|
|
5656
|
-
const [elem] =
|
|
5805
|
+
const [elem] = useState11(() => {
|
|
5657
5806
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
5658
5807
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
5659
5808
|
}
|
|
@@ -5789,9 +5938,9 @@ var useAppendVideoFragment = ({
|
|
|
5789
5938
|
duration: initialDuration,
|
|
5790
5939
|
fps
|
|
5791
5940
|
}) => {
|
|
5792
|
-
const actualFromRef =
|
|
5793
|
-
const actualDuration =
|
|
5794
|
-
const actualSrc =
|
|
5941
|
+
const actualFromRef = useRef13(initialActualFrom);
|
|
5942
|
+
const actualDuration = useRef13(initialDuration);
|
|
5943
|
+
const actualSrc = useRef13(initialActualSrc);
|
|
5795
5944
|
if (!isSubsetOfDuration({
|
|
5796
5945
|
prevStartFrom: actualFromRef.current,
|
|
5797
5946
|
newStartFrom: initialActualFrom,
|
|
@@ -5828,8 +5977,8 @@ var useVolume = ({
|
|
|
5828
5977
|
source,
|
|
5829
5978
|
shouldUseWebAudioApi
|
|
5830
5979
|
}) => {
|
|
5831
|
-
const audioStuffRef =
|
|
5832
|
-
const currentVolumeRef =
|
|
5980
|
+
const audioStuffRef = useRef14(null);
|
|
5981
|
+
const currentVolumeRef = useRef14(volume);
|
|
5833
5982
|
currentVolumeRef.current = volume;
|
|
5834
5983
|
const sharedAudioContext = useContext22(SharedAudioContext);
|
|
5835
5984
|
if (!sharedAudioContext) {
|
|
@@ -5986,7 +6135,7 @@ var useBasicMediaInTimeline = ({
|
|
|
5986
6135
|
throw new Error("No src passed");
|
|
5987
6136
|
}
|
|
5988
6137
|
const parentSequence = useContext24(SequenceContext);
|
|
5989
|
-
const [initialVolume] =
|
|
6138
|
+
const [initialVolume] = useState12(() => volume);
|
|
5990
6139
|
const duration = getTimelineDuration({
|
|
5991
6140
|
compositionDurationInFrames: sequenceDurationInFrames,
|
|
5992
6141
|
playbackRate,
|
|
@@ -5995,7 +6144,7 @@ var useBasicMediaInTimeline = ({
|
|
|
5995
6144
|
parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
|
|
5996
6145
|
loop
|
|
5997
6146
|
});
|
|
5998
|
-
const volumes =
|
|
6147
|
+
const volumes = useMemo24(() => {
|
|
5999
6148
|
if (typeof volume === "number") {
|
|
6000
6149
|
return volume;
|
|
6001
6150
|
}
|
|
@@ -6016,7 +6165,7 @@ var useBasicMediaInTimeline = ({
|
|
|
6016
6165
|
const nonce = useNonce();
|
|
6017
6166
|
const { rootId } = useTimelineContext();
|
|
6018
6167
|
const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
|
|
6019
|
-
const memoizedResult =
|
|
6168
|
+
const memoizedResult = useMemo24(() => {
|
|
6020
6169
|
return {
|
|
6021
6170
|
volumes,
|
|
6022
6171
|
duration,
|
|
@@ -6041,85 +6190,6 @@ var useBasicMediaInTimeline = ({
|
|
|
6041
6190
|
]);
|
|
6042
6191
|
return memoizedResult;
|
|
6043
6192
|
};
|
|
6044
|
-
var useImageInTimeline = ({
|
|
6045
|
-
src,
|
|
6046
|
-
displayName,
|
|
6047
|
-
id,
|
|
6048
|
-
stack,
|
|
6049
|
-
showInTimeline,
|
|
6050
|
-
premountDisplay,
|
|
6051
|
-
postmountDisplay,
|
|
6052
|
-
loopDisplay,
|
|
6053
|
-
controls
|
|
6054
|
-
}) => {
|
|
6055
|
-
const parentSequence = useContext24(SequenceContext);
|
|
6056
|
-
const { registerSequence, unregisterSequence } = useContext24(SequenceManager);
|
|
6057
|
-
const { durationInFrames } = useVideoConfig();
|
|
6058
|
-
const mediaStartsAt = useMediaStartsAt();
|
|
6059
|
-
const { duration, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
|
|
6060
|
-
volume: undefined,
|
|
6061
|
-
mediaVolume: 0,
|
|
6062
|
-
mediaType: "image",
|
|
6063
|
-
src,
|
|
6064
|
-
displayName,
|
|
6065
|
-
trimAfter: undefined,
|
|
6066
|
-
trimBefore: undefined,
|
|
6067
|
-
playbackRate: 1,
|
|
6068
|
-
sequenceDurationInFrames: durationInFrames,
|
|
6069
|
-
mediaStartsAt,
|
|
6070
|
-
loop: false
|
|
6071
|
-
});
|
|
6072
|
-
const { isStudio } = useRemotionEnvironment();
|
|
6073
|
-
useEffect8(() => {
|
|
6074
|
-
if (!src) {
|
|
6075
|
-
throw new Error("No src passed");
|
|
6076
|
-
}
|
|
6077
|
-
if (!isStudio && window.process?.env?.NODE_ENV !== "test") {
|
|
6078
|
-
return;
|
|
6079
|
-
}
|
|
6080
|
-
if (!showInTimeline) {
|
|
6081
|
-
return;
|
|
6082
|
-
}
|
|
6083
|
-
registerSequence({
|
|
6084
|
-
type: "image",
|
|
6085
|
-
src,
|
|
6086
|
-
id,
|
|
6087
|
-
duration,
|
|
6088
|
-
from: 0,
|
|
6089
|
-
parent: parentSequence?.id ?? null,
|
|
6090
|
-
displayName: finalDisplayName,
|
|
6091
|
-
rootId,
|
|
6092
|
-
showInTimeline: true,
|
|
6093
|
-
nonce: nonce.get(),
|
|
6094
|
-
loopDisplay,
|
|
6095
|
-
stack,
|
|
6096
|
-
premountDisplay,
|
|
6097
|
-
postmountDisplay,
|
|
6098
|
-
controls,
|
|
6099
|
-
effects: []
|
|
6100
|
-
});
|
|
6101
|
-
return () => {
|
|
6102
|
-
unregisterSequence(id);
|
|
6103
|
-
};
|
|
6104
|
-
}, [
|
|
6105
|
-
duration,
|
|
6106
|
-
id,
|
|
6107
|
-
parentSequence,
|
|
6108
|
-
src,
|
|
6109
|
-
registerSequence,
|
|
6110
|
-
unregisterSequence,
|
|
6111
|
-
nonce,
|
|
6112
|
-
stack,
|
|
6113
|
-
showInTimeline,
|
|
6114
|
-
premountDisplay,
|
|
6115
|
-
postmountDisplay,
|
|
6116
|
-
isStudio,
|
|
6117
|
-
loopDisplay,
|
|
6118
|
-
rootId,
|
|
6119
|
-
finalDisplayName,
|
|
6120
|
-
controls
|
|
6121
|
-
]);
|
|
6122
|
-
};
|
|
6123
6193
|
var useMediaInTimeline = ({
|
|
6124
6194
|
volume,
|
|
6125
6195
|
mediaVolume,
|
|
@@ -6128,7 +6198,7 @@ var useMediaInTimeline = ({
|
|
|
6128
6198
|
playbackRate,
|
|
6129
6199
|
displayName,
|
|
6130
6200
|
id,
|
|
6131
|
-
|
|
6201
|
+
getStack,
|
|
6132
6202
|
showInTimeline,
|
|
6133
6203
|
premountDisplay,
|
|
6134
6204
|
postmountDisplay,
|
|
@@ -6179,7 +6249,7 @@ var useMediaInTimeline = ({
|
|
|
6179
6249
|
doesVolumeChange,
|
|
6180
6250
|
loopDisplay,
|
|
6181
6251
|
playbackRate,
|
|
6182
|
-
|
|
6252
|
+
getStack,
|
|
6183
6253
|
premountDisplay,
|
|
6184
6254
|
postmountDisplay,
|
|
6185
6255
|
controls: null,
|
|
@@ -6201,7 +6271,7 @@ var useMediaInTimeline = ({
|
|
|
6201
6271
|
mediaType,
|
|
6202
6272
|
startsAt,
|
|
6203
6273
|
playbackRate,
|
|
6204
|
-
|
|
6274
|
+
getStack,
|
|
6205
6275
|
showInTimeline,
|
|
6206
6276
|
premountDisplay,
|
|
6207
6277
|
postmountDisplay,
|
|
@@ -6212,12 +6282,12 @@ var useMediaInTimeline = ({
|
|
|
6212
6282
|
]);
|
|
6213
6283
|
};
|
|
6214
6284
|
var useBufferManager = (logLevel, mountTime) => {
|
|
6215
|
-
const [blocks, setBlocks] =
|
|
6216
|
-
const [onBufferingCallbacks, setOnBufferingCallbacks] =
|
|
6217
|
-
const [onResumeCallbacks, setOnResumeCallbacks] =
|
|
6285
|
+
const [blocks, setBlocks] = useState13([]);
|
|
6286
|
+
const [onBufferingCallbacks, setOnBufferingCallbacks] = useState13([]);
|
|
6287
|
+
const [onResumeCallbacks, setOnResumeCallbacks] = useState13([]);
|
|
6218
6288
|
const env = useRemotionEnvironment();
|
|
6219
6289
|
const rendering = env.isRendering;
|
|
6220
|
-
const buffering =
|
|
6290
|
+
const buffering = useRef15(false);
|
|
6221
6291
|
const addBlock = useCallback11((block) => {
|
|
6222
6292
|
if (rendering) {
|
|
6223
6293
|
return {
|
|
@@ -6290,7 +6360,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
6290
6360
|
}
|
|
6291
6361
|
}, [blocks]);
|
|
6292
6362
|
}
|
|
6293
|
-
return
|
|
6363
|
+
return useMemo25(() => {
|
|
6294
6364
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
6295
6365
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
6296
6366
|
};
|
|
@@ -6304,7 +6374,7 @@ var BufferingProvider = ({ children }) => {
|
|
|
6304
6374
|
});
|
|
6305
6375
|
};
|
|
6306
6376
|
var useIsPlayerBuffering = (bufferManager) => {
|
|
6307
|
-
const [isBuffering, setIsBuffering] =
|
|
6377
|
+
const [isBuffering, setIsBuffering] = useState13(bufferManager.buffering.current);
|
|
6308
6378
|
useEffect9(() => {
|
|
6309
6379
|
const onBuffer = () => {
|
|
6310
6380
|
setIsBuffering(true);
|
|
@@ -6329,7 +6399,7 @@ var useBufferState = () => {
|
|
|
6329
6399
|
const buffer = useContext26(BufferingContextReact);
|
|
6330
6400
|
const logLevel = useLogLevel();
|
|
6331
6401
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
6332
|
-
return
|
|
6402
|
+
return useMemo26(() => ({
|
|
6333
6403
|
delayPlayback: () => {
|
|
6334
6404
|
if (!addBlock) {
|
|
6335
6405
|
throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
|
|
@@ -6364,7 +6434,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
6364
6434
|
logLevel,
|
|
6365
6435
|
mountTime
|
|
6366
6436
|
}) => {
|
|
6367
|
-
const bufferingRef =
|
|
6437
|
+
const bufferingRef = useRef16(false);
|
|
6368
6438
|
const { delayPlayback } = useBufferState();
|
|
6369
6439
|
const bufferUntilFirstFrame = useCallback12((requestedTime) => {
|
|
6370
6440
|
if (mediaType !== "video") {
|
|
@@ -6437,7 +6507,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
6437
6507
|
onVariableFpsVideoDetected,
|
|
6438
6508
|
pauseWhenBuffering
|
|
6439
6509
|
]);
|
|
6440
|
-
return
|
|
6510
|
+
return useMemo27(() => {
|
|
6441
6511
|
return {
|
|
6442
6512
|
isBuffering: () => bufferingRef.current,
|
|
6443
6513
|
bufferUntilFirstFrame
|
|
@@ -6485,7 +6555,7 @@ var useMediaBuffering = ({
|
|
|
6485
6555
|
src
|
|
6486
6556
|
}) => {
|
|
6487
6557
|
const buffer = useBufferState();
|
|
6488
|
-
const [isBuffering, setIsBuffering] =
|
|
6558
|
+
const [isBuffering, setIsBuffering] = useState14(false);
|
|
6489
6559
|
useEffect10(() => {
|
|
6490
6560
|
let cleanupFns = [];
|
|
6491
6561
|
const { current } = element;
|
|
@@ -6618,7 +6688,7 @@ var useRequestVideoCallbackTime = ({
|
|
|
6618
6688
|
lastSeek,
|
|
6619
6689
|
onVariableFpsVideoDetected
|
|
6620
6690
|
}) => {
|
|
6621
|
-
const currentTime =
|
|
6691
|
+
const currentTime = useRef17(null);
|
|
6622
6692
|
useEffect11(() => {
|
|
6623
6693
|
const { current } = mediaRef;
|
|
6624
6694
|
if (current) {
|
|
@@ -6875,14 +6945,14 @@ var useMediaPlayback = ({
|
|
|
6875
6945
|
const buffering = useContext27(BufferingContextReact);
|
|
6876
6946
|
const { fps } = useVideoConfig();
|
|
6877
6947
|
const mediaStartsAt = useMediaStartsAt();
|
|
6878
|
-
const lastSeekDueToShift =
|
|
6879
|
-
const lastSeek =
|
|
6948
|
+
const lastSeekDueToShift = useRef18(null);
|
|
6949
|
+
const lastSeek = useRef18(null);
|
|
6880
6950
|
const logLevel = useLogLevel();
|
|
6881
6951
|
const mountTime = useMountTime();
|
|
6882
6952
|
if (!buffering) {
|
|
6883
6953
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
6884
6954
|
}
|
|
6885
|
-
const isVariableFpsVideoMap =
|
|
6955
|
+
const isVariableFpsVideoMap = useRef18({});
|
|
6886
6956
|
const onVariableFpsVideoDetected = useCallback13(() => {
|
|
6887
6957
|
if (!src) {
|
|
6888
6958
|
return;
|
|
@@ -7165,14 +7235,14 @@ var SetMediaVolumeContext = createContext22({
|
|
|
7165
7235
|
var useMediaVolumeState = () => {
|
|
7166
7236
|
const { mediaVolume } = useContext28(MediaVolumeContext);
|
|
7167
7237
|
const { setMediaVolume } = useContext28(SetMediaVolumeContext);
|
|
7168
|
-
return
|
|
7238
|
+
return useMemo28(() => {
|
|
7169
7239
|
return [mediaVolume, setMediaVolume];
|
|
7170
7240
|
}, [mediaVolume, setMediaVolume]);
|
|
7171
7241
|
};
|
|
7172
7242
|
var useMediaMutedState = () => {
|
|
7173
7243
|
const { mediaMuted } = useContext28(MediaVolumeContext);
|
|
7174
7244
|
const { setMediaMuted } = useContext28(SetMediaVolumeContext);
|
|
7175
|
-
return
|
|
7245
|
+
return useMemo28(() => {
|
|
7176
7246
|
return [mediaMuted, setMediaMuted];
|
|
7177
7247
|
}, [mediaMuted, setMediaMuted]);
|
|
7178
7248
|
};
|
|
@@ -7182,7 +7252,7 @@ var warnAboutTooHighVolume = (volume) => {
|
|
|
7182
7252
|
}
|
|
7183
7253
|
};
|
|
7184
7254
|
var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
7185
|
-
const [initialShouldPreMountAudioElements] =
|
|
7255
|
+
const [initialShouldPreMountAudioElements] = useState15(props.shouldPreMountAudioTags);
|
|
7186
7256
|
if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
|
|
7187
7257
|
throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
|
|
7188
7258
|
}
|
|
@@ -7227,7 +7297,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7227
7297
|
}
|
|
7228
7298
|
const preloadedSrc = usePreload(src);
|
|
7229
7299
|
const sequenceContext = useContext29(SequenceContext);
|
|
7230
|
-
const [timelineId] =
|
|
7300
|
+
const [timelineId] = useState15(() => String(Math.random()));
|
|
7231
7301
|
const userPreferredVolume = evaluateVolume({
|
|
7232
7302
|
frame: volumePropFrame,
|
|
7233
7303
|
volume,
|
|
@@ -7239,7 +7309,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7239
7309
|
requestsVideoFrame: false,
|
|
7240
7310
|
isClientSideRendering: false
|
|
7241
7311
|
});
|
|
7242
|
-
const propsToPass =
|
|
7312
|
+
const propsToPass = useMemo29(() => {
|
|
7243
7313
|
return {
|
|
7244
7314
|
muted: muted || mediaMuted || userPreferredVolume <= 0,
|
|
7245
7315
|
src: preloadedSrc,
|
|
@@ -7256,7 +7326,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7256
7326
|
userPreferredVolume,
|
|
7257
7327
|
crossOriginValue
|
|
7258
7328
|
]);
|
|
7259
|
-
const id =
|
|
7329
|
+
const id = useMemo29(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
|
|
7260
7330
|
src,
|
|
7261
7331
|
sequenceContext?.relativeFrom,
|
|
7262
7332
|
sequenceContext?.cumulatedFrom,
|
|
@@ -7274,6 +7344,9 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7274
7344
|
premounting: Boolean(sequenceContext?.premounting),
|
|
7275
7345
|
postmounting: Boolean(sequenceContext?.postmounting)
|
|
7276
7346
|
});
|
|
7347
|
+
const getStack = useCallback14(() => {
|
|
7348
|
+
return _remotionInternalStack ?? null;
|
|
7349
|
+
}, [_remotionInternalStack]);
|
|
7277
7350
|
useMediaInTimeline({
|
|
7278
7351
|
volume,
|
|
7279
7352
|
mediaVolume,
|
|
@@ -7282,7 +7355,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7282
7355
|
playbackRate: playbackRate ?? 1,
|
|
7283
7356
|
displayName: name ?? null,
|
|
7284
7357
|
id: timelineId,
|
|
7285
|
-
|
|
7358
|
+
getStack,
|
|
7286
7359
|
showInTimeline,
|
|
7287
7360
|
premountDisplay: sequenceContext?.premountDisplay ?? null,
|
|
7288
7361
|
postmountDisplay: sequenceContext?.postmountDisplay ?? null,
|
|
@@ -7327,7 +7400,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7327
7400
|
useImperativeHandle4(ref, () => {
|
|
7328
7401
|
return audioRef.current;
|
|
7329
7402
|
}, [audioRef]);
|
|
7330
|
-
const currentOnDurationCallback =
|
|
7403
|
+
const currentOnDurationCallback = useRef19(onDuration);
|
|
7331
7404
|
currentOnDurationCallback.current = onDuration;
|
|
7332
7405
|
useEffect14(() => {
|
|
7333
7406
|
const { current } = audioRef;
|
|
@@ -7358,7 +7431,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7358
7431
|
};
|
|
7359
7432
|
var AudioForPreview = forwardRef7(AudioForDevelopmentForwardRefFunction);
|
|
7360
7433
|
var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
7361
|
-
const audioRef =
|
|
7434
|
+
const audioRef = useRef20(null);
|
|
7362
7435
|
const {
|
|
7363
7436
|
volume: volumeProp,
|
|
7364
7437
|
playbackRate,
|
|
@@ -7384,7 +7457,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
7384
7457
|
const sequenceContext = useContext30(SequenceContext);
|
|
7385
7458
|
const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
|
|
7386
7459
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
7387
|
-
const id =
|
|
7460
|
+
const id = useMemo30(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
7388
7461
|
props.src,
|
|
7389
7462
|
sequenceContext?.relativeFrom,
|
|
7390
7463
|
sequenceContext?.cumulatedFrom,
|
|
@@ -7515,7 +7588,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
7515
7588
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
7516
7589
|
}
|
|
7517
7590
|
const preloadedSrc = usePreload(props.src);
|
|
7518
|
-
const onError =
|
|
7591
|
+
const onError = useCallback15((e) => {
|
|
7519
7592
|
console.log(e.currentTarget.error);
|
|
7520
7593
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
7521
7594
|
if (loop) {
|
|
@@ -7529,7 +7602,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
7529
7602
|
console.warn(errMessage);
|
|
7530
7603
|
}
|
|
7531
7604
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
7532
|
-
const onDuration =
|
|
7605
|
+
const onDuration = useCallback15((src, durationInSeconds) => {
|
|
7533
7606
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
7534
7607
|
}, [setDurations]);
|
|
7535
7608
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -7619,15 +7692,15 @@ var IFrameRefForwarding = ({
|
|
|
7619
7692
|
...props2
|
|
7620
7693
|
}, ref) => {
|
|
7621
7694
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
7622
|
-
const [handle] =
|
|
7695
|
+
const [handle] = useState16(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
|
|
7623
7696
|
retries: delayRenderRetries ?? undefined,
|
|
7624
7697
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
7625
7698
|
}));
|
|
7626
|
-
const didLoad =
|
|
7699
|
+
const didLoad = useCallback16((e) => {
|
|
7627
7700
|
continueRender2(handle);
|
|
7628
7701
|
onLoad?.(e);
|
|
7629
7702
|
}, [handle, onLoad, continueRender2]);
|
|
7630
|
-
const didGetError =
|
|
7703
|
+
const didGetError = useCallback16((e) => {
|
|
7631
7704
|
continueRender2(handle);
|
|
7632
7705
|
if (onError) {
|
|
7633
7706
|
onError(e);
|
|
@@ -7665,8 +7738,8 @@ var ImgContent = ({
|
|
|
7665
7738
|
ref,
|
|
7666
7739
|
...props2
|
|
7667
7740
|
}) => {
|
|
7668
|
-
const imageRef =
|
|
7669
|
-
const errors =
|
|
7741
|
+
const imageRef = useRef21(null);
|
|
7742
|
+
const errors = useRef21({});
|
|
7670
7743
|
const { delayPlayback } = useBufferState();
|
|
7671
7744
|
const sequenceContext = useContext32(SequenceContext);
|
|
7672
7745
|
const _propsValid = true;
|
|
@@ -7677,7 +7750,7 @@ var ImgContent = ({
|
|
|
7677
7750
|
return imageRef.current;
|
|
7678
7751
|
}, []);
|
|
7679
7752
|
const actualSrc = usePreload(src);
|
|
7680
|
-
const retryIn =
|
|
7753
|
+
const retryIn = useCallback17((timeout) => {
|
|
7681
7754
|
if (!imageRef.current) {
|
|
7682
7755
|
return;
|
|
7683
7756
|
}
|
|
@@ -7695,7 +7768,7 @@ var ImgContent = ({
|
|
|
7695
7768
|
}, timeout);
|
|
7696
7769
|
}, []);
|
|
7697
7770
|
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
7698
|
-
const didGetError =
|
|
7771
|
+
const didGetError = useCallback17((e) => {
|
|
7699
7772
|
if (!errors.current) {
|
|
7700
7773
|
return;
|
|
7701
7774
|
}
|
|
@@ -7803,35 +7876,32 @@ var ImgInner = ({
|
|
|
7803
7876
|
stack,
|
|
7804
7877
|
showInTimeline,
|
|
7805
7878
|
src,
|
|
7879
|
+
from,
|
|
7880
|
+
durationInFrames,
|
|
7806
7881
|
_experimentalControls: controls,
|
|
7807
7882
|
...props2
|
|
7808
7883
|
}) => {
|
|
7809
|
-
const sequenceContext = useContext32(SequenceContext);
|
|
7810
|
-
const [timelineId] = useState18(() => String(Math.random()));
|
|
7811
7884
|
if (!src) {
|
|
7812
7885
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
7813
7886
|
}
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7887
|
+
return /* @__PURE__ */ jsx26(Sequence, {
|
|
7888
|
+
layout: "none",
|
|
7889
|
+
from: from ?? 0,
|
|
7890
|
+
durationInFrames: durationInFrames ?? Infinity,
|
|
7891
|
+
_remotionInternalStack: stack,
|
|
7892
|
+
_remotionInternalIsMedia: { type: "image", src },
|
|
7893
|
+
name: name ?? "<Img>",
|
|
7894
|
+
_experimentalControls: controls,
|
|
7819
7895
|
showInTimeline: showInTimeline ?? true,
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
if (hidden) {
|
|
7826
|
-
return null;
|
|
7827
|
-
}
|
|
7828
|
-
return /* @__PURE__ */ jsx26(ImgContent, {
|
|
7829
|
-
src,
|
|
7830
|
-
...props2
|
|
7896
|
+
hidden,
|
|
7897
|
+
children: /* @__PURE__ */ jsx26(ImgContent, {
|
|
7898
|
+
src,
|
|
7899
|
+
...props2
|
|
7900
|
+
})
|
|
7831
7901
|
});
|
|
7832
7902
|
};
|
|
7833
7903
|
var imgSchema = {
|
|
7834
|
-
...
|
|
7904
|
+
...sequenceVisualStyleSchema,
|
|
7835
7905
|
hidden: hiddenField
|
|
7836
7906
|
};
|
|
7837
7907
|
var Img = wrapInSchema(ImgInner, imgSchema);
|
|
@@ -7844,18 +7914,18 @@ var CompositionManagerProvider = ({
|
|
|
7844
7914
|
initialCompositions,
|
|
7845
7915
|
initialCanvasContent
|
|
7846
7916
|
}) => {
|
|
7847
|
-
const [folders, setFolders] =
|
|
7848
|
-
const [canvasContent, setCanvasContent] =
|
|
7849
|
-
const [compositions, setCompositions] =
|
|
7850
|
-
const currentcompositionsRef =
|
|
7851
|
-
const updateCompositions =
|
|
7917
|
+
const [folders, setFolders] = useState17([]);
|
|
7918
|
+
const [canvasContent, setCanvasContent] = useState17(initialCanvasContent);
|
|
7919
|
+
const [compositions, setCompositions] = useState17(initialCompositions);
|
|
7920
|
+
const currentcompositionsRef = useRef22(compositions);
|
|
7921
|
+
const updateCompositions = useCallback18((updateComps) => {
|
|
7852
7922
|
setCompositions((comps) => {
|
|
7853
7923
|
const updated = updateComps(comps);
|
|
7854
7924
|
currentcompositionsRef.current = updated;
|
|
7855
7925
|
return updated;
|
|
7856
7926
|
});
|
|
7857
7927
|
}, []);
|
|
7858
|
-
const registerComposition =
|
|
7928
|
+
const registerComposition = useCallback18((comp) => {
|
|
7859
7929
|
updateCompositions((comps) => {
|
|
7860
7930
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
7861
7931
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
@@ -7863,12 +7933,12 @@ var CompositionManagerProvider = ({
|
|
|
7863
7933
|
return [...comps, comp];
|
|
7864
7934
|
});
|
|
7865
7935
|
}, [updateCompositions]);
|
|
7866
|
-
const unregisterComposition =
|
|
7936
|
+
const unregisterComposition = useCallback18((id) => {
|
|
7867
7937
|
setCompositions((comps) => {
|
|
7868
7938
|
return comps.filter((c2) => c2.id !== id);
|
|
7869
7939
|
});
|
|
7870
7940
|
}, []);
|
|
7871
|
-
const registerFolder =
|
|
7941
|
+
const registerFolder = useCallback18((name, parent, nonce) => {
|
|
7872
7942
|
setFolders((prevFolders) => {
|
|
7873
7943
|
return [
|
|
7874
7944
|
...prevFolders,
|
|
@@ -7880,7 +7950,7 @@ var CompositionManagerProvider = ({
|
|
|
7880
7950
|
];
|
|
7881
7951
|
});
|
|
7882
7952
|
}, []);
|
|
7883
|
-
const unregisterFolder =
|
|
7953
|
+
const unregisterFolder = useCallback18((name, parent) => {
|
|
7884
7954
|
setFolders((prevFolders) => {
|
|
7885
7955
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
7886
7956
|
});
|
|
@@ -7890,7 +7960,7 @@ var CompositionManagerProvider = ({
|
|
|
7890
7960
|
getCompositions: () => currentcompositionsRef.current
|
|
7891
7961
|
};
|
|
7892
7962
|
}, []);
|
|
7893
|
-
const compositionManagerSetters =
|
|
7963
|
+
const compositionManagerSetters = useMemo31(() => {
|
|
7894
7964
|
return {
|
|
7895
7965
|
registerComposition,
|
|
7896
7966
|
unregisterComposition,
|
|
@@ -7906,7 +7976,7 @@ var CompositionManagerProvider = ({
|
|
|
7906
7976
|
unregisterFolder,
|
|
7907
7977
|
onlyRenderComposition
|
|
7908
7978
|
]);
|
|
7909
|
-
const compositionManagerContextValue =
|
|
7979
|
+
const compositionManagerContextValue = useMemo31(() => {
|
|
7910
7980
|
return {
|
|
7911
7981
|
compositions,
|
|
7912
7982
|
folders,
|
|
@@ -7986,7 +8056,7 @@ var disabledEffectField = {
|
|
|
7986
8056
|
description: "Disabled"
|
|
7987
8057
|
};
|
|
7988
8058
|
var createEffect = (definition) => {
|
|
7989
|
-
const userCalculateKey = definition
|
|
8059
|
+
const { calculateKey: userCalculateKey, validateParams } = definition;
|
|
7990
8060
|
const widened = {
|
|
7991
8061
|
...definition,
|
|
7992
8062
|
calculateKey: (params) => {
|
|
@@ -7998,12 +8068,15 @@ var createEffect = (definition) => {
|
|
|
7998
8068
|
...definition.schema
|
|
7999
8069
|
}
|
|
8000
8070
|
};
|
|
8001
|
-
const factory = (params = {}) =>
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8071
|
+
const factory = (params = {}) => {
|
|
8072
|
+
validateParams(params);
|
|
8073
|
+
return {
|
|
8074
|
+
definition: widened,
|
|
8075
|
+
params,
|
|
8076
|
+
effectKey: widened.calculateKey(params),
|
|
8077
|
+
memoized: false
|
|
8078
|
+
};
|
|
8079
|
+
};
|
|
8007
8080
|
return factory;
|
|
8008
8081
|
};
|
|
8009
8082
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
@@ -8054,7 +8127,7 @@ var MediaEnabledProvider = ({
|
|
|
8054
8127
|
videoEnabled,
|
|
8055
8128
|
audioEnabled
|
|
8056
8129
|
}) => {
|
|
8057
|
-
const value =
|
|
8130
|
+
const value = useMemo32(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
8058
8131
|
return /* @__PURE__ */ jsx28(MediaEnabledContext.Provider, {
|
|
8059
8132
|
value,
|
|
8060
8133
|
children
|
|
@@ -8069,13 +8142,13 @@ var RemotionRootContexts = ({
|
|
|
8069
8142
|
audioEnabled,
|
|
8070
8143
|
frameState
|
|
8071
8144
|
}) => {
|
|
8072
|
-
const nonceContext =
|
|
8145
|
+
const nonceContext = useMemo33(() => {
|
|
8073
8146
|
let counter = 0;
|
|
8074
8147
|
return {
|
|
8075
8148
|
getNonce: () => counter++
|
|
8076
8149
|
};
|
|
8077
8150
|
}, []);
|
|
8078
|
-
const logging =
|
|
8151
|
+
const logging = useMemo33(() => {
|
|
8079
8152
|
return { logLevel, mountTime: Date.now() };
|
|
8080
8153
|
}, [logLevel]);
|
|
8081
8154
|
return /* @__PURE__ */ jsx29(LogLevelContext.Provider, {
|
|
@@ -8369,7 +8442,7 @@ var OffthreadVideoForRendering = ({
|
|
|
8369
8442
|
if (!src) {
|
|
8370
8443
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
8371
8444
|
}
|
|
8372
|
-
const id =
|
|
8445
|
+
const id = useMemo34(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
8373
8446
|
src,
|
|
8374
8447
|
sequenceContext?.cumulatedFrom,
|
|
8375
8448
|
sequenceContext?.relativeFrom,
|
|
@@ -8424,14 +8497,14 @@ var OffthreadVideoForRendering = ({
|
|
|
8424
8497
|
sequenceContext?.relativeFrom,
|
|
8425
8498
|
audioStreamIndex
|
|
8426
8499
|
]);
|
|
8427
|
-
const currentTime =
|
|
8500
|
+
const currentTime = useMemo34(() => {
|
|
8428
8501
|
return getExpectedMediaFrameUncorrected({
|
|
8429
8502
|
frame,
|
|
8430
8503
|
playbackRate: playbackRate || 1,
|
|
8431
8504
|
startFrom: -mediaStartsAt
|
|
8432
8505
|
}) / videoConfig.fps;
|
|
8433
8506
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
8434
|
-
const actualSrc =
|
|
8507
|
+
const actualSrc = useMemo34(() => {
|
|
8435
8508
|
return getOffthreadVideoSource({
|
|
8436
8509
|
src,
|
|
8437
8510
|
currentTime,
|
|
@@ -8439,7 +8512,7 @@ var OffthreadVideoForRendering = ({
|
|
|
8439
8512
|
toneMapped
|
|
8440
8513
|
});
|
|
8441
8514
|
}, [toneMapped, currentTime, src, transparent]);
|
|
8442
|
-
const [imageSrc, setImageSrc] =
|
|
8515
|
+
const [imageSrc, setImageSrc] = useState18(null);
|
|
8443
8516
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
8444
8517
|
useLayoutEffect11(() => {
|
|
8445
8518
|
if (!window.remotion_videoEnabled) {
|
|
@@ -8512,17 +8585,17 @@ var OffthreadVideoForRendering = ({
|
|
|
8512
8585
|
continueRender2,
|
|
8513
8586
|
delayRender2
|
|
8514
8587
|
]);
|
|
8515
|
-
const onErr =
|
|
8588
|
+
const onErr = useCallback19(() => {
|
|
8516
8589
|
if (onError) {
|
|
8517
8590
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
8518
8591
|
} else {
|
|
8519
8592
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
8520
8593
|
}
|
|
8521
8594
|
}, [imageSrc, onError]);
|
|
8522
|
-
const className =
|
|
8595
|
+
const className = useMemo34(() => {
|
|
8523
8596
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
8524
8597
|
}, [props2.className]);
|
|
8525
|
-
const onImageFrame =
|
|
8598
|
+
const onImageFrame = useCallback19((img) => {
|
|
8526
8599
|
if (onVideoFrame) {
|
|
8527
8600
|
onVideoFrame(img);
|
|
8528
8601
|
}
|
|
@@ -8581,8 +8654,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8581
8654
|
if (!context) {
|
|
8582
8655
|
throw new Error("SharedAudioContext not found");
|
|
8583
8656
|
}
|
|
8584
|
-
const videoRef =
|
|
8585
|
-
const sharedSource =
|
|
8657
|
+
const videoRef = useRef23(null);
|
|
8658
|
+
const sharedSource = useMemo35(() => {
|
|
8586
8659
|
if (!context.audioContext) {
|
|
8587
8660
|
return null;
|
|
8588
8661
|
}
|
|
@@ -8637,7 +8710,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8637
8710
|
const parentSequence = useContext35(SequenceContext);
|
|
8638
8711
|
const logLevel = useLogLevel();
|
|
8639
8712
|
const mountTime = useMountTime();
|
|
8640
|
-
const [timelineId] =
|
|
8713
|
+
const [timelineId] = useState19(() => String(Math.random()));
|
|
8641
8714
|
if (typeof acceptableTimeShift !== "undefined") {
|
|
8642
8715
|
throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
|
|
8643
8716
|
}
|
|
@@ -8649,6 +8722,9 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8649
8722
|
mediaVolume
|
|
8650
8723
|
});
|
|
8651
8724
|
warnAboutTooHighVolume(userPreferredVolume);
|
|
8725
|
+
const getStack = useCallback20(() => {
|
|
8726
|
+
return _remotionInternalStack ?? null;
|
|
8727
|
+
}, [_remotionInternalStack]);
|
|
8652
8728
|
useMediaInTimeline({
|
|
8653
8729
|
volume,
|
|
8654
8730
|
mediaVolume,
|
|
@@ -8657,7 +8733,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8657
8733
|
playbackRate: props2.playbackRate ?? 1,
|
|
8658
8734
|
displayName: name ?? null,
|
|
8659
8735
|
id: timelineId,
|
|
8660
|
-
|
|
8736
|
+
getStack,
|
|
8661
8737
|
showInTimeline,
|
|
8662
8738
|
premountDisplay: parentSequence?.premountDisplay ?? null,
|
|
8663
8739
|
postmountDisplay: parentSequence?.postmountDisplay ?? null,
|
|
@@ -8703,7 +8779,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8703
8779
|
useImperativeHandle8(ref, () => {
|
|
8704
8780
|
return videoRef.current;
|
|
8705
8781
|
}, []);
|
|
8706
|
-
|
|
8782
|
+
useState19(() => playbackLogging({
|
|
8707
8783
|
logLevel,
|
|
8708
8784
|
message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
|
|
8709
8785
|
tag: "video",
|
|
@@ -8749,7 +8825,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8749
8825
|
current.removeEventListener("error", errorHandler);
|
|
8750
8826
|
};
|
|
8751
8827
|
}, [onError, src]);
|
|
8752
|
-
const currentOnDurationCallback =
|
|
8828
|
+
const currentOnDurationCallback = useRef23(onDuration);
|
|
8753
8829
|
currentOnDurationCallback.current = onDuration;
|
|
8754
8830
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
8755
8831
|
useEffect18(() => {
|
|
@@ -8780,7 +8856,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8780
8856
|
current.preload = "auto";
|
|
8781
8857
|
}
|
|
8782
8858
|
}, []);
|
|
8783
|
-
const actualStyle =
|
|
8859
|
+
const actualStyle = useMemo35(() => {
|
|
8784
8860
|
return {
|
|
8785
8861
|
...style
|
|
8786
8862
|
};
|
|
@@ -8819,7 +8895,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
8819
8895
|
if (environment.isClientSideRendering) {
|
|
8820
8896
|
throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
8821
8897
|
}
|
|
8822
|
-
const onDuration =
|
|
8898
|
+
const onDuration = useCallback21(() => {
|
|
8823
8899
|
return;
|
|
8824
8900
|
}, []);
|
|
8825
8901
|
if (typeof props2.src !== "string") {
|
|
@@ -8975,7 +9051,7 @@ function useRemotionContexts() {
|
|
|
8975
9051
|
const sequenceManagerContext = React36.useContext(SequenceManager);
|
|
8976
9052
|
const bufferManagerContext = React36.useContext(BufferingContextReact);
|
|
8977
9053
|
const logLevelContext = React36.useContext(LogLevelContext);
|
|
8978
|
-
return
|
|
9054
|
+
return useMemo36(() => ({
|
|
8979
9055
|
compositionManagerCtx,
|
|
8980
9056
|
timelineContext,
|
|
8981
9057
|
setTimelineContext,
|
|
@@ -9067,6 +9143,8 @@ var Internals = {
|
|
|
9067
9143
|
wrapInSchema,
|
|
9068
9144
|
sequenceSchema,
|
|
9069
9145
|
sequenceStyleSchema,
|
|
9146
|
+
sequenceVisualStyleSchema,
|
|
9147
|
+
sequencePremountSchema,
|
|
9070
9148
|
flattenActiveSchema,
|
|
9071
9149
|
getFlatSchemaWithAllKeys,
|
|
9072
9150
|
RemotionRootContexts,
|
|
@@ -9161,6 +9239,8 @@ var Internals = {
|
|
|
9161
9239
|
useMemoizedEffects,
|
|
9162
9240
|
useMemoizedEffectDefinitions,
|
|
9163
9241
|
createEffect,
|
|
9242
|
+
createWebGLContextError,
|
|
9243
|
+
createWebGL2ContextError,
|
|
9164
9244
|
computeEffectiveSchemaValuesDotNotation,
|
|
9165
9245
|
OverrideIdsToNodePathsGettersContext,
|
|
9166
9246
|
OverrideIdsToNodePathsSettersContext,
|
|
@@ -9233,7 +9313,7 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
|
9233
9313
|
};
|
|
9234
9314
|
var SeriesSequence = forwardRef12(SeriesSequenceRefForwardingFunction);
|
|
9235
9315
|
var SeriesInner = (props2) => {
|
|
9236
|
-
const childrenValue =
|
|
9316
|
+
const childrenValue = useMemo37(() => {
|
|
9237
9317
|
let startFrame = 0;
|
|
9238
9318
|
const flattenedChildren = flattenChildren(props2.children);
|
|
9239
9319
|
return Children.map(flattenedChildren, (child, i) => {
|
|
@@ -9763,7 +9843,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
9763
9843
|
const frame = useCurrentFrame();
|
|
9764
9844
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
9765
9845
|
const videoConfig = useUnsafeVideoConfig();
|
|
9766
|
-
const videoRef =
|
|
9846
|
+
const videoRef = useRef24(null);
|
|
9767
9847
|
const sequenceContext = useContext36(SequenceContext);
|
|
9768
9848
|
const mediaStartsAt = useMediaStartsAt();
|
|
9769
9849
|
const environment = useRemotionEnvironment();
|
|
@@ -9771,7 +9851,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
9771
9851
|
const mountTime = useMountTime();
|
|
9772
9852
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
9773
9853
|
const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
|
|
9774
|
-
const id =
|
|
9854
|
+
const id = useMemo38(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
9775
9855
|
props2.src,
|
|
9776
9856
|
sequenceContext?.cumulatedFrom,
|
|
9777
9857
|
sequenceContext?.relativeFrom,
|
|
@@ -9988,10 +10068,10 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
9988
10068
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
9989
10069
|
}
|
|
9990
10070
|
const preloadedSrc = usePreload(props2.src);
|
|
9991
|
-
const onDuration =
|
|
10071
|
+
const onDuration = useCallback22((src, durationInSeconds) => {
|
|
9992
10072
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
9993
10073
|
}, [setDurations]);
|
|
9994
|
-
const onVideoFrame =
|
|
10074
|
+
const onVideoFrame = useCallback22(() => {}, []);
|
|
9995
10075
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
9996
10076
|
validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
|
|
9997
10077
|
const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
|
|
@@ -10434,7 +10514,7 @@ var ExpertCard = ({ expert, Link }) => {
|
|
|
10434
10514
|
});
|
|
10435
10515
|
};
|
|
10436
10516
|
var ExpertsPageContent = ({ Link }) => {
|
|
10437
|
-
const expertsInRandomOrder =
|
|
10517
|
+
const expertsInRandomOrder = useMemo39(() => {
|
|
10438
10518
|
if (typeof window === "undefined") {
|
|
10439
10519
|
return [];
|
|
10440
10520
|
}
|
|
@@ -10535,7 +10615,7 @@ var ExpertsPageContent = ({ Link }) => {
|
|
|
10535
10615
|
import * as React24 from "react";
|
|
10536
10616
|
import * as React8 from "react";
|
|
10537
10617
|
import { Fragment as Fragment22, jsx as jsx44 } from "react/jsx-runtime";
|
|
10538
|
-
import React52, { useCallback as
|
|
10618
|
+
import React52, { useCallback as useCallback24, useRef as useRef25, useState as useState22 } from "react";
|
|
10539
10619
|
|
|
10540
10620
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
10541
10621
|
function r(e) {
|
|
@@ -11877,7 +11957,7 @@ var getDefaultConfig = () => {
|
|
|
11877
11957
|
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
11878
11958
|
|
|
11879
11959
|
// ../design/dist/esm/index.mjs
|
|
11880
|
-
import React33, { useEffect as useEffect20, useMemo as
|
|
11960
|
+
import React33, { useEffect as useEffect20, useMemo as useMemo42, useState as useState20 } from "react";
|
|
11881
11961
|
|
|
11882
11962
|
// ../paths/dist/esm/index.mjs
|
|
11883
11963
|
var cutLInstruction = ({
|
|
@@ -14643,7 +14723,7 @@ var PathInternals = {
|
|
|
14643
14723
|
};
|
|
14644
14724
|
|
|
14645
14725
|
// ../shapes/dist/esm/index.mjs
|
|
14646
|
-
import React3, { useMemo as
|
|
14726
|
+
import React3, { useMemo as useMemo41 } from "react";
|
|
14647
14727
|
import { version } from "react-dom";
|
|
14648
14728
|
import { jsx as jsx42, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
14649
14729
|
import { jsx as jsx210 } from "react/jsx-runtime";
|
|
@@ -14674,13 +14754,13 @@ var RenderSvg = ({
|
|
|
14674
14754
|
instructions,
|
|
14675
14755
|
...props
|
|
14676
14756
|
}) => {
|
|
14677
|
-
const actualStyle =
|
|
14757
|
+
const actualStyle = useMemo41(() => {
|
|
14678
14758
|
return {
|
|
14679
14759
|
overflow: "visible",
|
|
14680
14760
|
...style ?? {}
|
|
14681
14761
|
};
|
|
14682
14762
|
}, [style]);
|
|
14683
|
-
const actualPathStyle =
|
|
14763
|
+
const actualPathStyle = useMemo41(() => {
|
|
14684
14764
|
return {
|
|
14685
14765
|
transformBox: "fill-box",
|
|
14686
14766
|
...pathStyle ?? {}
|
|
@@ -16217,7 +16297,7 @@ var extrudeAndTransformElement = (options) => {
|
|
|
16217
16297
|
// ../design/dist/esm/index.mjs
|
|
16218
16298
|
import { jsx as jsx212, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
16219
16299
|
import { jsx as jsx311, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
16220
|
-
import { useEffect as useEffect22, useMemo as useMemo210, useRef as
|
|
16300
|
+
import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef26 } from "react";
|
|
16221
16301
|
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
16222
16302
|
import { jsx as jsx53, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
16223
16303
|
import React62 from "react";
|
|
@@ -16244,8 +16324,8 @@ import * as React16 from "react";
|
|
|
16244
16324
|
import * as React13 from "react";
|
|
16245
16325
|
import * as ReactDOM from "react-dom";
|
|
16246
16326
|
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
16247
|
-
import * as
|
|
16248
|
-
import * as
|
|
16327
|
+
import * as React142 from "react";
|
|
16328
|
+
import * as React15 from "react";
|
|
16249
16329
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
16250
16330
|
import * as React172 from "react";
|
|
16251
16331
|
import * as React18 from "react";
|
|
@@ -16269,8 +16349,8 @@ import * as React282 from "react";
|
|
|
16269
16349
|
import { jsx as jsx232 } from "react/jsx-runtime";
|
|
16270
16350
|
import * as React35 from "react";
|
|
16271
16351
|
import * as React312 from "react";
|
|
16272
|
-
import * as React292 from "react";
|
|
16273
16352
|
import { useState as useState112 } from "react";
|
|
16353
|
+
import * as React292 from "react";
|
|
16274
16354
|
import * as React30 from "react";
|
|
16275
16355
|
import * as React342 from "react";
|
|
16276
16356
|
import * as React332 from "react";
|
|
@@ -16471,7 +16551,7 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
16471
16551
|
progress: 0,
|
|
16472
16552
|
isActive: false
|
|
16473
16553
|
});
|
|
16474
|
-
const eventTarget =
|
|
16554
|
+
const eventTarget = useMemo42(() => new EventTarget, []);
|
|
16475
16555
|
useEffect20(() => {
|
|
16476
16556
|
if (disabled) {
|
|
16477
16557
|
eventTarget.dispatchEvent(new Event("disabled"));
|
|
@@ -16618,7 +16698,7 @@ var getAngle = (ref, coordinates) => {
|
|
|
16618
16698
|
};
|
|
16619
16699
|
var lastCoordinates = null;
|
|
16620
16700
|
var useMousePosition = (ref) => {
|
|
16621
|
-
const [angle, setAngle] =
|
|
16701
|
+
const [angle, setAngle] = useState20(getAngle(ref.current, lastCoordinates));
|
|
16622
16702
|
useEffect20(() => {
|
|
16623
16703
|
const element = ref.current;
|
|
16624
16704
|
if (!element) {
|
|
@@ -16739,7 +16819,7 @@ var Spinner = ({ size, duration }) => {
|
|
|
16739
16819
|
height: size
|
|
16740
16820
|
};
|
|
16741
16821
|
}, [size]);
|
|
16742
|
-
const pathsRef =
|
|
16822
|
+
const pathsRef = useRef26([]);
|
|
16743
16823
|
useEffect22(() => {
|
|
16744
16824
|
const animate = () => {
|
|
16745
16825
|
const now = performance.now();
|
|
@@ -16785,9 +16865,9 @@ var Button = ({
|
|
|
16785
16865
|
...rest
|
|
16786
16866
|
}) => {
|
|
16787
16867
|
const [dimensions, setDimensions] = useState22(null);
|
|
16788
|
-
const ref =
|
|
16868
|
+
const ref = useRef25(null);
|
|
16789
16869
|
const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
|
|
16790
|
-
const onPointerEnter =
|
|
16870
|
+
const onPointerEnter = useCallback24((e) => {
|
|
16791
16871
|
if (e.pointerType !== "mouse") {
|
|
16792
16872
|
return;
|
|
16793
16873
|
}
|
|
@@ -16824,7 +16904,7 @@ var Button = ({
|
|
|
16824
16904
|
const isDisabled = disabled || loading;
|
|
16825
16905
|
const isAnchor = !asChild && "href" in rest && rest.href !== undefined;
|
|
16826
16906
|
const sharedClasses = cn("text-text", "inline-flex", "justify-center", "bg-button-bg", "items-center", "font-brand", "border-solid", "text-[1em]", "rounded-lg", "border-black", "border-2", "border-b-4", "cursor-pointer", "px-4", "h-12", "flex-row", "items-center", "relative", "overflow-hidden", isDisabled && "cursor-default opacity-50", className);
|
|
16827
|
-
const preventInteraction =
|
|
16907
|
+
const preventInteraction = useCallback24((e) => {
|
|
16828
16908
|
e.preventDefault();
|
|
16829
16909
|
e.stopPropagation();
|
|
16830
16910
|
}, []);
|
|
@@ -17299,15 +17379,15 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
17299
17379
|
ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
17300
17380
|
}
|
|
17301
17381
|
function useCallbackRef(callback) {
|
|
17302
|
-
const callbackRef =
|
|
17303
|
-
|
|
17382
|
+
const callbackRef = React142.useRef(callback);
|
|
17383
|
+
React142.useEffect(() => {
|
|
17304
17384
|
callbackRef.current = callback;
|
|
17305
17385
|
});
|
|
17306
|
-
return
|
|
17386
|
+
return React142.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
17307
17387
|
}
|
|
17308
17388
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
17309
17389
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
17310
|
-
|
|
17390
|
+
React15.useEffect(() => {
|
|
17311
17391
|
const handleKeyDown = (event) => {
|
|
17312
17392
|
if (event.key === "Escape") {
|
|
17313
17393
|
onEscapeKeyDown(event);
|
|
@@ -20025,7 +20105,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
|
20025
20105
|
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
20026
20106
|
};
|
|
20027
20107
|
var __assign = function() {
|
|
20028
|
-
__assign = Object.assign || function
|
|
20108
|
+
__assign = Object.assign || function __assign(t) {
|
|
20029
20109
|
for (var s, i = 1, n = arguments.length;i < n; i++) {
|
|
20030
20110
|
s = arguments[i];
|
|
20031
20111
|
for (var p in s)
|
|
@@ -21812,17 +21892,17 @@ function createContextScope2(scopeName, createContextScopeDeps = []) {
|
|
|
21812
21892
|
let defaultContexts = [];
|
|
21813
21893
|
function createContext32(rootComponentName, defaultContext) {
|
|
21814
21894
|
const BaseContext = React382.createContext(defaultContext);
|
|
21815
|
-
const
|
|
21895
|
+
const index2 = defaultContexts.length;
|
|
21816
21896
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
21817
21897
|
const Provider = (props) => {
|
|
21818
21898
|
const { scope, children, ...context } = props;
|
|
21819
|
-
const Context = scope?.[scopeName]?.[
|
|
21899
|
+
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
21820
21900
|
const value = React382.useMemo(() => context, Object.values(context));
|
|
21821
21901
|
return /* @__PURE__ */ jsx272(Context.Provider, { value, children });
|
|
21822
21902
|
};
|
|
21823
21903
|
Provider.displayName = rootComponentName + "Provider";
|
|
21824
21904
|
function useContext222(consumerName, scope) {
|
|
21825
|
-
const Context = scope?.[scopeName]?.[
|
|
21905
|
+
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
21826
21906
|
const context = React382.useContext(Context);
|
|
21827
21907
|
if (context)
|
|
21828
21908
|
return context;
|
|
@@ -22019,10 +22099,10 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
22019
22099
|
super.set(key, value);
|
|
22020
22100
|
return this;
|
|
22021
22101
|
}
|
|
22022
|
-
insert(
|
|
22102
|
+
insert(index2, key, value) {
|
|
22023
22103
|
const has = this.has(key);
|
|
22024
22104
|
const length2 = this.#keys.length;
|
|
22025
|
-
const relativeIndex = toSafeInteger(
|
|
22105
|
+
const relativeIndex = toSafeInteger(index2);
|
|
22026
22106
|
let actualIndex = relativeIndex >= 0 ? relativeIndex : length2 + relativeIndex;
|
|
22027
22107
|
const safeIndex = actualIndex < 0 || actualIndex >= length2 ? -1 : actualIndex;
|
|
22028
22108
|
if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {
|
|
@@ -22060,39 +22140,39 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
22060
22140
|
}
|
|
22061
22141
|
return this;
|
|
22062
22142
|
}
|
|
22063
|
-
with(
|
|
22143
|
+
with(index2, key, value) {
|
|
22064
22144
|
const copy = new _OrderedDict(this);
|
|
22065
|
-
copy.insert(
|
|
22145
|
+
copy.insert(index2, key, value);
|
|
22066
22146
|
return copy;
|
|
22067
22147
|
}
|
|
22068
22148
|
before(key) {
|
|
22069
|
-
const
|
|
22070
|
-
if (
|
|
22149
|
+
const index2 = this.#keys.indexOf(key) - 1;
|
|
22150
|
+
if (index2 < 0) {
|
|
22071
22151
|
return;
|
|
22072
22152
|
}
|
|
22073
|
-
return this.entryAt(
|
|
22153
|
+
return this.entryAt(index2);
|
|
22074
22154
|
}
|
|
22075
22155
|
setBefore(key, newKey, value) {
|
|
22076
|
-
const
|
|
22077
|
-
if (
|
|
22156
|
+
const index2 = this.#keys.indexOf(key);
|
|
22157
|
+
if (index2 === -1) {
|
|
22078
22158
|
return this;
|
|
22079
22159
|
}
|
|
22080
|
-
return this.insert(
|
|
22160
|
+
return this.insert(index2, newKey, value);
|
|
22081
22161
|
}
|
|
22082
22162
|
after(key) {
|
|
22083
|
-
let
|
|
22084
|
-
|
|
22085
|
-
if (
|
|
22163
|
+
let index2 = this.#keys.indexOf(key);
|
|
22164
|
+
index2 = index2 === -1 || index2 === this.size - 1 ? -1 : index2 + 1;
|
|
22165
|
+
if (index2 === -1) {
|
|
22086
22166
|
return;
|
|
22087
22167
|
}
|
|
22088
|
-
return this.entryAt(
|
|
22168
|
+
return this.entryAt(index2);
|
|
22089
22169
|
}
|
|
22090
22170
|
setAfter(key, newKey, value) {
|
|
22091
|
-
const
|
|
22092
|
-
if (
|
|
22171
|
+
const index2 = this.#keys.indexOf(key);
|
|
22172
|
+
if (index2 === -1) {
|
|
22093
22173
|
return this;
|
|
22094
22174
|
}
|
|
22095
|
-
return this.insert(
|
|
22175
|
+
return this.insert(index2 + 1, newKey, value);
|
|
22096
22176
|
}
|
|
22097
22177
|
first() {
|
|
22098
22178
|
return this.entryAt(0);
|
|
@@ -22111,21 +22191,21 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
22111
22191
|
}
|
|
22112
22192
|
return deleted;
|
|
22113
22193
|
}
|
|
22114
|
-
deleteAt(
|
|
22115
|
-
const key = this.keyAt(
|
|
22194
|
+
deleteAt(index2) {
|
|
22195
|
+
const key = this.keyAt(index2);
|
|
22116
22196
|
if (key !== undefined) {
|
|
22117
22197
|
return this.delete(key);
|
|
22118
22198
|
}
|
|
22119
22199
|
return false;
|
|
22120
22200
|
}
|
|
22121
|
-
at(
|
|
22122
|
-
const key = at(this.#keys,
|
|
22201
|
+
at(index2) {
|
|
22202
|
+
const key = at(this.#keys, index2);
|
|
22123
22203
|
if (key !== undefined) {
|
|
22124
22204
|
return this.get(key);
|
|
22125
22205
|
}
|
|
22126
22206
|
}
|
|
22127
|
-
entryAt(
|
|
22128
|
-
const key = at(this.#keys,
|
|
22207
|
+
entryAt(index2) {
|
|
22208
|
+
const key = at(this.#keys, index2);
|
|
22129
22209
|
if (key !== undefined) {
|
|
22130
22210
|
return [key, this.get(key)];
|
|
22131
22211
|
}
|
|
@@ -22133,15 +22213,15 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
22133
22213
|
indexOf(key) {
|
|
22134
22214
|
return this.#keys.indexOf(key);
|
|
22135
22215
|
}
|
|
22136
|
-
keyAt(
|
|
22137
|
-
return at(this.#keys,
|
|
22216
|
+
keyAt(index2) {
|
|
22217
|
+
return at(this.#keys, index2);
|
|
22138
22218
|
}
|
|
22139
22219
|
from(key, offset4) {
|
|
22140
|
-
const
|
|
22141
|
-
if (
|
|
22220
|
+
const index2 = this.indexOf(key);
|
|
22221
|
+
if (index2 === -1) {
|
|
22142
22222
|
return;
|
|
22143
22223
|
}
|
|
22144
|
-
let dest =
|
|
22224
|
+
let dest = index2 + offset4;
|
|
22145
22225
|
if (dest < 0)
|
|
22146
22226
|
dest = 0;
|
|
22147
22227
|
if (dest >= this.size)
|
|
@@ -22149,11 +22229,11 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
22149
22229
|
return this.at(dest);
|
|
22150
22230
|
}
|
|
22151
22231
|
keyFrom(key, offset4) {
|
|
22152
|
-
const
|
|
22153
|
-
if (
|
|
22232
|
+
const index2 = this.indexOf(key);
|
|
22233
|
+
if (index2 === -1) {
|
|
22154
22234
|
return;
|
|
22155
22235
|
}
|
|
22156
|
-
let dest =
|
|
22236
|
+
let dest = index2 + offset4;
|
|
22157
22237
|
if (dest < 0)
|
|
22158
22238
|
dest = 0;
|
|
22159
22239
|
if (dest >= this.size)
|
|
@@ -22161,68 +22241,68 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
22161
22241
|
return this.keyAt(dest);
|
|
22162
22242
|
}
|
|
22163
22243
|
find(predicate, thisArg) {
|
|
22164
|
-
let
|
|
22244
|
+
let index2 = 0;
|
|
22165
22245
|
for (const entry of this) {
|
|
22166
|
-
if (Reflect.apply(predicate, thisArg, [entry,
|
|
22246
|
+
if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
|
|
22167
22247
|
return entry;
|
|
22168
22248
|
}
|
|
22169
|
-
|
|
22249
|
+
index2++;
|
|
22170
22250
|
}
|
|
22171
22251
|
return;
|
|
22172
22252
|
}
|
|
22173
22253
|
findIndex(predicate, thisArg) {
|
|
22174
|
-
let
|
|
22254
|
+
let index2 = 0;
|
|
22175
22255
|
for (const entry of this) {
|
|
22176
|
-
if (Reflect.apply(predicate, thisArg, [entry,
|
|
22177
|
-
return
|
|
22256
|
+
if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
|
|
22257
|
+
return index2;
|
|
22178
22258
|
}
|
|
22179
|
-
|
|
22259
|
+
index2++;
|
|
22180
22260
|
}
|
|
22181
22261
|
return -1;
|
|
22182
22262
|
}
|
|
22183
22263
|
filter(predicate, thisArg) {
|
|
22184
22264
|
const entries = [];
|
|
22185
|
-
let
|
|
22265
|
+
let index2 = 0;
|
|
22186
22266
|
for (const entry of this) {
|
|
22187
|
-
if (Reflect.apply(predicate, thisArg, [entry,
|
|
22267
|
+
if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
|
|
22188
22268
|
entries.push(entry);
|
|
22189
22269
|
}
|
|
22190
|
-
|
|
22270
|
+
index2++;
|
|
22191
22271
|
}
|
|
22192
22272
|
return new _OrderedDict(entries);
|
|
22193
22273
|
}
|
|
22194
22274
|
map(callbackfn, thisArg) {
|
|
22195
22275
|
const entries = [];
|
|
22196
|
-
let
|
|
22276
|
+
let index2 = 0;
|
|
22197
22277
|
for (const entry of this) {
|
|
22198
|
-
entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry,
|
|
22199
|
-
|
|
22278
|
+
entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index2, this])]);
|
|
22279
|
+
index2++;
|
|
22200
22280
|
}
|
|
22201
22281
|
return new _OrderedDict(entries);
|
|
22202
22282
|
}
|
|
22203
22283
|
reduce(...args) {
|
|
22204
22284
|
const [callbackfn, initialValue] = args;
|
|
22205
|
-
let
|
|
22285
|
+
let index2 = 0;
|
|
22206
22286
|
let accumulator = initialValue ?? this.at(0);
|
|
22207
22287
|
for (const entry of this) {
|
|
22208
|
-
if (
|
|
22288
|
+
if (index2 === 0 && args.length === 1) {
|
|
22209
22289
|
accumulator = entry;
|
|
22210
22290
|
} else {
|
|
22211
|
-
accumulator = Reflect.apply(callbackfn, this, [accumulator, entry,
|
|
22291
|
+
accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
|
|
22212
22292
|
}
|
|
22213
|
-
|
|
22293
|
+
index2++;
|
|
22214
22294
|
}
|
|
22215
22295
|
return accumulator;
|
|
22216
22296
|
}
|
|
22217
22297
|
reduceRight(...args) {
|
|
22218
22298
|
const [callbackfn, initialValue] = args;
|
|
22219
22299
|
let accumulator = initialValue ?? this.at(-1);
|
|
22220
|
-
for (let
|
|
22221
|
-
const entry = this.at(
|
|
22222
|
-
if (
|
|
22300
|
+
for (let index2 = this.size - 1;index2 >= 0; index2--) {
|
|
22301
|
+
const entry = this.at(index2);
|
|
22302
|
+
if (index2 === this.size - 1 && args.length === 1) {
|
|
22223
22303
|
accumulator = entry;
|
|
22224
22304
|
} else {
|
|
22225
|
-
accumulator = Reflect.apply(callbackfn, this, [accumulator, entry,
|
|
22305
|
+
accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
|
|
22226
22306
|
}
|
|
22227
22307
|
}
|
|
22228
22308
|
return accumulator;
|
|
@@ -22233,8 +22313,8 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
22233
22313
|
}
|
|
22234
22314
|
toReversed() {
|
|
22235
22315
|
const reversed = new _OrderedDict;
|
|
22236
|
-
for (let
|
|
22237
|
-
const key = this.keyAt(
|
|
22316
|
+
for (let index2 = this.size - 1;index2 >= 0; index2--) {
|
|
22317
|
+
const key = this.keyAt(index2);
|
|
22238
22318
|
const element = this.get(key);
|
|
22239
22319
|
reversed.set(key, element);
|
|
22240
22320
|
}
|
|
@@ -22257,44 +22337,44 @@ var OrderedDict = class _OrderedDict extends Map {
|
|
|
22257
22337
|
if (end !== undefined && end > 0) {
|
|
22258
22338
|
stop = end - 1;
|
|
22259
22339
|
}
|
|
22260
|
-
for (let
|
|
22261
|
-
const key = this.keyAt(
|
|
22340
|
+
for (let index2 = start;index2 <= stop; index2++) {
|
|
22341
|
+
const key = this.keyAt(index2);
|
|
22262
22342
|
const element = this.get(key);
|
|
22263
22343
|
result.set(key, element);
|
|
22264
22344
|
}
|
|
22265
22345
|
return result;
|
|
22266
22346
|
}
|
|
22267
22347
|
every(predicate, thisArg) {
|
|
22268
|
-
let
|
|
22348
|
+
let index2 = 0;
|
|
22269
22349
|
for (const entry of this) {
|
|
22270
|
-
if (!Reflect.apply(predicate, thisArg, [entry,
|
|
22350
|
+
if (!Reflect.apply(predicate, thisArg, [entry, index2, this])) {
|
|
22271
22351
|
return false;
|
|
22272
22352
|
}
|
|
22273
|
-
|
|
22353
|
+
index2++;
|
|
22274
22354
|
}
|
|
22275
22355
|
return true;
|
|
22276
22356
|
}
|
|
22277
22357
|
some(predicate, thisArg) {
|
|
22278
|
-
let
|
|
22358
|
+
let index2 = 0;
|
|
22279
22359
|
for (const entry of this) {
|
|
22280
|
-
if (Reflect.apply(predicate, thisArg, [entry,
|
|
22360
|
+
if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
|
|
22281
22361
|
return true;
|
|
22282
22362
|
}
|
|
22283
|
-
|
|
22363
|
+
index2++;
|
|
22284
22364
|
}
|
|
22285
22365
|
return false;
|
|
22286
22366
|
}
|
|
22287
22367
|
};
|
|
22288
|
-
function at(array,
|
|
22368
|
+
function at(array, index2) {
|
|
22289
22369
|
if ("at" in Array.prototype) {
|
|
22290
|
-
return Array.prototype.at.call(array,
|
|
22370
|
+
return Array.prototype.at.call(array, index2);
|
|
22291
22371
|
}
|
|
22292
|
-
const actualIndex = toSafeIndex(array,
|
|
22372
|
+
const actualIndex = toSafeIndex(array, index2);
|
|
22293
22373
|
return actualIndex === -1 ? undefined : array[actualIndex];
|
|
22294
22374
|
}
|
|
22295
|
-
function toSafeIndex(array,
|
|
22375
|
+
function toSafeIndex(array, index2) {
|
|
22296
22376
|
const length2 = array.length;
|
|
22297
|
-
const relativeIndex = toSafeInteger(
|
|
22377
|
+
const relativeIndex = toSafeInteger(index2);
|
|
22298
22378
|
const actualIndex = relativeIndex >= 0 ? relativeIndex : length2 + relativeIndex;
|
|
22299
22379
|
return actualIndex < 0 || actualIndex >= length2 ? -1 : actualIndex;
|
|
22300
22380
|
}
|
|
@@ -22346,7 +22426,7 @@ var Primitive2 = NODES2.reduce((primitive, node) => {
|
|
|
22346
22426
|
Node2.displayName = `Primitive.${node}`;
|
|
22347
22427
|
return { ...primitive, [node]: Node2 };
|
|
22348
22428
|
}, {});
|
|
22349
|
-
function
|
|
22429
|
+
function useCallbackRef3(callback) {
|
|
22350
22430
|
const callbackRef = React44.useRef(callback);
|
|
22351
22431
|
React44.useEffect(() => {
|
|
22352
22432
|
callbackRef.current = callback;
|
|
@@ -22450,7 +22530,7 @@ var RovingFocusGroupImpl = React47.forwardRef((props, forwardedRef) => {
|
|
|
22450
22530
|
caller: GROUP_NAME2
|
|
22451
22531
|
});
|
|
22452
22532
|
const [isTabbingBackOut, setIsTabbingBackOut] = React47.useState(false);
|
|
22453
|
-
const handleEntryFocus =
|
|
22533
|
+
const handleEntryFocus = useCallbackRef3(onEntryFocus);
|
|
22454
22534
|
const getItems = useCollection2(__scopeRovingFocusGroup);
|
|
22455
22535
|
const isClickFocusRef = React47.useRef(false);
|
|
22456
22536
|
const [focusableItemsCount, setFocusableItemsCount] = React47.useState(0);
|
|
@@ -22603,7 +22683,7 @@ function focusFirst2(candidates, preventScroll = false) {
|
|
|
22603
22683
|
}
|
|
22604
22684
|
}
|
|
22605
22685
|
function wrapArray2(array, startIndex) {
|
|
22606
|
-
return array.map((_,
|
|
22686
|
+
return array.map((_, index2) => array[(startIndex + index2) % array.length]);
|
|
22607
22687
|
}
|
|
22608
22688
|
var Root3 = RovingFocusGroup;
|
|
22609
22689
|
var Item2 = RovingFocusGroupItem;
|
|
@@ -22918,7 +22998,7 @@ var Triangle2 = (props) => {
|
|
|
22918
22998
|
};
|
|
22919
22999
|
|
|
22920
23000
|
// src/components/homepage/FreePricing.tsx
|
|
22921
|
-
import React53, { useCallback as
|
|
23001
|
+
import React53, { useCallback as useCallback34, useMemo as useMemo51 } from "react";
|
|
22922
23002
|
|
|
22923
23003
|
// ../../node_modules/.bun/tailwind-merge@2.5.2/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
22924
23004
|
var CLASS_PART_SEPARATOR2 = "-";
|
|
@@ -24565,7 +24645,7 @@ var CompanyPricing = () => {
|
|
|
24565
24645
|
const [automatorsSelected, setAutomatorsSelected] = React53.useState(true);
|
|
24566
24646
|
const [devSeatCount, setDevSeatCount] = React53.useState(3);
|
|
24567
24647
|
const [cloudRenders, setCloudRenders] = React53.useState(1e4);
|
|
24568
|
-
const formatPrice =
|
|
24648
|
+
const formatPrice = useCallback34((price) => {
|
|
24569
24649
|
const formatter = new Intl.NumberFormat("en-US", {
|
|
24570
24650
|
style: "currency",
|
|
24571
24651
|
currency: "USD",
|
|
@@ -24575,14 +24655,14 @@ var CompanyPricing = () => {
|
|
|
24575
24655
|
}, []);
|
|
24576
24656
|
const creatorsPrice = creatorsSelected ? devSeatCount * SEAT_PRICE : 0;
|
|
24577
24657
|
const automatorsPrice = automatorsSelected ? Math.ceil(cloudRenders / 1000) * RENDER_UNIT_PRICE : 0;
|
|
24578
|
-
const totalPrice =
|
|
24658
|
+
const totalPrice = useMemo51(() => {
|
|
24579
24659
|
const basePrice = creatorsPrice + automatorsPrice;
|
|
24580
24660
|
if (automatorsSelected) {
|
|
24581
24661
|
return Math.max(100, basePrice);
|
|
24582
24662
|
}
|
|
24583
24663
|
return basePrice;
|
|
24584
24664
|
}, [creatorsPrice, automatorsPrice, automatorsSelected]);
|
|
24585
|
-
const totalPriceString =
|
|
24665
|
+
const totalPriceString = useMemo51(() => {
|
|
24586
24666
|
return formatPrice(totalPrice);
|
|
24587
24667
|
}, [formatPrice, totalPrice]);
|
|
24588
24668
|
const showMinimumMessage = automatorsSelected && creatorsPrice + automatorsPrice < 100;
|
|
@@ -25288,14 +25368,14 @@ import { createContext as createContext32 } from "react";
|
|
|
25288
25368
|
import { jsx as jsx56, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
25289
25369
|
import { jsx as jsx214, jsxs as jsxs24, Fragment as Fragment11 } from "react/jsx-runtime";
|
|
25290
25370
|
import React56 from "react";
|
|
25291
|
-
import { useContext as useContext210, useEffect as useEffect42, useState as
|
|
25371
|
+
import { useContext as useContext210, useEffect as useEffect42, useState as useState39 } from "react";
|
|
25292
25372
|
import { useContext as useContext44, useLayoutEffect as useLayoutEffect17 } from "react";
|
|
25293
25373
|
import { jsx as jsx313 } from "react/jsx-runtime";
|
|
25294
25374
|
import { useEffect as useEffect24, useState as useState24 } from "react";
|
|
25295
25375
|
import { useLayoutEffect as useLayoutEffect23 } from "react";
|
|
25296
|
-
import { useContext as useContext45, useEffect as useEffect52, useRef as
|
|
25297
|
-
import { useEffect as useEffect310, useRef as
|
|
25298
|
-
import { useCallback as
|
|
25376
|
+
import { useContext as useContext45, useEffect as useEffect52, useRef as useRef43 } from "react";
|
|
25377
|
+
import { useEffect as useEffect310, useRef as useRef27 } from "react";
|
|
25378
|
+
import { useCallback as useCallback35, useContext as useContext39, useMemo as useMemo52, useRef as useRef44, useState as useState310 } from "react";
|
|
25299
25379
|
import { useEffect as useEffect43, useRef as useRef310 } from "react";
|
|
25300
25380
|
import { useCallback as useCallback210, useEffect as useEffect62, useMemo as useMemo212, useState as useState42 } from "react";
|
|
25301
25381
|
import {
|
|
@@ -25325,10 +25405,10 @@ import { jsx as jsx55 } from "react/jsx-runtime";
|
|
|
25325
25405
|
import { useCallback as useCallback72, useEffect as useEffect112, useMemo as useMemo92, useRef as useRef82, useState as useState102 } from "react";
|
|
25326
25406
|
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
25327
25407
|
import { useCallback as useCallback42, useMemo as useMemo410, useRef as useRef52, useState as useState62 } from "react";
|
|
25328
|
-
import React54, { useCallback as
|
|
25408
|
+
import React54, { useCallback as useCallback36, useMemo as useMemo310, useState as useState52 } from "react";
|
|
25329
25409
|
import { jsx as jsx74, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
25330
25410
|
import { jsx as jsx84, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
25331
|
-
import { useCallback as useCallback52, useEffect as useEffect92, useMemo as
|
|
25411
|
+
import { useCallback as useCallback52, useEffect as useEffect92, useMemo as useMemo53, useState as useState82 } from "react";
|
|
25332
25412
|
import { useEffect as useEffect83, useRef as useRef62, useState as useState72 } from "react";
|
|
25333
25413
|
import { jsx as jsx94, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
25334
25414
|
import { useCallback as useCallback62, useEffect as useEffect102, useMemo as useMemo62, useRef as useRef72, useState as useState92 } from "react";
|
|
@@ -26020,7 +26100,7 @@ var proResProfileOptions = [
|
|
|
26020
26100
|
"light",
|
|
26021
26101
|
"proxy"
|
|
26022
26102
|
];
|
|
26023
|
-
var
|
|
26103
|
+
var sequenceVisualStyleSchema2 = {
|
|
26024
26104
|
"style.translate": {
|
|
26025
26105
|
type: "translate",
|
|
26026
26106
|
step: 1,
|
|
@@ -26048,7 +26128,9 @@ var sequenceStyleSchema2 = {
|
|
|
26048
26128
|
step: 0.01,
|
|
26049
26129
|
default: 1,
|
|
26050
26130
|
description: "Opacity"
|
|
26051
|
-
}
|
|
26131
|
+
}
|
|
26132
|
+
};
|
|
26133
|
+
var sequencePremountSchema2 = {
|
|
26052
26134
|
premountFor: {
|
|
26053
26135
|
type: "number",
|
|
26054
26136
|
default: 0,
|
|
@@ -26066,6 +26148,10 @@ var sequenceStyleSchema2 = {
|
|
|
26066
26148
|
type: "hidden"
|
|
26067
26149
|
}
|
|
26068
26150
|
};
|
|
26151
|
+
var sequenceStyleSchema2 = {
|
|
26152
|
+
...sequenceVisualStyleSchema2,
|
|
26153
|
+
...sequencePremountSchema2
|
|
26154
|
+
};
|
|
26069
26155
|
var hiddenField2 = {
|
|
26070
26156
|
type: "boolean",
|
|
26071
26157
|
default: false,
|
|
@@ -26746,7 +26832,7 @@ var useBufferStateEmitter = (emitter) => {
|
|
|
26746
26832
|
}, [bufferManager, emitter]);
|
|
26747
26833
|
};
|
|
26748
26834
|
var PlayerEmitterProvider = ({ children, currentPlaybackRate }) => {
|
|
26749
|
-
const [emitter] =
|
|
26835
|
+
const [emitter] = useState39(() => new PlayerEmitter);
|
|
26750
26836
|
const bufferManager = useContext210(Internals.BufferingContextReact);
|
|
26751
26837
|
if (!bufferManager) {
|
|
26752
26838
|
throw new Error("BufferingContextReact not found");
|
|
@@ -26806,13 +26892,13 @@ var usePlayer = () => {
|
|
|
26806
26892
|
const [playing, setPlaying, imperativePlaying] = Internals.Timeline.usePlayingState();
|
|
26807
26893
|
const [hasPlayed, setHasPlayed] = useState310(false);
|
|
26808
26894
|
const frame = Internals.Timeline.useTimelinePosition();
|
|
26809
|
-
const playStart =
|
|
26895
|
+
const playStart = useRef44(frame);
|
|
26810
26896
|
const setFrame = Internals.Timeline.useTimelineSetFrame();
|
|
26811
26897
|
const setTimelinePosition = Internals.Timeline.useTimelineSetFrame();
|
|
26812
26898
|
const audioContext = useContext39(Internals.SharedAudioContext);
|
|
26813
26899
|
const audioTagsContext = useContext39(Internals.SharedAudioTagsContext);
|
|
26814
26900
|
const { audioAndVideoTags } = Internals.useTimelineContext();
|
|
26815
|
-
const frameRef =
|
|
26901
|
+
const frameRef = useRef44(frame);
|
|
26816
26902
|
frameRef.current = frame;
|
|
26817
26903
|
const video = Internals.useVideo();
|
|
26818
26904
|
const config = Internals.useUnsafeVideoConfig();
|
|
@@ -26828,14 +26914,14 @@ var usePlayer = () => {
|
|
|
26828
26914
|
throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
|
|
26829
26915
|
}
|
|
26830
26916
|
const { buffering } = bufferingContext;
|
|
26831
|
-
const seek2 =
|
|
26917
|
+
const seek2 = useCallback35((newFrame) => {
|
|
26832
26918
|
if (video?.id) {
|
|
26833
26919
|
setTimelinePosition((c) => ({ ...c, [video.id]: newFrame }));
|
|
26834
26920
|
}
|
|
26835
26921
|
frameRef.current = newFrame;
|
|
26836
26922
|
emitter.dispatchSeek(newFrame);
|
|
26837
26923
|
}, [emitter, setTimelinePosition, video?.id]);
|
|
26838
|
-
const play =
|
|
26924
|
+
const play = useCallback35((e) => {
|
|
26839
26925
|
if (imperativePlaying.current) {
|
|
26840
26926
|
return;
|
|
26841
26927
|
}
|
|
@@ -26862,7 +26948,7 @@ var usePlayer = () => {
|
|
|
26862
26948
|
seek2,
|
|
26863
26949
|
audioAndVideoTags
|
|
26864
26950
|
]);
|
|
26865
|
-
const pause =
|
|
26951
|
+
const pause = useCallback35(() => {
|
|
26866
26952
|
if (imperativePlaying.current) {
|
|
26867
26953
|
imperativePlaying.current = false;
|
|
26868
26954
|
setPlaying(false);
|
|
@@ -26870,7 +26956,7 @@ var usePlayer = () => {
|
|
|
26870
26956
|
audioContext?.suspend();
|
|
26871
26957
|
}
|
|
26872
26958
|
}, [emitter, imperativePlaying, setPlaying, audioContext]);
|
|
26873
|
-
const pauseAndReturnToPlayStart =
|
|
26959
|
+
const pauseAndReturnToPlayStart = useCallback35(() => {
|
|
26874
26960
|
if (imperativePlaying.current) {
|
|
26875
26961
|
imperativePlaying.current = false;
|
|
26876
26962
|
frameRef.current = playStart.current;
|
|
@@ -26885,7 +26971,7 @@ var usePlayer = () => {
|
|
|
26885
26971
|
}
|
|
26886
26972
|
}, [config, emitter, imperativePlaying, setPlaying, setTimelinePosition]);
|
|
26887
26973
|
const videoId = video?.id;
|
|
26888
|
-
const frameBack =
|
|
26974
|
+
const frameBack = useCallback35((frames) => {
|
|
26889
26975
|
if (!videoId) {
|
|
26890
26976
|
return null;
|
|
26891
26977
|
}
|
|
@@ -26904,7 +26990,7 @@ var usePlayer = () => {
|
|
|
26904
26990
|
};
|
|
26905
26991
|
});
|
|
26906
26992
|
}, [imperativePlaying, setFrame, videoId]);
|
|
26907
|
-
const frameForward =
|
|
26993
|
+
const frameForward = useCallback35((frames) => {
|
|
26908
26994
|
if (!videoId) {
|
|
26909
26995
|
return null;
|
|
26910
26996
|
}
|
|
@@ -26923,23 +27009,23 @@ var usePlayer = () => {
|
|
|
26923
27009
|
};
|
|
26924
27010
|
});
|
|
26925
27011
|
}, [videoId, imperativePlaying, lastFrame, setFrame]);
|
|
26926
|
-
const toggle =
|
|
27012
|
+
const toggle = useCallback35((e) => {
|
|
26927
27013
|
if (imperativePlaying.current) {
|
|
26928
27014
|
pause();
|
|
26929
27015
|
} else {
|
|
26930
27016
|
play(e);
|
|
26931
27017
|
}
|
|
26932
27018
|
}, [imperativePlaying, pause, play]);
|
|
26933
|
-
const isPlaying =
|
|
27019
|
+
const isPlaying = useCallback35(() => {
|
|
26934
27020
|
return imperativePlaying.current;
|
|
26935
27021
|
}, [imperativePlaying]);
|
|
26936
|
-
const getCurrentFrame =
|
|
27022
|
+
const getCurrentFrame = useCallback35(() => {
|
|
26937
27023
|
return frameRef.current;
|
|
26938
27024
|
}, [frameRef]);
|
|
26939
|
-
const isBuffering =
|
|
27025
|
+
const isBuffering = useCallback35(() => {
|
|
26940
27026
|
return buffering.current;
|
|
26941
27027
|
}, [buffering]);
|
|
26942
|
-
const returnValue =
|
|
27028
|
+
const returnValue = useMemo52(() => {
|
|
26943
27029
|
return {
|
|
26944
27030
|
frameBack,
|
|
26945
27031
|
frameForward,
|
|
@@ -26982,7 +27068,7 @@ var useBrowserMediaSession = ({
|
|
|
26982
27068
|
playbackRate
|
|
26983
27069
|
}) => {
|
|
26984
27070
|
const { playing, pause, play, emitter, getCurrentFrame, seek: seek2 } = usePlayer();
|
|
26985
|
-
const hasEverPlayed =
|
|
27071
|
+
const hasEverPlayed = useRef27(false);
|
|
26986
27072
|
useEffect310(() => {
|
|
26987
27073
|
if (playing) {
|
|
26988
27074
|
hasEverPlayed.current = true;
|
|
@@ -27174,7 +27260,7 @@ var usePlayback = ({
|
|
|
27174
27260
|
const sharedAudioContext = useContext45(Internals.SharedAudioContext);
|
|
27175
27261
|
const logLevel = Internals.useLogLevel();
|
|
27176
27262
|
const isBackgroundedRef = useIsBackgrounded();
|
|
27177
|
-
const lastTimeUpdateTimestamp =
|
|
27263
|
+
const lastTimeUpdateTimestamp = useRef43(0);
|
|
27178
27264
|
const context = useContext45(Internals.BufferingContextReact);
|
|
27179
27265
|
if (!context) {
|
|
27180
27266
|
throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
|
|
@@ -27640,7 +27726,7 @@ var DefaultVolumeSlider = ({
|
|
|
27640
27726
|
inputRef,
|
|
27641
27727
|
setVolume
|
|
27642
27728
|
}) => {
|
|
27643
|
-
const sliderContainer =
|
|
27729
|
+
const sliderContainer = useMemo310(() => {
|
|
27644
27730
|
const paddingLeft = 5;
|
|
27645
27731
|
const common = {
|
|
27646
27732
|
paddingLeft,
|
|
@@ -27662,10 +27748,10 @@ var DefaultVolumeSlider = ({
|
|
|
27662
27748
|
}, [isVertical]);
|
|
27663
27749
|
const randomId = typeof React54.useId === "undefined" ? "volume-slider" : React54.useId();
|
|
27664
27750
|
const [randomClass] = useState52(() => `__remotion-volume-slider-${random(randomId)}`.replace(".", ""));
|
|
27665
|
-
const onVolumeChange =
|
|
27751
|
+
const onVolumeChange = useCallback36((e) => {
|
|
27666
27752
|
setVolume(parseFloat(e.target.value));
|
|
27667
27753
|
}, [setVolume]);
|
|
27668
|
-
const inputStyle =
|
|
27754
|
+
const inputStyle = useMemo310(() => {
|
|
27669
27755
|
const commonStyle = {
|
|
27670
27756
|
WebkitAppearance: "none",
|
|
27671
27757
|
backgroundColor: "rgba(255, 255, 255, 0.5)",
|
|
@@ -27885,7 +27971,7 @@ var PlaybackrateOption = ({ rate, onSelect, selectedRate, keyboardSelectedRate }
|
|
|
27885
27971
|
setHovered(false);
|
|
27886
27972
|
}, []);
|
|
27887
27973
|
const isFocused = keyboardSelectedRate === rate;
|
|
27888
|
-
const actualStyle =
|
|
27974
|
+
const actualStyle = useMemo53(() => {
|
|
27889
27975
|
return {
|
|
27890
27976
|
...rateDiv,
|
|
27891
27977
|
backgroundColor: hovered || isFocused ? "#eee" : "transparent"
|
|
@@ -27952,7 +28038,7 @@ var PlaybackPopup = ({ setIsComponentVisible, playbackRates, canvasSize }) => {
|
|
|
27952
28038
|
setPlaybackRate(rate);
|
|
27953
28039
|
setIsComponentVisible(false);
|
|
27954
28040
|
}, [setIsComponentVisible, setPlaybackRate]);
|
|
27955
|
-
const playbackPopup =
|
|
28041
|
+
const playbackPopup = useMemo53(() => {
|
|
27956
28042
|
return {
|
|
27957
28043
|
position: "absolute",
|
|
27958
28044
|
right: 0,
|
|
@@ -29840,11 +29926,11 @@ var Thumbnail = forward2(ThumbnailFn);
|
|
|
29840
29926
|
|
|
29841
29927
|
// src/components/homepage/Demo/index.tsx
|
|
29842
29928
|
import {
|
|
29843
|
-
useCallback as
|
|
29929
|
+
useCallback as useCallback50,
|
|
29844
29930
|
useEffect as useEffect58,
|
|
29845
|
-
useMemo as
|
|
29846
|
-
useRef as
|
|
29847
|
-
useState as
|
|
29931
|
+
useMemo as useMemo66,
|
|
29932
|
+
useRef as useRef55,
|
|
29933
|
+
useState as useState54
|
|
29848
29934
|
} from "react";
|
|
29849
29935
|
|
|
29850
29936
|
// ../../node_modules/.bun/@babel+runtime@7.27.1/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
@@ -29899,7 +29985,7 @@ function _isNativeReflectConstruct() {
|
|
|
29899
29985
|
try {
|
|
29900
29986
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
29901
29987
|
} catch (t2) {}
|
|
29902
|
-
return (_isNativeReflectConstruct = function
|
|
29988
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
29903
29989
|
return !!t;
|
|
29904
29990
|
})();
|
|
29905
29991
|
}
|
|
@@ -29917,7 +30003,7 @@ function _construct(t, e, r2) {
|
|
|
29917
30003
|
// ../../node_modules/.bun/@babel+runtime@7.27.1/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
|
|
29918
30004
|
function _wrapNativeSuper(t) {
|
|
29919
30005
|
var r2 = typeof Map == "function" ? new Map : undefined;
|
|
29920
|
-
return _wrapNativeSuper = function
|
|
30006
|
+
return _wrapNativeSuper = function _wrapNativeSuper(t2) {
|
|
29921
30007
|
if (t2 === null || !_isNativeFunction(t2))
|
|
29922
30008
|
return t2;
|
|
29923
30009
|
if (typeof t2 != "function")
|
|
@@ -30593,7 +30679,7 @@ var UNDERLAY_RED = curriedTransparentize$1(0.9, RED);
|
|
|
30593
30679
|
var BLUE_TEXT = curriedDarken$1(0.3, "#42e9f5");
|
|
30594
30680
|
|
|
30595
30681
|
// src/components/homepage/layout/use-color-mode.tsx
|
|
30596
|
-
import React57, { useContext as useContext46, useMemo as
|
|
30682
|
+
import React57, { useContext as useContext46, useMemo as useMemo54 } from "react";
|
|
30597
30683
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
30598
30684
|
var Context = React57.createContext(undefined);
|
|
30599
30685
|
var ColorModeProvider = ({
|
|
@@ -30601,7 +30687,7 @@ var ColorModeProvider = ({
|
|
|
30601
30687
|
colorMode,
|
|
30602
30688
|
setColorMode
|
|
30603
30689
|
}) => {
|
|
30604
|
-
const value =
|
|
30690
|
+
const value = useMemo54(() => {
|
|
30605
30691
|
return { colorMode, setColorMode };
|
|
30606
30692
|
}, [colorMode, setColorMode]);
|
|
30607
30693
|
return /* @__PURE__ */ jsx57(Context.Provider, {
|
|
@@ -30619,8 +30705,8 @@ function useColorMode() {
|
|
|
30619
30705
|
|
|
30620
30706
|
// ../media/dist/esm/index.mjs
|
|
30621
30707
|
import { useState as useState312 } from "react";
|
|
30622
|
-
import { useMemo as
|
|
30623
|
-
import { useContext as useContext212, useEffect as useEffect44, useMemo as
|
|
30708
|
+
import { useMemo as useMemo312 } from "react";
|
|
30709
|
+
import { useContext as useContext212, useEffect as useEffect44, useMemo as useMemo56, useRef as useRef46, useState as useState40 } from "react";
|
|
30624
30710
|
import { ALL_FORMATS, Input as Input2, UrlSource } from "mediabunny";
|
|
30625
30711
|
import { AudioBufferSink, InputDisposedError } from "mediabunny";
|
|
30626
30712
|
import { CanvasSink } from "mediabunny";
|
|
@@ -30653,7 +30739,7 @@ import { jsx as jsx412 } from "react/jsx-runtime";
|
|
|
30653
30739
|
import {
|
|
30654
30740
|
useContext as useContext53,
|
|
30655
30741
|
useLayoutEffect as useLayoutEffect43,
|
|
30656
|
-
useMemo as
|
|
30742
|
+
useMemo as useMemo55,
|
|
30657
30743
|
useRef as useRef312,
|
|
30658
30744
|
useState as useState53
|
|
30659
30745
|
} from "react";
|
|
@@ -31462,6 +31548,83 @@ var makeNonceManager = () => {
|
|
|
31462
31548
|
createAsyncOperation
|
|
31463
31549
|
};
|
|
31464
31550
|
};
|
|
31551
|
+
|
|
31552
|
+
class PremountAwareDelayPlayback {
|
|
31553
|
+
isPremounting;
|
|
31554
|
+
isPostmounting;
|
|
31555
|
+
activeHandles = new Set;
|
|
31556
|
+
delayPlayback;
|
|
31557
|
+
constructor({
|
|
31558
|
+
bufferState,
|
|
31559
|
+
isPremounting,
|
|
31560
|
+
isPostmounting
|
|
31561
|
+
}) {
|
|
31562
|
+
this.delayPlayback = bufferState.delayPlayback;
|
|
31563
|
+
this.isPremounting = isPremounting;
|
|
31564
|
+
this.isPostmounting = isPostmounting;
|
|
31565
|
+
}
|
|
31566
|
+
shouldDelayPlayback() {
|
|
31567
|
+
return !this.isPremounting && !this.isPostmounting;
|
|
31568
|
+
}
|
|
31569
|
+
syncHandles() {
|
|
31570
|
+
for (const handle of this.activeHandles) {
|
|
31571
|
+
if (this.shouldDelayPlayback()) {
|
|
31572
|
+
handle.arm();
|
|
31573
|
+
} else {
|
|
31574
|
+
handle.disarm();
|
|
31575
|
+
}
|
|
31576
|
+
}
|
|
31577
|
+
}
|
|
31578
|
+
setIsPremounting(isPremounting) {
|
|
31579
|
+
this.isPremounting = isPremounting;
|
|
31580
|
+
this.syncHandles();
|
|
31581
|
+
}
|
|
31582
|
+
setIsPostmounting(isPostmounting) {
|
|
31583
|
+
this.isPostmounting = isPostmounting;
|
|
31584
|
+
this.syncHandles();
|
|
31585
|
+
}
|
|
31586
|
+
createHandle() {
|
|
31587
|
+
let armed = false;
|
|
31588
|
+
let unblock = null;
|
|
31589
|
+
let disposed = false;
|
|
31590
|
+
const arm = () => {
|
|
31591
|
+
if (armed || disposed) {
|
|
31592
|
+
return;
|
|
31593
|
+
}
|
|
31594
|
+
unblock = this.delayPlayback().unblock;
|
|
31595
|
+
armed = true;
|
|
31596
|
+
};
|
|
31597
|
+
const disarm = () => {
|
|
31598
|
+
if (!armed) {
|
|
31599
|
+
return;
|
|
31600
|
+
}
|
|
31601
|
+
unblock?.();
|
|
31602
|
+
unblock = null;
|
|
31603
|
+
armed = false;
|
|
31604
|
+
};
|
|
31605
|
+
const entry = {
|
|
31606
|
+
arm,
|
|
31607
|
+
disarm,
|
|
31608
|
+
dispose: () => {}
|
|
31609
|
+
};
|
|
31610
|
+
entry.dispose = () => {
|
|
31611
|
+
if (disposed) {
|
|
31612
|
+
return;
|
|
31613
|
+
}
|
|
31614
|
+
disposed = true;
|
|
31615
|
+
disarm();
|
|
31616
|
+
this.activeHandles.delete(entry);
|
|
31617
|
+
};
|
|
31618
|
+
this.activeHandles.add(entry);
|
|
31619
|
+
if (this.shouldDelayPlayback()) {
|
|
31620
|
+
arm();
|
|
31621
|
+
}
|
|
31622
|
+
return {
|
|
31623
|
+
unblock: entry.dispose,
|
|
31624
|
+
[Symbol.dispose]: entry.dispose
|
|
31625
|
+
};
|
|
31626
|
+
}
|
|
31627
|
+
}
|
|
31465
31628
|
var BUFFER_SIZE = 3;
|
|
31466
31629
|
var canvasesAheadOfTime = (videoSink, startTimestamp) => {
|
|
31467
31630
|
const iterator = videoSink.canvases(startTimestamp);
|
|
@@ -31722,6 +31885,10 @@ var videoIteratorManager = async ({
|
|
|
31722
31885
|
let videoFrameIterator = null;
|
|
31723
31886
|
let framesRendered = 0;
|
|
31724
31887
|
let currentDelayHandle = null;
|
|
31888
|
+
let lastDrawnFrame = null;
|
|
31889
|
+
const clearLastDrawnFrame = () => {
|
|
31890
|
+
lastDrawnFrame = null;
|
|
31891
|
+
};
|
|
31725
31892
|
if (canvas) {
|
|
31726
31893
|
const displayWidth = await videoTrack.getDisplayWidth();
|
|
31727
31894
|
const displayHeight = await videoTrack.getDisplayHeight();
|
|
@@ -31736,7 +31903,7 @@ var videoIteratorManager = async ({
|
|
|
31736
31903
|
alpha: true
|
|
31737
31904
|
});
|
|
31738
31905
|
const prewarmedVideoIteratorCache = makePrewarmedVideoIteratorCache(canvasSink);
|
|
31739
|
-
const
|
|
31906
|
+
const paintFrame = async (frame) => {
|
|
31740
31907
|
if (context && canvas) {
|
|
31741
31908
|
const effects = getEffects();
|
|
31742
31909
|
const chainState = getEffectChainState(canvas.width, canvas.height);
|
|
@@ -31754,6 +31921,10 @@ var videoIteratorManager = async ({
|
|
|
31754
31921
|
context.drawImage(frame.canvas, 0, 0);
|
|
31755
31922
|
}
|
|
31756
31923
|
}
|
|
31924
|
+
};
|
|
31925
|
+
const drawFrame = async (frame) => {
|
|
31926
|
+
await paintFrame(frame);
|
|
31927
|
+
lastDrawnFrame = frame;
|
|
31757
31928
|
framesRendered++;
|
|
31758
31929
|
drawDebugOverlay();
|
|
31759
31930
|
const callback = getOnVideoFrameCallback();
|
|
@@ -31762,9 +31933,22 @@ var videoIteratorManager = async ({
|
|
|
31762
31933
|
}
|
|
31763
31934
|
Internals.Log.trace({ logLevel, tag: "@remotion/media" }, `[MediaPlayer] Drew frame ${frame.timestamp.toFixed(3)}s`);
|
|
31764
31935
|
};
|
|
31936
|
+
const redrawCurrentFrame = async () => {
|
|
31937
|
+
if (!lastDrawnFrame) {
|
|
31938
|
+
return;
|
|
31939
|
+
}
|
|
31940
|
+
await paintFrame(lastDrawnFrame);
|
|
31941
|
+
drawDebugOverlay();
|
|
31942
|
+
const callback = getOnVideoFrameCallback();
|
|
31943
|
+
if (callback) {
|
|
31944
|
+
callback(lastDrawnFrame.canvas);
|
|
31945
|
+
}
|
|
31946
|
+
Internals.Log.trace({ logLevel, tag: "@remotion/media" }, `[MediaPlayer] Redrew frame ${lastDrawnFrame.timestamp.toFixed(3)}s with updated effects`);
|
|
31947
|
+
};
|
|
31765
31948
|
const startVideoIterator = async (timeToSeek, nonce) => {
|
|
31766
31949
|
let __stack = [];
|
|
31767
31950
|
try {
|
|
31951
|
+
clearLastDrawnFrame();
|
|
31768
31952
|
videoFrameIterator?.destroy();
|
|
31769
31953
|
const delayHandle = __using(__stack, delayPlaybackHandleIfNotPremounting(), 0);
|
|
31770
31954
|
currentDelayHandle = delayHandle;
|
|
@@ -31816,6 +32000,7 @@ var videoIteratorManager = async ({
|
|
|
31816
32000
|
getVideoIteratorsCreated: () => videoIteratorsCreated,
|
|
31817
32001
|
seek: seek2,
|
|
31818
32002
|
destroy: () => {
|
|
32003
|
+
clearLastDrawnFrame();
|
|
31819
32004
|
prewarmedVideoIteratorCache.destroy();
|
|
31820
32005
|
videoFrameIterator?.destroy();
|
|
31821
32006
|
if (context && canvas) {
|
|
@@ -31829,6 +32014,7 @@ var videoIteratorManager = async ({
|
|
|
31829
32014
|
},
|
|
31830
32015
|
getVideoFrameIterator: () => videoFrameIterator,
|
|
31831
32016
|
drawFrame,
|
|
32017
|
+
redrawCurrentFrame,
|
|
31832
32018
|
getFramesRendered: () => framesRendered
|
|
31833
32019
|
};
|
|
31834
32020
|
};
|
|
@@ -31859,9 +32045,7 @@ class MediaPlayer {
|
|
|
31859
32045
|
getEffects;
|
|
31860
32046
|
getEffectChainState;
|
|
31861
32047
|
initializationPromise = null;
|
|
31862
|
-
|
|
31863
|
-
isPremounting;
|
|
31864
|
-
isPostmounting;
|
|
32048
|
+
premountAwareDelayPlayback;
|
|
31865
32049
|
seekPromiseChain = Promise.resolve();
|
|
31866
32050
|
constructor({
|
|
31867
32051
|
canvas,
|
|
@@ -31900,9 +32084,11 @@ class MediaPlayer {
|
|
|
31900
32084
|
this.audioStreamIndex = audioStreamIndex;
|
|
31901
32085
|
this.fps = fps;
|
|
31902
32086
|
this.debugOverlay = debugOverlay;
|
|
31903
|
-
this.
|
|
31904
|
-
|
|
31905
|
-
|
|
32087
|
+
this.premountAwareDelayPlayback = new PremountAwareDelayPlayback({
|
|
32088
|
+
bufferState,
|
|
32089
|
+
isPremounting,
|
|
32090
|
+
isPostmounting
|
|
32091
|
+
});
|
|
31906
32092
|
this.sequenceDurationInFrames = durationInFrames;
|
|
31907
32093
|
this.nonceManager = makeNonceManager();
|
|
31908
32094
|
this.onVideoFrameCallback = onVideoFrameCallback;
|
|
@@ -32158,19 +32344,7 @@ class MediaPlayer {
|
|
|
32158
32344
|
this.drawDebugOverlay();
|
|
32159
32345
|
}
|
|
32160
32346
|
delayPlaybackHandleIfNotPremounting = () => {
|
|
32161
|
-
|
|
32162
|
-
return {
|
|
32163
|
-
unblock: () => {},
|
|
32164
|
-
[Symbol.dispose]: () => {}
|
|
32165
|
-
};
|
|
32166
|
-
}
|
|
32167
|
-
const { unblock } = this.bufferState.delayPlayback();
|
|
32168
|
-
return {
|
|
32169
|
-
unblock,
|
|
32170
|
-
[Symbol.dispose]: () => {
|
|
32171
|
-
unblock();
|
|
32172
|
-
}
|
|
32173
|
-
};
|
|
32347
|
+
return this.premountAwareDelayPlayback.createHandle();
|
|
32174
32348
|
};
|
|
32175
32349
|
pause() {
|
|
32176
32350
|
if (!this.playing) {
|
|
@@ -32243,10 +32417,10 @@ class MediaPlayer {
|
|
|
32243
32417
|
}
|
|
32244
32418
|
}
|
|
32245
32419
|
setIsPremounting(isPremounting) {
|
|
32246
|
-
this.isPremounting
|
|
32420
|
+
this.premountAwareDelayPlayback.setIsPremounting(isPremounting);
|
|
32247
32421
|
}
|
|
32248
32422
|
setIsPostmounting(isPostmounting) {
|
|
32249
|
-
this.isPostmounting
|
|
32423
|
+
this.premountAwareDelayPlayback.setIsPostmounting(isPostmounting);
|
|
32250
32424
|
}
|
|
32251
32425
|
async setLoop(loop, unloopedTimeInSeconds) {
|
|
32252
32426
|
const previousLoop = this.loop;
|
|
@@ -32338,6 +32512,9 @@ class MediaPlayer {
|
|
|
32338
32512
|
setVideoFrameCallback(callback) {
|
|
32339
32513
|
this.onVideoFrameCallback = callback;
|
|
32340
32514
|
}
|
|
32515
|
+
async redrawVideoEffects() {
|
|
32516
|
+
await this.videoIteratorManager?.redrawCurrentFrame();
|
|
32517
|
+
}
|
|
32341
32518
|
drawDebugOverlay = () => {
|
|
32342
32519
|
if (!this.debugOverlay)
|
|
32343
32520
|
return;
|
|
@@ -32559,11 +32736,11 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
32559
32736
|
}) => {
|
|
32560
32737
|
const videoConfig = useUnsafeVideoConfig2();
|
|
32561
32738
|
const frame = useCurrentFrame();
|
|
32562
|
-
const mediaPlayerRef =
|
|
32563
|
-
const initialTrimBeforeRef =
|
|
32564
|
-
const initialTrimAfterRef =
|
|
32565
|
-
const [mediaPlayerReady, setMediaPlayerReady] =
|
|
32566
|
-
const [shouldFallbackToNativeAudio, setShouldFallbackToNativeAudio] =
|
|
32739
|
+
const mediaPlayerRef = useRef46(null);
|
|
32740
|
+
const initialTrimBeforeRef = useRef46(trimBefore);
|
|
32741
|
+
const initialTrimAfterRef = useRef46(trimAfter);
|
|
32742
|
+
const [mediaPlayerReady, setMediaPlayerReady] = useState40(false);
|
|
32743
|
+
const [shouldFallbackToNativeAudio, setShouldFallbackToNativeAudio] = useState40(false);
|
|
32567
32744
|
const [playing] = Timeline.usePlayingState();
|
|
32568
32745
|
const { playbackRate: globalPlaybackRate } = Internals.usePlaybackRate();
|
|
32569
32746
|
const sharedAudioContext = useContext212(SharedAudioContext2);
|
|
@@ -32584,7 +32761,7 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
32584
32761
|
throw new TypeError("No `src` was passed to <NewAudioForPreview>.");
|
|
32585
32762
|
}
|
|
32586
32763
|
const currentTime = frame / videoConfig.fps;
|
|
32587
|
-
const currentTimeRef =
|
|
32764
|
+
const currentTimeRef = useRef46(currentTime);
|
|
32588
32765
|
currentTimeRef.current = currentTime;
|
|
32589
32766
|
const preloadedSrc = usePreload2(src);
|
|
32590
32767
|
const parentSequence = useContext212(SequenceContext2);
|
|
@@ -32597,14 +32774,14 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
32597
32774
|
}
|
|
32598
32775
|
const effectiveMuted = muted || mediaMuted || userPreferredVolume <= 0;
|
|
32599
32776
|
const isPlayerBuffering = Internals.useIsPlayerBuffering(bufferingContext);
|
|
32600
|
-
const initialPlaying =
|
|
32601
|
-
const initialIsPremounting =
|
|
32602
|
-
const initialIsPostmounting =
|
|
32603
|
-
const initialGlobalPlaybackRate =
|
|
32604
|
-
const initialPlaybackRate =
|
|
32605
|
-
const initialMuted =
|
|
32606
|
-
const initialDurationInFrames =
|
|
32607
|
-
const initialSequenceOffset =
|
|
32777
|
+
const initialPlaying = useRef46(playing && !isPlayerBuffering);
|
|
32778
|
+
const initialIsPremounting = useRef46(isPremounting);
|
|
32779
|
+
const initialIsPostmounting = useRef46(isPostmounting);
|
|
32780
|
+
const initialGlobalPlaybackRate = useRef46(globalPlaybackRate);
|
|
32781
|
+
const initialPlaybackRate = useRef46(playbackRate);
|
|
32782
|
+
const initialMuted = useRef46(effectiveMuted);
|
|
32783
|
+
const initialDurationInFrames = useRef46(videoConfig.durationInFrames);
|
|
32784
|
+
const initialSequenceOffset = useRef46(sequenceOffset);
|
|
32608
32785
|
useCommonEffects({
|
|
32609
32786
|
mediaPlayerRef,
|
|
32610
32787
|
mediaPlayerReady,
|
|
@@ -32815,7 +32992,7 @@ var AudioForPreview2 = ({
|
|
|
32815
32992
|
const frame = useCurrentFrame();
|
|
32816
32993
|
const videoConfig = useVideoConfig();
|
|
32817
32994
|
const currentTime = frame / videoConfig.fps;
|
|
32818
|
-
const showShow =
|
|
32995
|
+
const showShow = useMemo56(() => {
|
|
32819
32996
|
return getTimeInSeconds({
|
|
32820
32997
|
unloopedTimeInSeconds: currentTime,
|
|
32821
32998
|
playbackRate,
|
|
@@ -34906,7 +35083,7 @@ var AudioInner = (props) => {
|
|
|
34906
35083
|
loop: props.loop ?? false
|
|
34907
35084
|
});
|
|
34908
35085
|
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState312(null);
|
|
34909
|
-
const loopDisplay =
|
|
35086
|
+
const loopDisplay = useMemo312(() => getLoopDisplay({
|
|
34910
35087
|
loop: props.loop ?? false,
|
|
34911
35088
|
mediaDurationInSeconds,
|
|
34912
35089
|
playbackRate: props.playbackRate ?? 1,
|
|
@@ -34923,7 +35100,7 @@ var AudioInner = (props) => {
|
|
|
34923
35100
|
sequenceDurationInFrames,
|
|
34924
35101
|
videoConfig.fps
|
|
34925
35102
|
]);
|
|
34926
|
-
const isMedia =
|
|
35103
|
+
const isMedia = useMemo312(() => ({
|
|
34927
35104
|
type: "audio",
|
|
34928
35105
|
data: basicInfo
|
|
34929
35106
|
}), [basicInfo]);
|
|
@@ -35032,7 +35209,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
35032
35209
|
credentials,
|
|
35033
35210
|
objectFit: objectFitProp,
|
|
35034
35211
|
_experimentalInitiallyDrawCachedFrame,
|
|
35035
|
-
|
|
35212
|
+
effects,
|
|
35036
35213
|
setMediaDurationInSeconds
|
|
35037
35214
|
}) => {
|
|
35038
35215
|
const src = usePreload22(unpreloadedSrc);
|
|
@@ -35062,8 +35239,8 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
35062
35239
|
}
|
|
35063
35240
|
warnAboutTooHighVolume22(userPreferredVolume);
|
|
35064
35241
|
const effectChainState = useEffectChainState2();
|
|
35065
|
-
const
|
|
35066
|
-
|
|
35242
|
+
const effectsRef = useRef210(effects);
|
|
35243
|
+
effectsRef.current = effects;
|
|
35067
35244
|
const effectChainStateRef = useRef210(effectChainState);
|
|
35068
35245
|
effectChainStateRef.current = effectChainState;
|
|
35069
35246
|
const parentSequence = useContext47(SequenceContext22);
|
|
@@ -35170,7 +35347,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
35170
35347
|
sequenceOffset: initialSequenceOffset.current,
|
|
35171
35348
|
credentials,
|
|
35172
35349
|
tagType: "video",
|
|
35173
|
-
getEffects: () =>
|
|
35350
|
+
getEffects: () => effectsRef.current,
|
|
35174
35351
|
getEffectChainState: (width, height) => effectChainStateRef.current?.get(width, height)
|
|
35175
35352
|
});
|
|
35176
35353
|
mediaPlayerRef.current = player;
|
|
@@ -35306,6 +35483,13 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
35306
35483
|
}
|
|
35307
35484
|
mediaPlayer.setVideoFrameCallback(onVideoFrame ?? null);
|
|
35308
35485
|
}, [onVideoFrame, mediaPlayerReady]);
|
|
35486
|
+
useLayoutEffect34(() => {
|
|
35487
|
+
const mediaPlayer = mediaPlayerRef.current;
|
|
35488
|
+
if (!mediaPlayer || !mediaPlayerReady) {
|
|
35489
|
+
return;
|
|
35490
|
+
}
|
|
35491
|
+
mediaPlayer.redrawVideoEffects().catch(() => {});
|
|
35492
|
+
}, [effects, mediaPlayerReady, mediaPlayerRef]);
|
|
35309
35493
|
const actualStyle = useMemo412(() => {
|
|
35310
35494
|
return {
|
|
35311
35495
|
...style2,
|
|
@@ -35405,7 +35589,7 @@ var VideoForRendering2 = ({
|
|
|
35405
35589
|
const { registerRenderAsset, unregisterRenderAsset } = useContext53(Internals.RenderAssetManager);
|
|
35406
35590
|
const startsAt = Internals.useMediaStartsAt();
|
|
35407
35591
|
const sequenceContext = useContext53(Internals.SequenceContext);
|
|
35408
|
-
const id =
|
|
35592
|
+
const id = useMemo55(() => `media-video-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
35409
35593
|
src,
|
|
35410
35594
|
sequenceContext?.cumulatedFrom,
|
|
35411
35595
|
sequenceContext?.relativeFrom,
|
|
@@ -35598,10 +35782,10 @@ var VideoForRendering2 = ({
|
|
|
35598
35782
|
credentials
|
|
35599
35783
|
]);
|
|
35600
35784
|
warnAboutObjectFitInStyleOrClassName({ style: style2, className: className2, logLevel });
|
|
35601
|
-
const classNameValue =
|
|
35785
|
+
const classNameValue = useMemo55(() => {
|
|
35602
35786
|
return [Internals.OBJECTFIT_CONTAIN_CLASS_NAME, className2].filter(Internals.truthy).join(" ");
|
|
35603
35787
|
}, [className2]);
|
|
35604
|
-
const styleWithObjectFit =
|
|
35788
|
+
const styleWithObjectFit = useMemo55(() => {
|
|
35605
35789
|
return {
|
|
35606
35790
|
...style2,
|
|
35607
35791
|
objectFit: objectFitProp
|
|
@@ -35692,7 +35876,7 @@ var videoSchema = {
|
|
|
35692
35876
|
description: "Hidden"
|
|
35693
35877
|
},
|
|
35694
35878
|
loop: { type: "boolean", default: false, description: "Loop" },
|
|
35695
|
-
...Internals.
|
|
35879
|
+
...Internals.sequenceVisualStyleSchema
|
|
35696
35880
|
};
|
|
35697
35881
|
var InnerVideo = ({
|
|
35698
35882
|
src,
|
|
@@ -35722,7 +35906,7 @@ var InnerVideo = ({
|
|
|
35722
35906
|
_experimentalControls: controls,
|
|
35723
35907
|
objectFit,
|
|
35724
35908
|
_experimentalInitiallyDrawCachedFrame,
|
|
35725
|
-
|
|
35909
|
+
effects,
|
|
35726
35910
|
setMediaDurationInSeconds
|
|
35727
35911
|
}) => {
|
|
35728
35912
|
const environment = useRemotionEnvironment();
|
|
@@ -35794,7 +35978,7 @@ var InnerVideo = ({
|
|
|
35794
35978
|
credentials,
|
|
35795
35979
|
controls,
|
|
35796
35980
|
objectFit,
|
|
35797
|
-
|
|
35981
|
+
effects,
|
|
35798
35982
|
_experimentalInitiallyDrawCachedFrame
|
|
35799
35983
|
});
|
|
35800
35984
|
};
|
|
@@ -35827,7 +36011,7 @@ var VideoInner = ({
|
|
|
35827
36011
|
_experimentalControls: controls,
|
|
35828
36012
|
objectFit,
|
|
35829
36013
|
_experimentalInitiallyDrawCachedFrame,
|
|
35830
|
-
|
|
36014
|
+
effects,
|
|
35831
36015
|
durationInFrames,
|
|
35832
36016
|
from,
|
|
35833
36017
|
hidden
|
|
@@ -35873,10 +36057,10 @@ var VideoInner = ({
|
|
|
35873
36057
|
data: basicInfo
|
|
35874
36058
|
}), [basicInfo]);
|
|
35875
36059
|
const memoizedEffects = Internals.useMemoizedEffects({
|
|
35876
|
-
effects:
|
|
36060
|
+
effects: effects ?? [],
|
|
35877
36061
|
overrideId: controls?.overrideId ?? null
|
|
35878
36062
|
});
|
|
35879
|
-
const memoizedEffectDefinitions = Internals.useMemoizedEffectDefinitions(
|
|
36063
|
+
const memoizedEffectDefinitions = Internals.useMemoizedEffectDefinitions(effects ?? []);
|
|
35880
36064
|
if (sequenceDurationInFrames === 0) {
|
|
35881
36065
|
return null;
|
|
35882
36066
|
}
|
|
@@ -35889,7 +36073,7 @@ var VideoInner = ({
|
|
|
35889
36073
|
name: name ?? "<Video>",
|
|
35890
36074
|
_experimentalControls: controls,
|
|
35891
36075
|
_remotionInternalLoopDisplay: loopDisplay,
|
|
35892
|
-
|
|
36076
|
+
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
35893
36077
|
showInTimeline: showInTimeline ?? true,
|
|
35894
36078
|
hidden,
|
|
35895
36079
|
children: /* @__PURE__ */ jsx65(InnerVideo, {
|
|
@@ -35920,7 +36104,7 @@ var VideoInner = ({
|
|
|
35920
36104
|
_experimentalControls: controls,
|
|
35921
36105
|
objectFit: objectFit ?? "contain",
|
|
35922
36106
|
_experimentalInitiallyDrawCachedFrame: _experimentalInitiallyDrawCachedFrame ?? false,
|
|
35923
|
-
|
|
36107
|
+
effects: memoizedEffects,
|
|
35924
36108
|
setMediaDurationInSeconds
|
|
35925
36109
|
})
|
|
35926
36110
|
});
|
|
@@ -35929,19 +36113,19 @@ var Video = Internals.wrapInSchema(VideoInner, videoSchema);
|
|
|
35929
36113
|
Internals.addSequenceStackTraces(Video);
|
|
35930
36114
|
|
|
35931
36115
|
// src/components/homepage/Demo/Comp.tsx
|
|
35932
|
-
import { useCallback as
|
|
36116
|
+
import { useCallback as useCallback43, useEffect as useEffect50, useMemo as useMemo59, useState as useState47 } from "react";
|
|
35933
36117
|
|
|
35934
36118
|
// src/components/homepage/Demo/Cards.tsx
|
|
35935
36119
|
import {
|
|
35936
36120
|
createRef as createRef4,
|
|
35937
|
-
useCallback as
|
|
36121
|
+
useCallback as useCallback41,
|
|
35938
36122
|
useEffect as useEffect49,
|
|
35939
|
-
useRef as
|
|
35940
|
-
useState as
|
|
36123
|
+
useRef as useRef50,
|
|
36124
|
+
useState as useState46
|
|
35941
36125
|
} from "react";
|
|
35942
36126
|
|
|
35943
36127
|
// src/components/homepage/Demo/Card.tsx
|
|
35944
|
-
import { useCallback as
|
|
36128
|
+
import { useCallback as useCallback39, useRef as useRef47 } from "react";
|
|
35945
36129
|
|
|
35946
36130
|
// src/components/homepage/Demo/math.ts
|
|
35947
36131
|
var paddingAndMargin = 20;
|
|
@@ -35975,10 +36159,10 @@ var getIndexFromPosition = (clientX, clientY) => {
|
|
|
35975
36159
|
};
|
|
35976
36160
|
|
|
35977
36161
|
// src/components/homepage/Demo/Switcher.tsx
|
|
35978
|
-
import { useCallback as
|
|
36162
|
+
import { useCallback as useCallback37 } from "react";
|
|
35979
36163
|
import { jsx as jsx60, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
35980
36164
|
var Switcher = ({ type, theme, onTap }) => {
|
|
35981
|
-
const onPointerDown =
|
|
36165
|
+
const onPointerDown = useCallback37((e) => {
|
|
35982
36166
|
e.stopPropagation();
|
|
35983
36167
|
onTap();
|
|
35984
36168
|
}, [onTap]);
|
|
@@ -36039,9 +36223,9 @@ var Card2 = ({
|
|
|
36039
36223
|
onClickRight
|
|
36040
36224
|
}) => {
|
|
36041
36225
|
const refToUse = refsToUse[index2];
|
|
36042
|
-
const stopPrevious =
|
|
36226
|
+
const stopPrevious = useRef47([]);
|
|
36043
36227
|
let newIndices = [...indices];
|
|
36044
|
-
const applyPositions =
|
|
36228
|
+
const applyPositions = useCallback39((except) => {
|
|
36045
36229
|
let stopped = false;
|
|
36046
36230
|
stopPrevious.current.forEach((s) => {
|
|
36047
36231
|
s();
|
|
@@ -36114,7 +36298,7 @@ var Card2 = ({
|
|
|
36114
36298
|
update();
|
|
36115
36299
|
});
|
|
36116
36300
|
}, [newIndices, onUpdate, positions, refsToUse, shouldBePositions]);
|
|
36117
|
-
const onPointerDown =
|
|
36301
|
+
const onPointerDown = useCallback39((e) => {
|
|
36118
36302
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
36119
36303
|
const cardLeft = refToUse.current.offsetLeft;
|
|
36120
36304
|
const cardTop = refToUse.current.offsetTop;
|
|
@@ -36175,7 +36359,7 @@ var Card2 = ({
|
|
|
36175
36359
|
}, { once: true });
|
|
36176
36360
|
refToUse.current.addEventListener("pointermove", onMove);
|
|
36177
36361
|
}, [applyPositions, index2, positions, refToUse, shouldBePositions]);
|
|
36178
|
-
const onPointerUp =
|
|
36362
|
+
const onPointerUp = useCallback39((e) => {
|
|
36179
36363
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
36180
36364
|
}, []);
|
|
36181
36365
|
const { x, y } = getPositionForIndex(index2);
|
|
@@ -36302,15 +36486,15 @@ var CurrentCountry = ({ theme, countryPaths, countryLabel }) => {
|
|
|
36302
36486
|
// src/components/homepage/Demo/EmojiCard.tsx
|
|
36303
36487
|
import {
|
|
36304
36488
|
forwardRef as forwardRef36,
|
|
36305
|
-
useCallback as
|
|
36489
|
+
useCallback as useCallback40,
|
|
36306
36490
|
useEffect as useEffect48,
|
|
36307
36491
|
useImperativeHandle as useImperativeHandle12,
|
|
36308
|
-
useRef as
|
|
36492
|
+
useRef as useRef49
|
|
36309
36493
|
} from "react";
|
|
36310
36494
|
|
|
36311
36495
|
// ../lottie/dist/esm/index.mjs
|
|
36312
36496
|
import lottie from "lottie-web";
|
|
36313
|
-
import { useEffect as useEffect46, useRef as
|
|
36497
|
+
import { useEffect as useEffect46, useRef as useRef48, useState as useState41 } from "react";
|
|
36314
36498
|
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
36315
36499
|
var getLottieMetadata = (animationData) => {
|
|
36316
36500
|
const width2 = animationData.w;
|
|
@@ -36379,13 +36563,13 @@ var Lottie = ({
|
|
|
36379
36563
|
}
|
|
36380
36564
|
validatePlaybackRate2(playbackRate);
|
|
36381
36565
|
validateLoop(loop);
|
|
36382
|
-
const animationRef =
|
|
36383
|
-
const currentFrameRef =
|
|
36384
|
-
const containerRef =
|
|
36385
|
-
const onAnimationLoadedRef =
|
|
36566
|
+
const animationRef = useRef48(null);
|
|
36567
|
+
const currentFrameRef = useRef48(null);
|
|
36568
|
+
const containerRef = useRef48(null);
|
|
36569
|
+
const onAnimationLoadedRef = useRef48(onAnimationLoaded);
|
|
36386
36570
|
onAnimationLoadedRef.current = onAnimationLoaded;
|
|
36387
36571
|
const { delayRender: delayRender2, continueRender } = useDelayRender();
|
|
36388
|
-
const [handle] =
|
|
36572
|
+
const [handle] = useState41(() => delayRender2("Waiting for Lottie animation to load"));
|
|
36389
36573
|
useEffect46(() => {
|
|
36390
36574
|
return () => {
|
|
36391
36575
|
continueRender(handle);
|
|
@@ -36481,14 +36665,14 @@ var Lottie = ({
|
|
|
36481
36665
|
};
|
|
36482
36666
|
|
|
36483
36667
|
// src/components/homepage/Demo/DisplayedEmoji.tsx
|
|
36484
|
-
import { useEffect as useEffect47, useMemo as
|
|
36668
|
+
import { useEffect as useEffect47, useMemo as useMemo57, useState as useState44 } from "react";
|
|
36485
36669
|
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
36486
36670
|
var DisplayedEmoji = ({ emoji }) => {
|
|
36487
|
-
const [data, setData] =
|
|
36671
|
+
const [data, setData] = useState44(null);
|
|
36488
36672
|
const { durationInFrames, fps } = useVideoConfig();
|
|
36489
|
-
const [browser, setBrowser] =
|
|
36673
|
+
const [browser, setBrowser] = useState44(typeof document !== "undefined");
|
|
36490
36674
|
const { delayRender: delayRender2, continueRender, cancelRender: cancelRender2 } = useDelayRender();
|
|
36491
|
-
const src =
|
|
36675
|
+
const src = useMemo57(() => {
|
|
36492
36676
|
if (emoji === "melting") {
|
|
36493
36677
|
return "https://fonts.gstatic.com/s/e/notoemoji/latest/1fae0/lottie.json";
|
|
36494
36678
|
}
|
|
@@ -36500,7 +36684,7 @@ var DisplayedEmoji = ({ emoji }) => {
|
|
|
36500
36684
|
}
|
|
36501
36685
|
throw new Error("Unknown emoji");
|
|
36502
36686
|
}, [emoji]);
|
|
36503
|
-
const [handle] =
|
|
36687
|
+
const [handle] = useState44(() => delayRender2("Loading emojis!"));
|
|
36504
36688
|
useEffect47(() => {
|
|
36505
36689
|
fetch(src).then((res) => res.json()).then((json) => {
|
|
36506
36690
|
setData({
|
|
@@ -36582,11 +36766,11 @@ var emojiStyle = {
|
|
|
36582
36766
|
top: "calc(50% - 50px)"
|
|
36583
36767
|
};
|
|
36584
36768
|
var EmojiCardRefFn = ({ emojiIndex }, ref) => {
|
|
36585
|
-
const ref1 =
|
|
36586
|
-
const ref2 =
|
|
36587
|
-
const ref3 =
|
|
36588
|
-
const transforms =
|
|
36589
|
-
const onLeft =
|
|
36769
|
+
const ref1 = useRef49(null);
|
|
36770
|
+
const ref2 = useRef49(null);
|
|
36771
|
+
const ref3 = useRef49(null);
|
|
36772
|
+
const transforms = useRef49([-100, 0, 100]);
|
|
36773
|
+
const onLeft = useCallback40(() => {
|
|
36590
36774
|
if (!ref1.current || !ref2.current || !ref3.current) {
|
|
36591
36775
|
return;
|
|
36592
36776
|
}
|
|
@@ -36597,7 +36781,7 @@ var EmojiCardRefFn = ({ emojiIndex }, ref) => {
|
|
|
36597
36781
|
transforms: transforms.current
|
|
36598
36782
|
});
|
|
36599
36783
|
}, []);
|
|
36600
|
-
const onRight =
|
|
36784
|
+
const onRight = useCallback40(() => {
|
|
36601
36785
|
if (!ref1.current || !ref2.current || !ref3.current) {
|
|
36602
36786
|
return;
|
|
36603
36787
|
}
|
|
@@ -36915,7 +37099,7 @@ var Temperature = ({ theme, city, temperatureInCelsius }) => {
|
|
|
36915
37099
|
};
|
|
36916
37100
|
|
|
36917
37101
|
// src/components/homepage/Demo/TrendingRepos.tsx
|
|
36918
|
-
import { useMemo as
|
|
37102
|
+
import { useMemo as useMemo58 } from "react";
|
|
36919
37103
|
import { jsx as jsx80, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
36920
37104
|
var TrendingRepoItem = ({ repo, theme, number }) => {
|
|
36921
37105
|
const frame = useCurrentFrame();
|
|
@@ -36928,7 +37112,7 @@ var TrendingRepoItem = ({ repo, theme, number }) => {
|
|
|
36928
37112
|
},
|
|
36929
37113
|
delay: number * 10 + 20
|
|
36930
37114
|
});
|
|
36931
|
-
const item =
|
|
37115
|
+
const item = useMemo58(() => {
|
|
36932
37116
|
return {
|
|
36933
37117
|
lineHeight: 1.1,
|
|
36934
37118
|
fontFamily: "GTPlanar",
|
|
@@ -37031,14 +37215,14 @@ var Cards = ({
|
|
|
37031
37215
|
location,
|
|
37032
37216
|
trending
|
|
37033
37217
|
}) => {
|
|
37034
|
-
const container4 =
|
|
37035
|
-
const [refs] =
|
|
37218
|
+
const container4 = useRef50(null);
|
|
37219
|
+
const [refs] = useState46(() => {
|
|
37036
37220
|
return new Array(4).fill(true).map(() => {
|
|
37037
37221
|
return createRef4();
|
|
37038
37222
|
});
|
|
37039
37223
|
});
|
|
37040
|
-
const positions =
|
|
37041
|
-
const shouldBePositions =
|
|
37224
|
+
const positions = useRef50(getInitialPositions());
|
|
37225
|
+
const shouldBePositions = useRef50(getInitialPositions());
|
|
37042
37226
|
const { isRendering } = useRemotionEnvironment();
|
|
37043
37227
|
useEffect49(() => {
|
|
37044
37228
|
const { current } = container4;
|
|
@@ -37056,12 +37240,12 @@ var Cards = ({
|
|
|
37056
37240
|
current.removeEventListener("click", onClick);
|
|
37057
37241
|
};
|
|
37058
37242
|
}, [onToggle]);
|
|
37059
|
-
const ref =
|
|
37060
|
-
const onLeft =
|
|
37243
|
+
const ref = useRef50(null);
|
|
37244
|
+
const onLeft = useCallback41(() => {
|
|
37061
37245
|
ref.current?.onRight();
|
|
37062
37246
|
onRightPress();
|
|
37063
37247
|
}, [onRightPress]);
|
|
37064
|
-
const onRight =
|
|
37248
|
+
const onRight = useCallback41(() => {
|
|
37065
37249
|
ref.current?.onLeft();
|
|
37066
37250
|
onLeftPress();
|
|
37067
37251
|
}, [onLeftPress]);
|
|
@@ -37130,12 +37314,12 @@ var HomepageVideoComp = ({
|
|
|
37130
37314
|
onClickLeft,
|
|
37131
37315
|
onClickRight
|
|
37132
37316
|
}) => {
|
|
37133
|
-
const [rerenders, setRerenders] =
|
|
37134
|
-
const onUpdate =
|
|
37317
|
+
const [rerenders, setRerenders] = useState47(0);
|
|
37318
|
+
const onUpdate = useCallback43((newIndices) => {
|
|
37135
37319
|
setRerenders(rerenders + 1);
|
|
37136
37320
|
updateCardOrder(newIndices);
|
|
37137
37321
|
}, [rerenders, updateCardOrder]);
|
|
37138
|
-
const emoji =
|
|
37322
|
+
const emoji = useMemo59(() => {
|
|
37139
37323
|
if ((emojiIndex + 1e4 * 3) % 3 === 1) {
|
|
37140
37324
|
return "melting";
|
|
37141
37325
|
}
|
|
@@ -37144,7 +37328,7 @@ var HomepageVideoComp = ({
|
|
|
37144
37328
|
}
|
|
37145
37329
|
return "partying-face";
|
|
37146
37330
|
}, [emojiIndex]);
|
|
37147
|
-
const audioSrc =
|
|
37331
|
+
const audioSrc = useMemo59(() => {
|
|
37148
37332
|
if (emoji === "fire") {
|
|
37149
37333
|
return fireAudio;
|
|
37150
37334
|
}
|
|
@@ -37229,7 +37413,7 @@ import {
|
|
|
37229
37413
|
import { BufferTarget, StreamTarget } from "mediabunny";
|
|
37230
37414
|
|
|
37231
37415
|
// ../core/dist/esm/version.mjs
|
|
37232
|
-
var VERSION2 = "4.0.
|
|
37416
|
+
var VERSION2 = "4.0.465";
|
|
37233
37417
|
|
|
37234
37418
|
// ../web-renderer/dist/esm/index.mjs
|
|
37235
37419
|
import { AudioSample, VideoSample } from "mediabunny";
|
|
@@ -37237,7 +37421,7 @@ import { AudioSampleSource } from "mediabunny";
|
|
|
37237
37421
|
import { createRef as createRef6 } from "react";
|
|
37238
37422
|
import { flushSync as flushSync22 } from "react-dom";
|
|
37239
37423
|
import ReactDOM6 from "react-dom/client";
|
|
37240
|
-
import { useImperativeHandle as useImperativeHandle13, useState as
|
|
37424
|
+
import { useImperativeHandle as useImperativeHandle13, useState as useState48 } from "react";
|
|
37241
37425
|
import { flushSync as flushSync3 } from "react-dom";
|
|
37242
37426
|
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
37243
37427
|
import { jsx as jsx217 } from "react/jsx-runtime";
|
|
@@ -37868,7 +38052,7 @@ var UpdateTime = ({
|
|
|
37868
38052
|
initialFrame,
|
|
37869
38053
|
timeUpdater
|
|
37870
38054
|
}) => {
|
|
37871
|
-
const [frame, setFrame] =
|
|
38055
|
+
const [frame, setFrame] = useState48(initialFrame);
|
|
37872
38056
|
useImperativeHandle13(timeUpdater, () => ({
|
|
37873
38057
|
update: (f) => {
|
|
37874
38058
|
flushSync3(() => {
|
|
@@ -41858,7 +42042,7 @@ var renderMediaOnWeb = (options2) => {
|
|
|
41858
42042
|
};
|
|
41859
42043
|
|
|
41860
42044
|
// src/components/homepage/Demo/DemoRender.tsx
|
|
41861
|
-
import React68, { useCallback as
|
|
42045
|
+
import React68, { useCallback as useCallback45 } from "react";
|
|
41862
42046
|
import { z } from "zod";
|
|
41863
42047
|
|
|
41864
42048
|
// src/components/homepage/Demo/DemoErrorIcon.tsx
|
|
@@ -41964,7 +42148,7 @@ var Progress = ({ progress }) => {
|
|
|
41964
42148
|
};
|
|
41965
42149
|
|
|
41966
42150
|
// src/components/homepage/Demo/Spinner.tsx
|
|
41967
|
-
import { useMemo as
|
|
42151
|
+
import { useMemo as useMemo60 } from "react";
|
|
41968
42152
|
import { jsx as jsx95, jsxs as jsxs29, Fragment as Fragment14 } from "react/jsx-runtime";
|
|
41969
42153
|
var viewBox2 = 100;
|
|
41970
42154
|
var lines2 = 8;
|
|
@@ -41972,7 +42156,7 @@ var className2 = "__remotion_spinner_line";
|
|
|
41972
42156
|
var remotionSpinnerAnimation = "__remotion_spinner_animation";
|
|
41973
42157
|
var translated3 = "M 44 0 L 50 0 a 6 6 0 0 1 6 6 L 56 26 a 6 6 0 0 1 -6 6 L 50 32 a 6 6 0 0 1 -6 -6 L 44 6 a 6 6 0 0 1 6 -6 Z";
|
|
41974
42158
|
var Spinner2 = ({ size: size4, duration }) => {
|
|
41975
|
-
const style2 =
|
|
42159
|
+
const style2 = useMemo60(() => {
|
|
41976
42160
|
return {
|
|
41977
42161
|
width: size4,
|
|
41978
42162
|
height: size4
|
|
@@ -42059,7 +42243,7 @@ var RenderButton = ({ renderData, onError, playerRef }) => {
|
|
|
42059
42243
|
const [state, setState] = React68.useState({
|
|
42060
42244
|
type: "idle"
|
|
42061
42245
|
});
|
|
42062
|
-
const triggerRender =
|
|
42246
|
+
const triggerRender = useCallback45(async () => {
|
|
42063
42247
|
if (renderData === null) {
|
|
42064
42248
|
return;
|
|
42065
42249
|
}
|
|
@@ -42234,13 +42418,13 @@ var DragAndDropNudge = () => {
|
|
|
42234
42418
|
};
|
|
42235
42419
|
|
|
42236
42420
|
// src/components/homepage/Demo/PlayerSeekBar.tsx
|
|
42237
|
-
import { useCallback as
|
|
42421
|
+
import { useCallback as useCallback47, useEffect as useEffect53, useMemo as useMemo64, useRef as useRef51, useState as useState50 } from "react";
|
|
42238
42422
|
|
|
42239
42423
|
// src/components/homepage/layout/use-el-size.ts
|
|
42240
|
-
import { useCallback as
|
|
42424
|
+
import { useCallback as useCallback46, useEffect as useEffect51, useMemo as useMemo61, useState as useState49 } from "react";
|
|
42241
42425
|
var useElementSize2 = (ref) => {
|
|
42242
|
-
const [size4, setSize] =
|
|
42243
|
-
const observer =
|
|
42426
|
+
const [size4, setSize] = useState49(null);
|
|
42427
|
+
const observer = useMemo61(() => {
|
|
42244
42428
|
if (typeof ResizeObserver === "undefined") {
|
|
42245
42429
|
return;
|
|
42246
42430
|
}
|
|
@@ -42251,7 +42435,7 @@ var useElementSize2 = (ref) => {
|
|
|
42251
42435
|
});
|
|
42252
42436
|
});
|
|
42253
42437
|
}, []);
|
|
42254
|
-
const updateSize =
|
|
42438
|
+
const updateSize = useCallback46(() => {
|
|
42255
42439
|
if (ref === null) {
|
|
42256
42440
|
return;
|
|
42257
42441
|
}
|
|
@@ -42316,7 +42500,7 @@ var findBodyInWhichDivIsLocated2 = (div) => {
|
|
|
42316
42500
|
return current;
|
|
42317
42501
|
};
|
|
42318
42502
|
var useHoverState2 = (ref, hideControlsWhenPointerDoesntMove) => {
|
|
42319
|
-
const [hovered, setHovered] =
|
|
42503
|
+
const [hovered, setHovered] = useState50(false);
|
|
42320
42504
|
useEffect53(() => {
|
|
42321
42505
|
const { current } = ref;
|
|
42322
42506
|
if (!current) {
|
|
@@ -42363,11 +42547,11 @@ var PlayerSeekBar2 = ({
|
|
|
42363
42547
|
outFrame,
|
|
42364
42548
|
playerRef
|
|
42365
42549
|
}) => {
|
|
42366
|
-
const containerRef =
|
|
42550
|
+
const containerRef = useRef51(null);
|
|
42367
42551
|
const barHovered = useHoverState2(containerRef, false);
|
|
42368
42552
|
const size4 = useElementSize2(containerRef.current);
|
|
42369
|
-
const [playing, setPlaying] =
|
|
42370
|
-
const [frame, setFrame] =
|
|
42553
|
+
const [playing, setPlaying] = useState50(false);
|
|
42554
|
+
const [frame, setFrame] = useState50(0);
|
|
42371
42555
|
useEffect53(() => {
|
|
42372
42556
|
const { current } = playerRef;
|
|
42373
42557
|
if (!current) {
|
|
@@ -42399,11 +42583,11 @@ var PlayerSeekBar2 = ({
|
|
|
42399
42583
|
current.removeEventListener("pause", onPause);
|
|
42400
42584
|
};
|
|
42401
42585
|
}, [playerRef]);
|
|
42402
|
-
const [dragging, setDragging] =
|
|
42586
|
+
const [dragging, setDragging] = useState50({
|
|
42403
42587
|
dragging: false
|
|
42404
42588
|
});
|
|
42405
42589
|
const width2 = size4?.width ?? 0;
|
|
42406
|
-
const onPointerDown =
|
|
42590
|
+
const onPointerDown = useCallback47((e) => {
|
|
42407
42591
|
if (e.button !== 0) {
|
|
42408
42592
|
return;
|
|
42409
42593
|
}
|
|
@@ -42417,7 +42601,7 @@ var PlayerSeekBar2 = ({
|
|
|
42417
42601
|
});
|
|
42418
42602
|
onSeekStart();
|
|
42419
42603
|
}, [durationInFrames, width2, playerRef, playing, onSeekStart]);
|
|
42420
|
-
const onPointerMove =
|
|
42604
|
+
const onPointerMove = useCallback47((e) => {
|
|
42421
42605
|
if (!size4) {
|
|
42422
42606
|
throw new Error("Player has no size");
|
|
42423
42607
|
}
|
|
@@ -42428,7 +42612,7 @@ var PlayerSeekBar2 = ({
|
|
|
42428
42612
|
const _frame = getFrameFromX2(e.clientX - posLeft, durationInFrames, size4.width);
|
|
42429
42613
|
playerRef.current.seekTo(_frame);
|
|
42430
42614
|
}, [dragging.dragging, durationInFrames, playerRef, size4]);
|
|
42431
|
-
const onPointerUp =
|
|
42615
|
+
const onPointerUp = useCallback47(() => {
|
|
42432
42616
|
setDragging({
|
|
42433
42617
|
dragging: false
|
|
42434
42618
|
});
|
|
@@ -42454,7 +42638,7 @@ var PlayerSeekBar2 = ({
|
|
|
42454
42638
|
body.removeEventListener("pointerup", onPointerUp);
|
|
42455
42639
|
};
|
|
42456
42640
|
}, [dragging.dragging, onPointerMove, onPointerUp]);
|
|
42457
|
-
const knobStyle =
|
|
42641
|
+
const knobStyle = useMemo64(() => {
|
|
42458
42642
|
return {
|
|
42459
42643
|
height: KNOB_SIZE3,
|
|
42460
42644
|
width: KNOB_SIZE3,
|
|
@@ -42468,7 +42652,7 @@ var PlayerSeekBar2 = ({
|
|
|
42468
42652
|
transition: "opacity 0.s ease"
|
|
42469
42653
|
};
|
|
42470
42654
|
}, [barHovered, durationInFrames, frame, width2]);
|
|
42471
|
-
const fillStyle =
|
|
42655
|
+
const fillStyle = useMemo64(() => {
|
|
42472
42656
|
return {
|
|
42473
42657
|
height: BAR_HEIGHT3,
|
|
42474
42658
|
backgroundColor: "var(--ifm-font-color-base)",
|
|
@@ -42477,7 +42661,7 @@ var PlayerSeekBar2 = ({
|
|
|
42477
42661
|
borderRadius: BAR_HEIGHT3 / 2
|
|
42478
42662
|
};
|
|
42479
42663
|
}, [durationInFrames, frame, inFrame]);
|
|
42480
|
-
const active =
|
|
42664
|
+
const active = useMemo64(() => {
|
|
42481
42665
|
return {
|
|
42482
42666
|
height: BAR_HEIGHT3,
|
|
42483
42667
|
backgroundColor: "var(--ifm-font-color-base)",
|
|
@@ -42512,7 +42696,7 @@ var PlayerSeekBar2 = ({
|
|
|
42512
42696
|
};
|
|
42513
42697
|
|
|
42514
42698
|
// src/components/homepage/Demo/PlayerVolume.tsx
|
|
42515
|
-
import { useCallback as
|
|
42699
|
+
import { useCallback as useCallback48, useEffect as useEffect55, useRef as useRef53, useState as useState51 } from "react";
|
|
42516
42700
|
|
|
42517
42701
|
// src/components/homepage/Demo/icons.tsx
|
|
42518
42702
|
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
@@ -42570,9 +42754,9 @@ var IsMutedIcon = (props) => {
|
|
|
42570
42754
|
// src/components/homepage/Demo/PlayerVolume.tsx
|
|
42571
42755
|
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
42572
42756
|
var PlayerVolume = ({ playerRef }) => {
|
|
42573
|
-
const [muted, setIsMuted] =
|
|
42574
|
-
const [isHovered, setIsHovered] =
|
|
42575
|
-
const timerRef =
|
|
42757
|
+
const [muted, setIsMuted] = useState51(() => playerRef.current?.isMuted() ?? true);
|
|
42758
|
+
const [isHovered, setIsHovered] = useState51(false);
|
|
42759
|
+
const timerRef = useRef53(null);
|
|
42576
42760
|
useEffect55(() => {
|
|
42577
42761
|
const { current } = playerRef;
|
|
42578
42762
|
if (!current) {
|
|
@@ -42593,7 +42777,7 @@ var PlayerVolume = ({ playerRef }) => {
|
|
|
42593
42777
|
document.body.style.userSelect = "auto";
|
|
42594
42778
|
}
|
|
42595
42779
|
}, [isHovered]);
|
|
42596
|
-
const onClick =
|
|
42780
|
+
const onClick = useCallback48(() => {
|
|
42597
42781
|
if (timerRef.current !== null) {
|
|
42598
42782
|
clearTimeout(timerRef.current);
|
|
42599
42783
|
timerRef.current = null;
|
|
@@ -42631,7 +42815,7 @@ var PlayerVolume = ({ playerRef }) => {
|
|
|
42631
42815
|
};
|
|
42632
42816
|
|
|
42633
42817
|
// src/components/homepage/Demo/PlayPauseButton.tsx
|
|
42634
|
-
import React71, { useCallback as
|
|
42818
|
+
import React71, { useCallback as useCallback49, useEffect as useEffect56 } from "react";
|
|
42635
42819
|
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
42636
42820
|
var playerButtonStyle2 = {
|
|
42637
42821
|
appearance: "none",
|
|
@@ -42667,7 +42851,7 @@ var PlayPauseButton = ({ playerRef }) => {
|
|
|
42667
42851
|
current.removeEventListener("pause", onPause);
|
|
42668
42852
|
};
|
|
42669
42853
|
}, [playerRef]);
|
|
42670
|
-
const onToggle =
|
|
42854
|
+
const onToggle = useCallback49(() => {
|
|
42671
42855
|
playerRef.current?.toggle();
|
|
42672
42856
|
}, [playerRef]);
|
|
42673
42857
|
const playPauseIconStyle = {
|
|
@@ -42860,12 +43044,12 @@ var playerWrapper = {
|
|
|
42860
43044
|
};
|
|
42861
43045
|
var Demo = () => {
|
|
42862
43046
|
const { colorMode } = useColorMode();
|
|
42863
|
-
const [data2, setData] =
|
|
42864
|
-
const ref =
|
|
42865
|
-
const [isFullscreen, setIsFullscreen] =
|
|
42866
|
-
const [cardOrder, setCardOrder] =
|
|
42867
|
-
const [emojiIndex, setEmojiIndex] =
|
|
42868
|
-
const [error2, setError] =
|
|
43047
|
+
const [data2, setData] = useState54(null);
|
|
43048
|
+
const ref = useRef55(null);
|
|
43049
|
+
const [isFullscreen, setIsFullscreen] = useState54(false);
|
|
43050
|
+
const [cardOrder, setCardOrder] = useState54([0, 1, 2, 3]);
|
|
43051
|
+
const [emojiIndex, setEmojiIndex] = useState54(0);
|
|
43052
|
+
const [error2, setError] = useState54(false);
|
|
42869
43053
|
useEffect58(() => {
|
|
42870
43054
|
getDataAndProps().then((d2) => {
|
|
42871
43055
|
setData(d2);
|
|
@@ -42887,10 +43071,10 @@ var Demo = () => {
|
|
|
42887
43071
|
playerRef.removeEventListener("fullscreenchange", onFullscreenChange);
|
|
42888
43072
|
};
|
|
42889
43073
|
}, [data2]);
|
|
42890
|
-
const updateCardOrder =
|
|
43074
|
+
const updateCardOrder = useCallback50((newCardOrder) => {
|
|
42891
43075
|
setCardOrder(newCardOrder);
|
|
42892
43076
|
}, []);
|
|
42893
|
-
const props =
|
|
43077
|
+
const props = useMemo66(() => {
|
|
42894
43078
|
return {
|
|
42895
43079
|
theme: colorMode,
|
|
42896
43080
|
onToggle: () => {
|
|
@@ -42909,7 +43093,7 @@ var Demo = () => {
|
|
|
42909
43093
|
emojiIndex
|
|
42910
43094
|
};
|
|
42911
43095
|
}, [cardOrder, emojiIndex, colorMode, data2, updateCardOrder]);
|
|
42912
|
-
const onError =
|
|
43096
|
+
const onError = useCallback50(() => {
|
|
42913
43097
|
setError(true);
|
|
42914
43098
|
}, []);
|
|
42915
43099
|
return /* @__PURE__ */ jsxs38("div", {
|
|
@@ -43019,15 +43203,15 @@ var ClearButton = (props) => {
|
|
|
43019
43203
|
|
|
43020
43204
|
// src/components/homepage/MuxVideo.tsx
|
|
43021
43205
|
import Hls2 from "hls.js";
|
|
43022
|
-
import { forwardRef as forwardRef39, useEffect as useEffect60, useImperativeHandle as useImperativeHandle14, useRef as
|
|
43206
|
+
import { forwardRef as forwardRef39, useEffect as useEffect60, useImperativeHandle as useImperativeHandle14, useRef as useRef57 } from "react";
|
|
43023
43207
|
|
|
43024
43208
|
// src/components/homepage/VideoPlayerWithControls.tsx
|
|
43025
43209
|
import Hls from "hls.js";
|
|
43026
43210
|
import"plyr/dist/plyr.css";
|
|
43027
|
-
import { forwardRef as forwardRef38, useCallback as
|
|
43211
|
+
import { forwardRef as forwardRef38, useCallback as useCallback51, useEffect as useEffect59, useRef as useRef56, useState as useState56 } from "react";
|
|
43028
43212
|
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
43029
43213
|
var useCombinedRefs = function(...refs) {
|
|
43030
|
-
const targetRef =
|
|
43214
|
+
const targetRef = useRef56(null);
|
|
43031
43215
|
useEffect59(() => {
|
|
43032
43216
|
refs.forEach((ref) => {
|
|
43033
43217
|
if (!ref)
|
|
@@ -43042,12 +43226,12 @@ var useCombinedRefs = function(...refs) {
|
|
|
43042
43226
|
return targetRef;
|
|
43043
43227
|
};
|
|
43044
43228
|
var VideoPlayerWithControls = forwardRef38(({ playbackId, poster, currentTime, onLoaded, onError, onSize, autoPlay }, ref) => {
|
|
43045
|
-
const videoRef =
|
|
43229
|
+
const videoRef = useRef56(null);
|
|
43046
43230
|
const metaRef = useCombinedRefs(ref, videoRef);
|
|
43047
|
-
const playerRef =
|
|
43048
|
-
const [playerInitTime] =
|
|
43049
|
-
const videoError =
|
|
43050
|
-
const onImageLoad =
|
|
43231
|
+
const playerRef = useRef56(null);
|
|
43232
|
+
const [playerInitTime] = useState56(Date.now());
|
|
43233
|
+
const videoError = useCallback51((event) => onError(event), [onError]);
|
|
43234
|
+
const onImageLoad = useCallback51((event) => {
|
|
43051
43235
|
const [w, h] = [event.target.width, event.target.height];
|
|
43052
43236
|
if (w && h) {
|
|
43053
43237
|
onSize({ width: w, height: h });
|
|
@@ -43129,7 +43313,7 @@ var getVideoToPlayUrl = (muxId) => {
|
|
|
43129
43313
|
return `https://stream.mux.com/${muxId}.m3u8`;
|
|
43130
43314
|
};
|
|
43131
43315
|
var MuxVideoForward = ({ muxId, ...props }, ref) => {
|
|
43132
|
-
const videoRef =
|
|
43316
|
+
const videoRef = useRef57(null);
|
|
43133
43317
|
const vidUrl = getVideoToPlayUrl(muxId);
|
|
43134
43318
|
useImperativeHandle14(ref, () => videoRef.current, []);
|
|
43135
43319
|
useEffect60(() => {
|
|
@@ -43245,10 +43429,10 @@ var EditorStarterSection = () => {
|
|
|
43245
43429
|
var EditorStarterSection_default = EditorStarterSection;
|
|
43246
43430
|
|
|
43247
43431
|
// src/components/homepage/EvaluateRemotion.tsx
|
|
43248
|
-
import { useEffect as useEffect61, useState as
|
|
43432
|
+
import { useEffect as useEffect61, useState as useState57 } from "react";
|
|
43249
43433
|
import { jsx as jsx119, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
43250
43434
|
var EvaluateRemotionSection = () => {
|
|
43251
|
-
const [dailyAvatars, setDailyAvatars] =
|
|
43435
|
+
const [dailyAvatars, setDailyAvatars] = useState57([]);
|
|
43252
43436
|
useEffect61(() => {
|
|
43253
43437
|
const avatars = experts.map((expert) => expert.image);
|
|
43254
43438
|
const selectedAvatars = [];
|
|
@@ -43346,7 +43530,7 @@ var EvaluateRemotionSection = () => {
|
|
|
43346
43530
|
var EvaluateRemotion_default = EvaluateRemotionSection;
|
|
43347
43531
|
|
|
43348
43532
|
// src/components/homepage/IfYouKnowReact.tsx
|
|
43349
|
-
import { useEffect as useEffect63, useState as
|
|
43533
|
+
import { useEffect as useEffect63, useState as useState58 } from "react";
|
|
43350
43534
|
import { jsx as jsx120, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
43351
43535
|
var isWebkit = () => {
|
|
43352
43536
|
if (typeof window === "undefined") {
|
|
@@ -43361,7 +43545,7 @@ var icon2 = {
|
|
|
43361
43545
|
marginLeft: 10
|
|
43362
43546
|
};
|
|
43363
43547
|
var IfYouKnowReact = () => {
|
|
43364
|
-
const [vid, setVid] =
|
|
43548
|
+
const [vid, setVid] = useState58("/img/compose.webm");
|
|
43365
43549
|
useEffect63(() => {
|
|
43366
43550
|
if (isWebkit()) {
|
|
43367
43551
|
setVid("/img/compose.mp4");
|
|
@@ -43421,13 +43605,13 @@ var IfYouKnowReact = () => {
|
|
|
43421
43605
|
};
|
|
43422
43606
|
|
|
43423
43607
|
// src/components/homepage/NewsletterButton.tsx
|
|
43424
|
-
import { useCallback as
|
|
43608
|
+
import { useCallback as useCallback53, useState as useState59 } from "react";
|
|
43425
43609
|
import { jsx as jsx121, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
43426
43610
|
var NewsletterButton = () => {
|
|
43427
|
-
const [email, setEmail] =
|
|
43428
|
-
const [submitting, setSubmitting] =
|
|
43429
|
-
const [subscribed, setSubscribed] =
|
|
43430
|
-
const handleSubmit =
|
|
43611
|
+
const [email, setEmail] = useState59("");
|
|
43612
|
+
const [submitting, setSubmitting] = useState59(false);
|
|
43613
|
+
const [subscribed, setSubscribed] = useState59(false);
|
|
43614
|
+
const handleSubmit = useCallback53(async (e) => {
|
|
43431
43615
|
try {
|
|
43432
43616
|
setSubmitting(true);
|
|
43433
43617
|
e.preventDefault();
|
|
@@ -43509,15 +43693,15 @@ var NewsletterButton = () => {
|
|
|
43509
43693
|
};
|
|
43510
43694
|
|
|
43511
43695
|
// src/components/homepage/ParameterizeAndEdit.tsx
|
|
43512
|
-
import { useEffect as useEffect65, useRef as
|
|
43696
|
+
import { useEffect as useEffect65, useRef as useRef58, useState as useState60 } from "react";
|
|
43513
43697
|
import { jsx as jsx124, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
43514
43698
|
var icon3 = {
|
|
43515
43699
|
height: 16,
|
|
43516
43700
|
marginLeft: 10
|
|
43517
43701
|
};
|
|
43518
43702
|
var ParameterizeAndEdit = () => {
|
|
43519
|
-
const ref =
|
|
43520
|
-
const [vid, setVid] =
|
|
43703
|
+
const ref = useRef58(null);
|
|
43704
|
+
const [vid, setVid] = useState60("/img/editing-vp9-chrome.webm");
|
|
43521
43705
|
useEffect65(() => {
|
|
43522
43706
|
if (isWebkit()) {
|
|
43523
43707
|
setVid("/img/editing-safari.mp4");
|
|
@@ -43632,16 +43816,16 @@ var ParameterizeAndEdit = () => {
|
|
|
43632
43816
|
};
|
|
43633
43817
|
|
|
43634
43818
|
// src/components/homepage/RealMp4Videos.tsx
|
|
43635
|
-
import { useEffect as useEffect66, useRef as
|
|
43819
|
+
import { useEffect as useEffect66, useRef as useRef59, useState as useState61 } from "react";
|
|
43636
43820
|
import { jsx as jsx126, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
43637
43821
|
var icon4 = {
|
|
43638
43822
|
height: 16,
|
|
43639
43823
|
marginLeft: 10
|
|
43640
43824
|
};
|
|
43641
43825
|
var RealMP4Videos = () => {
|
|
43642
|
-
const ref =
|
|
43643
|
-
const videoRef =
|
|
43644
|
-
const [vid, setVid] =
|
|
43826
|
+
const ref = useRef59(null);
|
|
43827
|
+
const videoRef = useRef59(null);
|
|
43828
|
+
const [vid, setVid] = useState61("/img/render-progress.webm");
|
|
43645
43829
|
useEffect66(() => {
|
|
43646
43830
|
if (isWebkit()) {
|
|
43647
43831
|
setVid("/img/render-progress.mp4");
|
|
@@ -43893,7 +44077,7 @@ var TrustedByBanner = () => {
|
|
|
43893
44077
|
var TrustedByBanner_default = TrustedByBanner;
|
|
43894
44078
|
|
|
43895
44079
|
// src/components/homepage/VideoAppsShowcase.tsx
|
|
43896
|
-
import { useRef as
|
|
44080
|
+
import { useRef as useRef60, useState as useState64 } from "react";
|
|
43897
44081
|
import { jsx as jsx128, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
43898
44082
|
var tabs = [
|
|
43899
44083
|
"Music visualization",
|
|
@@ -43946,12 +44130,12 @@ var icon5 = {
|
|
|
43946
44130
|
marginLeft: 10
|
|
43947
44131
|
};
|
|
43948
44132
|
var VideoAppsShowcase = () => {
|
|
43949
|
-
const [activeTab, setActiveTab] =
|
|
43950
|
-
const [isMuted, setIsMuted] =
|
|
43951
|
-
const [isPlaying, setIsPlaying] =
|
|
43952
|
-
const [videoLoaded, setVideoLoaded] =
|
|
43953
|
-
const videoRef =
|
|
43954
|
-
const containerRef =
|
|
44133
|
+
const [activeTab, setActiveTab] = useState64(0);
|
|
44134
|
+
const [isMuted, setIsMuted] = useState64(true);
|
|
44135
|
+
const [isPlaying, setIsPlaying] = useState64(false);
|
|
44136
|
+
const [videoLoaded, setVideoLoaded] = useState64(false);
|
|
44137
|
+
const videoRef = useRef60(null);
|
|
44138
|
+
const containerRef = useRef60(null);
|
|
43955
44139
|
const handleTabChange = (index2) => {
|
|
43956
44140
|
const video = videoRef.current;
|
|
43957
44141
|
if (video) {
|
|
@@ -44233,6 +44417,7 @@ var listOfRemotionPackages = [
|
|
|
44233
44417
|
"@remotion/example-videos",
|
|
44234
44418
|
"@remotion/whisper-web",
|
|
44235
44419
|
"@remotion/media",
|
|
44420
|
+
"@remotion/remotion-media",
|
|
44236
44421
|
"@remotion/web-renderer",
|
|
44237
44422
|
"@remotion/design",
|
|
44238
44423
|
"@remotion/light-leaks",
|
|
@@ -45468,7 +45653,7 @@ var ChooseTemplate = () => {
|
|
|
45468
45653
|
};
|
|
45469
45654
|
|
|
45470
45655
|
// src/components/homepage/GetStartedStrip.tsx
|
|
45471
|
-
import { useState as
|
|
45656
|
+
import { useState as useState66 } from "react";
|
|
45472
45657
|
|
|
45473
45658
|
// src/components/homepage/GitHubButton.tsx
|
|
45474
45659
|
import { jsx as jsx164, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
@@ -45503,7 +45688,7 @@ var GithubButton = () => {
|
|
|
45503
45688
|
// src/components/homepage/GetStartedStrip.tsx
|
|
45504
45689
|
import { jsx as jsx166, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
45505
45690
|
var GetStarted = () => {
|
|
45506
|
-
const [clicked, setClicked] =
|
|
45691
|
+
const [clicked, setClicked] = useState66(null);
|
|
45507
45692
|
return /* @__PURE__ */ jsxs66("div", {
|
|
45508
45693
|
className: "flex flex-col lg:flex-row items-center justify-center text-center w-full",
|
|
45509
45694
|
children: [
|
|
@@ -45603,7 +45788,7 @@ var WriteInReact = () => {
|
|
|
45603
45788
|
return /* @__PURE__ */ jsxs67("div", {
|
|
45604
45789
|
children: [
|
|
45605
45790
|
/* @__PURE__ */ jsx167("h1", {
|
|
45606
|
-
className: "text-5xl lg:text-[5em] text-center fontbrand font-black leading-none ",
|
|
45791
|
+
className: "text-4xl sm:text-5xl lg:text-[5em] text-center fontbrand font-black leading-none text-balance",
|
|
45607
45792
|
style: {
|
|
45608
45793
|
textShadow: "0 5px 30px var(--background)"
|
|
45609
45794
|
},
|
|
@@ -45617,7 +45802,7 @@ var WriteInReact = () => {
|
|
|
45617
45802
|
children: [
|
|
45618
45803
|
"Create real MP4 videos with React. ",
|
|
45619
45804
|
/* @__PURE__ */ jsx167("br", {}),
|
|
45620
|
-
"
|
|
45805
|
+
"Use coding agents, build apps and render in bulk."
|
|
45621
45806
|
]
|
|
45622
45807
|
}),
|
|
45623
45808
|
/* @__PURE__ */ jsx167("br", {}),
|