remotion 4.0.413 → 4.0.415
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/cjs/RemotionRoot.d.ts +1 -0
- package/dist/cjs/RemotionRoot.js +4 -25
- package/dist/cjs/ResolveCompositionConfig.d.ts +0 -4
- package/dist/cjs/ResolveCompositionConfig.js +1 -272
- package/dist/cjs/internals.d.ts +32 -4
- package/dist/cjs/internals.js +2 -2
- package/dist/cjs/nonce.d.ts +0 -6
- package/dist/cjs/nonce.js +1 -6
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.mjs +494 -785
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/cjs/RemotionRoot.js
CHANGED
|
@@ -13,38 +13,17 @@ const nonce_js_1 = require("./nonce.js");
|
|
|
13
13
|
const prefetch_state_js_1 = require("./prefetch-state.js");
|
|
14
14
|
const use_media_enabled_js_1 = require("./use-media-enabled.js");
|
|
15
15
|
const duration_state_js_1 = require("./video/duration-state.js");
|
|
16
|
-
const RemotionRootContexts = ({ children, numberOfAudioTags, logLevel, audioLatencyHint, videoEnabled, audioEnabled, frameState, }) => {
|
|
17
|
-
const [fastRefreshes, setFastRefreshes] = (0, react_1.useState)(0);
|
|
18
|
-
const [manualRefreshes, setManualRefreshes] = (0, react_1.useState)(0);
|
|
16
|
+
const RemotionRootContexts = ({ children, numberOfAudioTags, logLevel, audioLatencyHint, videoEnabled, audioEnabled, frameState, nonceContextSeed, }) => {
|
|
19
17
|
const nonceContext = (0, react_1.useMemo)(() => {
|
|
20
18
|
let counter = 0;
|
|
21
19
|
return {
|
|
22
20
|
getNonce: () => counter++,
|
|
23
|
-
fastRefreshes,
|
|
24
|
-
manualRefreshes,
|
|
25
21
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
increaseManualRefreshes: () => {
|
|
30
|
-
setManualRefreshes((i) => i + 1);
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}, []);
|
|
34
|
-
(0, react_1.useEffect)(() => {
|
|
35
|
-
if (typeof __webpack_module__ !== 'undefined') {
|
|
36
|
-
if (__webpack_module__.hot) {
|
|
37
|
-
__webpack_module__.hot.addStatusHandler((status) => {
|
|
38
|
-
if (status === 'idle') {
|
|
39
|
-
setFastRefreshes((i) => i + 1);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}, []);
|
|
22
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
23
|
+
}, [nonceContextSeed]);
|
|
45
24
|
const logging = (0, react_1.useMemo)(() => {
|
|
46
25
|
return { logLevel, mountTime: Date.now() };
|
|
47
26
|
}, [logLevel]);
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(log_level_context_js_1.LogLevelContext.Provider, { value: logging, children: (0, jsx_runtime_1.jsx)(nonce_js_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(log_level_context_js_1.LogLevelContext.Provider, { value: logging, children: (0, jsx_runtime_1.jsx)(nonce_js_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(TimelineContext_js_1.TimelineContextProvider, { frameState: frameState, children: (0, jsx_runtime_1.jsx)(use_media_enabled_js_1.MediaEnabledProvider, { videoEnabled: videoEnabled, audioEnabled: audioEnabled, children: (0, jsx_runtime_1.jsx)(EditorProps_js_1.EditorPropsProvider, { children: (0, jsx_runtime_1.jsx)(prefetch_state_js_1.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(SequenceManager_js_1.SequenceManagerProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_js_1.SharedAudioContextProvider, { numberOfAudioTags: numberOfAudioTags, audioLatencyHint: audioLatencyHint, audioEnabled: audioEnabled, children: (0, jsx_runtime_1.jsx)(duration_state_js_1.DurationsContextProvider, { children: (0, jsx_runtime_1.jsx)(buffering_js_1.BufferingProvider, { children: children }) }) }) }) }) }) }) }) }) }));
|
|
49
28
|
};
|
|
50
29
|
exports.RemotionRootContexts = RemotionRootContexts;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { PropsWithChildren } from 'react';
|
|
2
1
|
import type { AnyComposition } from './CompositionManager.js';
|
|
3
2
|
import type { VideoConfig } from './video-config.js';
|
|
4
3
|
type ResolveCompositionConfigContect = Record<string, VideoConfigState | undefined>;
|
|
@@ -21,8 +20,5 @@ type VideoConfigState = {
|
|
|
21
20
|
};
|
|
22
21
|
export declare const needsResolution: (composition: AnyComposition) => boolean;
|
|
23
22
|
export declare const PROPS_UPDATED_EXTERNALLY = "remotion.propsUpdatedExternally";
|
|
24
|
-
export declare const ResolveCompositionConfigInStudio: React.FC<PropsWithChildren<{
|
|
25
|
-
children: React.ReactNode;
|
|
26
|
-
}>>;
|
|
27
23
|
export declare const useResolvedVideoConfig: (preferredCompositionId: string | null) => VideoConfigState | null;
|
|
28
24
|
export {};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useResolvedVideoConfig = exports.
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
3
|
+
exports.useResolvedVideoConfig = exports.PROPS_UPDATED_EXTERNALLY = exports.needsResolution = exports.resolveCompositionsRef = exports.ResolveCompositionContext = void 0;
|
|
5
4
|
const react_1 = require("react");
|
|
6
5
|
const CompositionManagerContext_js_1 = require("./CompositionManagerContext.js");
|
|
7
6
|
const EditorProps_js_1 = require("./EditorProps.js");
|
|
8
7
|
const input_props_js_1 = require("./config/input-props.js");
|
|
9
|
-
const nonce_js_1 = require("./nonce.js");
|
|
10
|
-
const resolve_video_config_js_1 = require("./resolve-video-config.js");
|
|
11
8
|
const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
|
|
12
9
|
const validate_dimensions_js_1 = require("./validation/validate-dimensions.js");
|
|
13
10
|
const validate_duration_in_frames_js_1 = require("./validation/validate-duration-in-frames.js");
|
|
@@ -19,274 +16,6 @@ const needsResolution = (composition) => {
|
|
|
19
16
|
};
|
|
20
17
|
exports.needsResolution = needsResolution;
|
|
21
18
|
exports.PROPS_UPDATED_EXTERNALLY = 'remotion.propsUpdatedExternally';
|
|
22
|
-
const ResolveCompositionConfigInStudio = ({ children }) => {
|
|
23
|
-
const [currentRenderModalComposition, setCurrentRenderModalComposition] = (0, react_1.useState)(null);
|
|
24
|
-
const { compositions, canvasContent, currentCompositionMetadata } = (0, react_1.useContext)(CompositionManagerContext_js_1.CompositionManager);
|
|
25
|
-
const { fastRefreshes, manualRefreshes } = (0, react_1.useContext)(nonce_js_1.NonceContext);
|
|
26
|
-
// don't do anything, this component should should re-render if the value changes
|
|
27
|
-
if (manualRefreshes) {
|
|
28
|
-
/** */
|
|
29
|
-
}
|
|
30
|
-
const selectedComposition = (0, react_1.useMemo)(() => {
|
|
31
|
-
return compositions.find((c) => canvasContent &&
|
|
32
|
-
canvasContent.type === 'composition' &&
|
|
33
|
-
canvasContent.compositionId === c.id);
|
|
34
|
-
}, [canvasContent, compositions]);
|
|
35
|
-
const renderModalComposition = compositions.find((c) => c.id === currentRenderModalComposition);
|
|
36
|
-
const { props: allEditorProps } = (0, react_1.useContext)(EditorProps_js_1.EditorPropsContext);
|
|
37
|
-
const env = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
|
|
38
|
-
const inputProps = (0, react_1.useMemo)(() => {
|
|
39
|
-
var _a;
|
|
40
|
-
return typeof window === 'undefined' || env.isPlayer
|
|
41
|
-
? {}
|
|
42
|
-
: ((_a = (0, input_props_js_1.getInputProps)()) !== null && _a !== void 0 ? _a : {});
|
|
43
|
-
}, [env.isPlayer]);
|
|
44
|
-
const [resolvedConfigs, setResolvedConfigs] = (0, react_1.useState)({});
|
|
45
|
-
const selectedEditorProps = (0, react_1.useMemo)(() => {
|
|
46
|
-
var _a;
|
|
47
|
-
return selectedComposition
|
|
48
|
-
? ((_a = allEditorProps[selectedComposition.id]) !== null && _a !== void 0 ? _a : {})
|
|
49
|
-
: {};
|
|
50
|
-
}, [allEditorProps, selectedComposition]);
|
|
51
|
-
const renderModalProps = (0, react_1.useMemo)(() => {
|
|
52
|
-
var _a;
|
|
53
|
-
return renderModalComposition
|
|
54
|
-
? ((_a = allEditorProps[renderModalComposition.id]) !== null && _a !== void 0 ? _a : {})
|
|
55
|
-
: {};
|
|
56
|
-
}, [allEditorProps, renderModalComposition]);
|
|
57
|
-
const hasResolution = Boolean(currentCompositionMetadata);
|
|
58
|
-
const doResolution = (0, react_1.useCallback)(({ calculateMetadata, combinedProps, compositionDurationInFrames, compositionFps, compositionHeight, compositionId, compositionWidth, defaultProps, }) => {
|
|
59
|
-
const controller = new AbortController();
|
|
60
|
-
if (hasResolution) {
|
|
61
|
-
return controller;
|
|
62
|
-
}
|
|
63
|
-
const { signal } = controller;
|
|
64
|
-
const result = (0, resolve_video_config_js_1.resolveVideoConfigOrCatch)({
|
|
65
|
-
compositionId,
|
|
66
|
-
calculateMetadata,
|
|
67
|
-
inputProps: combinedProps,
|
|
68
|
-
signal,
|
|
69
|
-
defaultProps,
|
|
70
|
-
compositionDurationInFrames,
|
|
71
|
-
compositionFps,
|
|
72
|
-
compositionHeight,
|
|
73
|
-
compositionWidth,
|
|
74
|
-
});
|
|
75
|
-
if (result.type === 'error') {
|
|
76
|
-
setResolvedConfigs((r) => ({
|
|
77
|
-
...r,
|
|
78
|
-
[compositionId]: {
|
|
79
|
-
type: 'error',
|
|
80
|
-
error: result.error,
|
|
81
|
-
},
|
|
82
|
-
}));
|
|
83
|
-
return controller;
|
|
84
|
-
}
|
|
85
|
-
const promOrNot = result.result;
|
|
86
|
-
if (typeof promOrNot === 'object' && 'then' in promOrNot) {
|
|
87
|
-
setResolvedConfigs((r) => {
|
|
88
|
-
const prev = r[compositionId];
|
|
89
|
-
if ((prev === null || prev === void 0 ? void 0 : prev.type) === 'success' ||
|
|
90
|
-
(prev === null || prev === void 0 ? void 0 : prev.type) === 'success-and-refreshing') {
|
|
91
|
-
return {
|
|
92
|
-
...r,
|
|
93
|
-
[compositionId]: {
|
|
94
|
-
type: 'success-and-refreshing',
|
|
95
|
-
result: prev.result,
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
...r,
|
|
101
|
-
[compositionId]: {
|
|
102
|
-
type: 'loading',
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
});
|
|
106
|
-
promOrNot
|
|
107
|
-
.then((c) => {
|
|
108
|
-
if (controller.signal.aborted) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
setResolvedConfigs((r) => ({
|
|
112
|
-
...r,
|
|
113
|
-
[compositionId]: {
|
|
114
|
-
type: 'success',
|
|
115
|
-
result: c,
|
|
116
|
-
},
|
|
117
|
-
}));
|
|
118
|
-
})
|
|
119
|
-
.catch((err) => {
|
|
120
|
-
if (controller.signal.aborted) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
setResolvedConfigs((r) => ({
|
|
124
|
-
...r,
|
|
125
|
-
[compositionId]: {
|
|
126
|
-
type: 'error',
|
|
127
|
-
error: err,
|
|
128
|
-
},
|
|
129
|
-
}));
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
setResolvedConfigs((r) => ({
|
|
134
|
-
...r,
|
|
135
|
-
[compositionId]: {
|
|
136
|
-
type: 'success',
|
|
137
|
-
result: promOrNot,
|
|
138
|
-
},
|
|
139
|
-
}));
|
|
140
|
-
}
|
|
141
|
-
return controller;
|
|
142
|
-
}, [hasResolution]);
|
|
143
|
-
const currentComposition = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
144
|
-
(0, react_1.useImperativeHandle)(exports.resolveCompositionsRef, () => {
|
|
145
|
-
return {
|
|
146
|
-
setCurrentRenderModalComposition: (id) => {
|
|
147
|
-
setCurrentRenderModalComposition(id);
|
|
148
|
-
},
|
|
149
|
-
reloadCurrentlySelectedComposition: () => {
|
|
150
|
-
var _a, _b, _c, _d, _e, _f;
|
|
151
|
-
if (!currentComposition) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const composition = compositions.find((c) => c.id === currentComposition);
|
|
155
|
-
if (!composition) {
|
|
156
|
-
throw new Error(`Could not find composition with id ${currentComposition}`);
|
|
157
|
-
}
|
|
158
|
-
const editorProps = (_a = allEditorProps[currentComposition]) !== null && _a !== void 0 ? _a : {};
|
|
159
|
-
const defaultProps = {
|
|
160
|
-
...((_b = composition.defaultProps) !== null && _b !== void 0 ? _b : {}),
|
|
161
|
-
...(editorProps !== null && editorProps !== void 0 ? editorProps : {}),
|
|
162
|
-
};
|
|
163
|
-
const props = {
|
|
164
|
-
...defaultProps,
|
|
165
|
-
...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
|
|
166
|
-
};
|
|
167
|
-
doResolution({
|
|
168
|
-
defaultProps,
|
|
169
|
-
calculateMetadata: composition.calculateMetadata,
|
|
170
|
-
combinedProps: props,
|
|
171
|
-
compositionDurationInFrames: (_c = composition.durationInFrames) !== null && _c !== void 0 ? _c : null,
|
|
172
|
-
compositionFps: (_d = composition.fps) !== null && _d !== void 0 ? _d : null,
|
|
173
|
-
compositionHeight: (_e = composition.height) !== null && _e !== void 0 ? _e : null,
|
|
174
|
-
compositionWidth: (_f = composition.width) !== null && _f !== void 0 ? _f : null,
|
|
175
|
-
compositionId: composition.id,
|
|
176
|
-
});
|
|
177
|
-
},
|
|
178
|
-
};
|
|
179
|
-
}, [
|
|
180
|
-
allEditorProps,
|
|
181
|
-
compositions,
|
|
182
|
-
currentComposition,
|
|
183
|
-
doResolution,
|
|
184
|
-
inputProps,
|
|
185
|
-
]);
|
|
186
|
-
const isTheSame = (selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.id) === (renderModalComposition === null || renderModalComposition === void 0 ? void 0 : renderModalComposition.id);
|
|
187
|
-
const currentDefaultProps = (0, react_1.useMemo)(() => {
|
|
188
|
-
var _a;
|
|
189
|
-
return {
|
|
190
|
-
...((_a = selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.defaultProps) !== null && _a !== void 0 ? _a : {}),
|
|
191
|
-
...(selectedEditorProps !== null && selectedEditorProps !== void 0 ? selectedEditorProps : {}),
|
|
192
|
-
};
|
|
193
|
-
}, [selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.defaultProps, selectedEditorProps]);
|
|
194
|
-
const originalProps = (0, react_1.useMemo)(() => {
|
|
195
|
-
return {
|
|
196
|
-
...currentDefaultProps,
|
|
197
|
-
...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
|
|
198
|
-
};
|
|
199
|
-
}, [currentDefaultProps, inputProps]);
|
|
200
|
-
const canResolve = selectedComposition && (0, exports.needsResolution)(selectedComposition);
|
|
201
|
-
const shouldIgnoreUpdate = typeof window !== 'undefined' &&
|
|
202
|
-
window.remotion_ignoreFastRefreshUpdate &&
|
|
203
|
-
fastRefreshes <= window.remotion_ignoreFastRefreshUpdate;
|
|
204
|
-
(0, react_1.useEffect)(() => {
|
|
205
|
-
var _a, _b, _c, _d;
|
|
206
|
-
if (shouldIgnoreUpdate) {
|
|
207
|
-
// We already have the current state, we just saved it back
|
|
208
|
-
// to the file
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
if (canResolve) {
|
|
212
|
-
const controller = doResolution({
|
|
213
|
-
calculateMetadata: selectedComposition.calculateMetadata,
|
|
214
|
-
combinedProps: originalProps,
|
|
215
|
-
compositionDurationInFrames: (_a = selectedComposition.durationInFrames) !== null && _a !== void 0 ? _a : null,
|
|
216
|
-
compositionFps: (_b = selectedComposition.fps) !== null && _b !== void 0 ? _b : null,
|
|
217
|
-
compositionHeight: (_c = selectedComposition.height) !== null && _c !== void 0 ? _c : null,
|
|
218
|
-
compositionWidth: (_d = selectedComposition.width) !== null && _d !== void 0 ? _d : null,
|
|
219
|
-
defaultProps: currentDefaultProps,
|
|
220
|
-
compositionId: selectedComposition.id,
|
|
221
|
-
});
|
|
222
|
-
return () => {
|
|
223
|
-
controller.abort();
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
}, [
|
|
227
|
-
canResolve,
|
|
228
|
-
currentDefaultProps,
|
|
229
|
-
doResolution,
|
|
230
|
-
originalProps,
|
|
231
|
-
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.calculateMetadata,
|
|
232
|
-
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.durationInFrames,
|
|
233
|
-
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.fps,
|
|
234
|
-
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.height,
|
|
235
|
-
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.id,
|
|
236
|
-
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.width,
|
|
237
|
-
shouldIgnoreUpdate,
|
|
238
|
-
]);
|
|
239
|
-
(0, react_1.useEffect)(() => {
|
|
240
|
-
var _a, _b, _c, _d, _e;
|
|
241
|
-
if (renderModalComposition && !isTheSame) {
|
|
242
|
-
const combinedProps = {
|
|
243
|
-
...((_a = renderModalComposition.defaultProps) !== null && _a !== void 0 ? _a : {}),
|
|
244
|
-
...(renderModalProps !== null && renderModalProps !== void 0 ? renderModalProps : {}),
|
|
245
|
-
...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
|
|
246
|
-
};
|
|
247
|
-
const controller = doResolution({
|
|
248
|
-
calculateMetadata: renderModalComposition.calculateMetadata,
|
|
249
|
-
compositionDurationInFrames: (_b = renderModalComposition.durationInFrames) !== null && _b !== void 0 ? _b : null,
|
|
250
|
-
compositionFps: (_c = renderModalComposition.fps) !== null && _c !== void 0 ? _c : null,
|
|
251
|
-
compositionHeight: (_d = renderModalComposition.height) !== null && _d !== void 0 ? _d : null,
|
|
252
|
-
compositionId: renderModalComposition.id,
|
|
253
|
-
compositionWidth: (_e = renderModalComposition.width) !== null && _e !== void 0 ? _e : null,
|
|
254
|
-
defaultProps: currentDefaultProps,
|
|
255
|
-
combinedProps,
|
|
256
|
-
});
|
|
257
|
-
return () => {
|
|
258
|
-
controller.abort();
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
}, [
|
|
262
|
-
currentDefaultProps,
|
|
263
|
-
doResolution,
|
|
264
|
-
inputProps,
|
|
265
|
-
isTheSame,
|
|
266
|
-
renderModalComposition,
|
|
267
|
-
renderModalProps,
|
|
268
|
-
]);
|
|
269
|
-
const resolvedConfigsIncludingStaticOnes = (0, react_1.useMemo)(() => {
|
|
270
|
-
const staticComps = compositions.filter((c) => {
|
|
271
|
-
return c.calculateMetadata === null;
|
|
272
|
-
});
|
|
273
|
-
return {
|
|
274
|
-
...resolvedConfigs,
|
|
275
|
-
...staticComps.reduce((acc, curr) => {
|
|
276
|
-
var _a;
|
|
277
|
-
return {
|
|
278
|
-
...acc,
|
|
279
|
-
[curr.id]: {
|
|
280
|
-
type: 'success',
|
|
281
|
-
result: { ...curr, defaultProps: (_a = curr.defaultProps) !== null && _a !== void 0 ? _a : {} },
|
|
282
|
-
},
|
|
283
|
-
};
|
|
284
|
-
}, {}),
|
|
285
|
-
};
|
|
286
|
-
}, [compositions, resolvedConfigs]);
|
|
287
|
-
return ((0, jsx_runtime_1.jsx)(exports.ResolveCompositionContext.Provider, { value: resolvedConfigsIncludingStaticOnes, children: children }));
|
|
288
|
-
};
|
|
289
|
-
exports.ResolveCompositionConfigInStudio = ResolveCompositionConfigInStudio;
|
|
290
19
|
const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
291
20
|
const context = (0, react_1.useContext)(exports.ResolveCompositionContext);
|
|
292
21
|
const { props: allEditorProps } = (0, react_1.useContext)(EditorProps_js_1.EditorPropsContext);
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ export declare const Internals: {
|
|
|
80
80
|
readonly videoEnabled: boolean;
|
|
81
81
|
readonly audioEnabled: boolean;
|
|
82
82
|
readonly frameState: Record<string, number> | null;
|
|
83
|
+
readonly nonceContextSeed: number;
|
|
83
84
|
}>;
|
|
84
85
|
readonly CompositionManagerProvider: ({ children, onlyRenderComposition, currentCompositionMetadata, initialCompositions, initialCanvasContent, }: {
|
|
85
86
|
readonly children: React.ReactNode;
|
|
@@ -194,7 +195,6 @@ export declare const Internals: {
|
|
|
194
195
|
readonly EditorPropsContext: import("react").Context<import("./EditorProps.js").EditorPropsContextType>;
|
|
195
196
|
readonly usePreload: (src: string) => string;
|
|
196
197
|
readonly NonceContext: import("react").Context<import("./nonce.js").TNonceContext>;
|
|
197
|
-
readonly SetNonceContext: import("react").Context<import("./nonce.js").TSetNonceContext>;
|
|
198
198
|
readonly resolveVideoConfig: ({ calculateMetadata, signal, defaultProps, inputProps: originalProps, compositionId, compositionDurationInFrames, compositionFps, compositionHeight, compositionWidth, }: {
|
|
199
199
|
compositionId: string;
|
|
200
200
|
compositionWidth: number | null;
|
|
@@ -206,6 +206,37 @@ export declare const Internals: {
|
|
|
206
206
|
defaultProps: Record<string, unknown>;
|
|
207
207
|
inputProps: Record<string, unknown>;
|
|
208
208
|
}) => import("./video-config.js").VideoConfig | Promise<import("./video-config.js").VideoConfig>;
|
|
209
|
+
readonly resolveVideoConfigOrCatch: (params: {
|
|
210
|
+
compositionId: string;
|
|
211
|
+
compositionWidth: number | null;
|
|
212
|
+
compositionHeight: number | null;
|
|
213
|
+
compositionFps: number | null;
|
|
214
|
+
compositionDurationInFrames: number | null;
|
|
215
|
+
calculateMetadata: import("./Composition.js").CalculateMetadataFunction<import("./props-if-has-props.js").InferProps<import("zod").AnyZodObject, Record<string, unknown>>> | null;
|
|
216
|
+
signal: AbortSignal;
|
|
217
|
+
defaultProps: Record<string, unknown>;
|
|
218
|
+
inputProps: Record<string, unknown>;
|
|
219
|
+
}) => {
|
|
220
|
+
type: "success";
|
|
221
|
+
result: import("./video-config.js").VideoConfig | Promise<import("./video-config.js").VideoConfig>;
|
|
222
|
+
} | {
|
|
223
|
+
type: "error";
|
|
224
|
+
error: Error;
|
|
225
|
+
};
|
|
226
|
+
readonly ResolveCompositionContext: import("react").Context<{
|
|
227
|
+
[x: string]: ({
|
|
228
|
+
type: "loading";
|
|
229
|
+
} | {
|
|
230
|
+
type: "success";
|
|
231
|
+
result: import("./video-config.js").VideoConfig;
|
|
232
|
+
} | {
|
|
233
|
+
type: "success-and-refreshing";
|
|
234
|
+
result: import("./video-config.js").VideoConfig;
|
|
235
|
+
} | {
|
|
236
|
+
type: "error";
|
|
237
|
+
error: Error;
|
|
238
|
+
}) | undefined;
|
|
239
|
+
} | null>;
|
|
209
240
|
readonly useResolvedVideoConfig: (preferredCompositionId: string | null) => ({
|
|
210
241
|
type: "loading";
|
|
211
242
|
} | {
|
|
@@ -222,9 +253,6 @@ export declare const Internals: {
|
|
|
222
253
|
setCurrentRenderModalComposition: (compositionId: string | null) => void;
|
|
223
254
|
reloadCurrentlySelectedComposition: () => void;
|
|
224
255
|
} | null>;
|
|
225
|
-
readonly ResolveCompositionConfigInStudio: import("react").FC<import("react").PropsWithChildren<{
|
|
226
|
-
children: React.ReactNode;
|
|
227
|
-
}>>;
|
|
228
256
|
readonly REMOTION_STUDIO_CONTAINER_ELEMENT: "__remotion-studio-container";
|
|
229
257
|
readonly RenderAssetManager: import("react").Context<import("./RenderAssetManager.js").RenderAssetManagerContext>;
|
|
230
258
|
readonly persistCurrentFrame: (time: {
|
package/dist/cjs/internals.js
CHANGED
|
@@ -151,11 +151,11 @@ exports.Internals = {
|
|
|
151
151
|
EditorPropsContext: EditorProps_js_1.EditorPropsContext,
|
|
152
152
|
usePreload: prefetch_js_1.usePreload,
|
|
153
153
|
NonceContext: nonce_js_1.NonceContext,
|
|
154
|
-
SetNonceContext: nonce_js_1.SetNonceContext,
|
|
155
154
|
resolveVideoConfig: resolve_video_config_js_1.resolveVideoConfig,
|
|
155
|
+
resolveVideoConfigOrCatch: resolve_video_config_js_1.resolveVideoConfigOrCatch,
|
|
156
|
+
ResolveCompositionContext: ResolveCompositionConfig_js_1.ResolveCompositionContext,
|
|
156
157
|
useResolvedVideoConfig: ResolveCompositionConfig_js_1.useResolvedVideoConfig,
|
|
157
158
|
resolveCompositionsRef: ResolveCompositionConfig_js_1.resolveCompositionsRef,
|
|
158
|
-
ResolveCompositionConfigInStudio: ResolveCompositionConfig_js_1.ResolveCompositionConfigInStudio,
|
|
159
159
|
REMOTION_STUDIO_CONTAINER_ELEMENT: get_preview_dom_element_js_1.REMOTION_STUDIO_CONTAINER_ELEMENT,
|
|
160
160
|
RenderAssetManager: RenderAssetManager_js_1.RenderAssetManager,
|
|
161
161
|
persistCurrentFrame: timeline_position_state_js_1.persistCurrentFrame,
|
package/dist/cjs/nonce.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
export type TNonceContext = {
|
|
2
2
|
getNonce: () => number;
|
|
3
|
-
fastRefreshes: number;
|
|
4
|
-
manualRefreshes: number;
|
|
5
|
-
};
|
|
6
|
-
export type TSetNonceContext = {
|
|
7
|
-
increaseManualRefreshes: () => void;
|
|
8
3
|
};
|
|
9
4
|
export declare const NonceContext: import("react").Context<TNonceContext>;
|
|
10
|
-
export declare const SetNonceContext: import("react").Context<TSetNonceContext>;
|
|
11
5
|
export declare const useNonce: () => number;
|
package/dist/cjs/nonce.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useNonce = exports.
|
|
3
|
+
exports.useNonce = exports.NonceContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
exports.NonceContext = (0, react_1.createContext)({
|
|
6
6
|
getNonce: () => 0,
|
|
7
|
-
fastRefreshes: 0,
|
|
8
|
-
manualRefreshes: 0,
|
|
9
|
-
});
|
|
10
|
-
exports.SetNonceContext = (0, react_1.createContext)({
|
|
11
|
-
increaseManualRefreshes: () => { },
|
|
12
7
|
});
|
|
13
8
|
const useNonce = () => {
|
|
14
9
|
const context = (0, react_1.useContext)(exports.NonceContext);
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED