remotion 4.0.478 → 4.0.481
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/CompositionManager.d.ts +3 -2
- package/dist/cjs/HtmlInCanvas.d.ts +4 -3
- package/dist/cjs/HtmlInCanvas.js +8 -10
- package/dist/cjs/Img.d.ts +6 -4
- package/dist/cjs/Img.js +11 -13
- package/dist/cjs/Interactive.d.ts +188 -2
- package/dist/cjs/Interactive.js +13 -10
- package/dist/cjs/Sequence.d.ts +4 -3
- package/dist/cjs/Sequence.js +9 -7
- package/dist/cjs/animated-image/AnimatedImage.d.ts +2 -3
- package/dist/cjs/animated-image/AnimatedImage.js +8 -10
- package/dist/cjs/animated-image/props.d.ts +2 -3
- package/dist/cjs/canvas-image/CanvasImage.d.ts +5 -3
- package/dist/cjs/canvas-image/CanvasImage.js +87 -42
- package/dist/cjs/canvas-image/props.d.ts +5 -4
- package/dist/cjs/effects/Solid.d.ts +2 -2
- package/dist/cjs/effects/Solid.js +8 -10
- package/dist/cjs/effects/create-effect.d.ts +2 -2
- package/dist/cjs/effects/effect-types.d.ts +2 -2
- package/dist/cjs/effects/index.d.ts +2 -1
- package/dist/cjs/effects/index.js +3 -0
- package/dist/cjs/find-props-to-delete.d.ts +2 -2
- package/dist/cjs/flatten-schema.d.ts +3 -3
- package/dist/cjs/index.d.ts +4 -4
- package/dist/cjs/index.js +16 -14
- package/dist/cjs/interactivity-schema.d.ts +524 -0
- package/dist/cjs/interactivity-schema.js +143 -0
- package/dist/cjs/internals.d.ts +95 -21
- package/dist/cjs/internals.js +12 -11
- package/dist/cjs/interpolate-keyframed-status.js +14 -3
- package/dist/cjs/no-react.d.ts +11 -12
- package/dist/cjs/no-react.js +2 -2
- package/dist/cjs/series/index.js +5 -4
- package/dist/cjs/use-schema.d.ts +21 -3
- package/dist/cjs/use-schema.js +5 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/with-interactivity-schema.d.ts +21 -0
- package/dist/cjs/with-interactivity-schema.js +204 -0
- package/dist/cjs/wrap-in-schema.d.ts +3 -3
- package/dist/cjs/wrap-in-schema.js +2 -2
- package/dist/esm/index.mjs +234 -166
- package/dist/esm/no-react.mjs +133 -131
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ImageFit } from '../calculate-image-fit.js';
|
|
2
2
|
import type { EffectsProp } from '../effects/effect-types.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { InteractiveBaseProps } from '../Interactive.js';
|
|
4
4
|
export type RemotionAnimatedImageLoopBehavior = 'loop' | 'pause-after-finish' | 'clear-after-finish';
|
|
5
5
|
export type RemotionAnimatedImageProps = {
|
|
6
6
|
src: string;
|
|
@@ -15,8 +15,7 @@ export type RemotionAnimatedImageProps = {
|
|
|
15
15
|
className?: string;
|
|
16
16
|
requestInit?: RequestInit;
|
|
17
17
|
};
|
|
18
|
-
export type AnimatedImageProps =
|
|
19
|
-
readonly durationInFrames?: number;
|
|
18
|
+
export type AnimatedImageProps = InteractiveBaseProps & RemotionAnimatedImageProps & {
|
|
20
19
|
readonly effects?: EffectsProp;
|
|
21
20
|
};
|
|
22
21
|
export type AnimatedImageFillMode = ImageFit;
|
|
@@ -55,6 +55,9 @@ export declare const canvasImageSchema: {
|
|
|
55
55
|
readonly step: 1;
|
|
56
56
|
readonly hiddenFromList: true;
|
|
57
57
|
};
|
|
58
|
+
readonly hidden: import("../interactivity-schema.js").BooleanFieldSchema;
|
|
59
|
+
readonly name: import("../interactivity-schema.js").HiddenFieldSchema;
|
|
60
|
+
readonly showInTimeline: import("../interactivity-schema.js").HiddenFieldSchema;
|
|
58
61
|
readonly fit: {
|
|
59
62
|
readonly type: "enum";
|
|
60
63
|
readonly default: "fill";
|
|
@@ -65,9 +68,8 @@ export declare const canvasImageSchema: {
|
|
|
65
68
|
readonly cover: {};
|
|
66
69
|
};
|
|
67
70
|
};
|
|
68
|
-
readonly hidden: import("../sequence-field-schema.js").SequenceFieldSchema;
|
|
69
71
|
};
|
|
70
|
-
export declare const CanvasImage: import("react").ComponentType<
|
|
72
|
+
export declare const CanvasImage: import("react").ComponentType<import("../Interactive.js").InteractiveBaseProps & {
|
|
71
73
|
readonly stack?: string | undefined;
|
|
72
74
|
} & CanvasImageCanvasProps & {
|
|
73
75
|
readonly src: string;
|
|
@@ -84,5 +86,5 @@ export declare const CanvasImage: import("react").ComponentType<Pick<import("../
|
|
|
84
86
|
readonly delayRenderRetries?: number | undefined;
|
|
85
87
|
readonly delayRenderTimeoutInMilliseconds?: number | undefined;
|
|
86
88
|
readonly _remotionInternalDocumentationLink?: string | undefined;
|
|
87
|
-
readonly
|
|
89
|
+
readonly outlineRef?: RefObject<HTMLElement | null> | null | undefined;
|
|
88
90
|
} & import("react").RefAttributes<HTMLCanvasElement>>;
|
|
@@ -8,18 +8,16 @@ const run_effect_chain_js_1 = require("../effects/run-effect-chain.js");
|
|
|
8
8
|
const use_effect_chain_state_js_1 = require("../effects/use-effect-chain-state.js");
|
|
9
9
|
const use_memoized_effects_js_1 = require("../effects/use-memoized-effects.js");
|
|
10
10
|
const enable_sequence_stack_traces_js_1 = require("../enable-sequence-stack-traces.js");
|
|
11
|
+
const interactivity_schema_js_1 = require("../interactivity-schema.js");
|
|
11
12
|
const prefetch_js_1 = require("../prefetch.js");
|
|
12
|
-
const sequence_field_schema_js_1 = require("../sequence-field-schema.js");
|
|
13
13
|
const Sequence_js_1 = require("../Sequence.js");
|
|
14
14
|
const SequenceContext_js_1 = require("../SequenceContext.js");
|
|
15
15
|
const truncate_src_for_label_js_1 = require("../truncate-src-for-label.js");
|
|
16
16
|
const use_buffer_state_js_1 = require("../use-buffer-state.js");
|
|
17
17
|
const use_delay_render_js_1 = require("../use-delay-render.js");
|
|
18
|
-
const
|
|
18
|
+
const with_interactivity_schema_js_1 = require("../with-interactivity-schema.js");
|
|
19
19
|
exports.canvasImageSchema = {
|
|
20
|
-
|
|
21
|
-
from: sequence_field_schema_js_1.fromField,
|
|
22
|
-
freeze: sequence_field_schema_js_1.freezeField,
|
|
20
|
+
...interactivity_schema_js_1.baseSchema,
|
|
23
21
|
fit: {
|
|
24
22
|
type: 'enum',
|
|
25
23
|
default: 'fill',
|
|
@@ -30,8 +28,7 @@ exports.canvasImageSchema = {
|
|
|
30
28
|
cover: {},
|
|
31
29
|
},
|
|
32
30
|
},
|
|
33
|
-
...
|
|
34
|
-
hidden: sequence_field_schema_js_1.hiddenField,
|
|
31
|
+
...interactivity_schema_js_1.transformSchema,
|
|
35
32
|
};
|
|
36
33
|
const makeAbortError = () => {
|
|
37
34
|
if (typeof DOMException !== 'undefined') {
|
|
@@ -94,6 +91,7 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
94
91
|
const { delayRender, continueRender, cancelRender } = (0, use_delay_render_js_1.useDelayRender)();
|
|
95
92
|
const { delayPlayback } = (0, use_buffer_state_js_1.useBufferState)();
|
|
96
93
|
const [outputCanvas, setOutputCanvas] = (0, react_1.useState)(null);
|
|
94
|
+
const [loadedImage, setLoadedImage] = (0, react_1.useState)(null);
|
|
97
95
|
const actualSrc = (0, prefetch_js_1.usePreload)(src);
|
|
98
96
|
const chainState = (0, use_effect_chain_state_js_1.useEffectChainState)();
|
|
99
97
|
const memoizedEffects = (0, use_memoized_effects_js_1.useMemoizedEffects)({
|
|
@@ -120,9 +118,6 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
120
118
|
}
|
|
121
119
|
}, [ref, refForOutline]);
|
|
122
120
|
(0, react_1.useEffect)(() => {
|
|
123
|
-
if (!outputCanvas || !sourceCanvas) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
121
|
const isPremounting = Boolean(sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.premounting);
|
|
127
122
|
const isPostmounting = Boolean(sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.postmounting);
|
|
128
123
|
const handle = delayRender(`Rendering <CanvasImage> with src="${(0, truncate_src_for_label_js_1.truncateSrcForLabel)(actualSrc)}"`, {
|
|
@@ -137,6 +132,7 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
137
132
|
let continued = false;
|
|
138
133
|
let errorCount = 0;
|
|
139
134
|
let timeoutId = null;
|
|
135
|
+
setLoadedImage(null);
|
|
140
136
|
const continueRenderOnce = () => {
|
|
141
137
|
if (continued) {
|
|
142
138
|
return;
|
|
@@ -151,31 +147,10 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
151
147
|
if (cancelled) {
|
|
152
148
|
return;
|
|
153
149
|
}
|
|
154
|
-
|
|
155
|
-
const canvasHeight = height !== null && height !== void 0 ? height : image.height;
|
|
156
|
-
const sourceContext = sourceCanvas.getContext('2d', {
|
|
157
|
-
colorSpace: 'srgb',
|
|
158
|
-
});
|
|
159
|
-
if (!sourceContext) {
|
|
160
|
-
throw new Error('Could not get 2D context for <CanvasImage> source canvas');
|
|
161
|
-
}
|
|
162
|
-
sourceCanvas.width = canvasWidth;
|
|
163
|
-
sourceCanvas.height = canvasHeight;
|
|
164
|
-
outputCanvas.width = canvasWidth;
|
|
165
|
-
outputCanvas.height = canvasHeight;
|
|
166
|
-
sourceContext.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
167
|
-
sourceContext.drawImage(image.element, ...(0, calculate_image_fit_js_1.calculateImageFit)(fit, { width: image.width, height: image.height }, { width: canvasWidth, height: canvasHeight }));
|
|
168
|
-
return (0, run_effect_chain_js_1.runEffectChain)({
|
|
169
|
-
state: chainState.get(canvasWidth, canvasHeight),
|
|
170
|
-
source: sourceCanvas,
|
|
171
|
-
effects: memoizedEffects,
|
|
172
|
-
output: outputCanvas,
|
|
173
|
-
width: canvasWidth,
|
|
174
|
-
height: canvasHeight,
|
|
175
|
-
});
|
|
150
|
+
setLoadedImage(image);
|
|
176
151
|
})
|
|
177
|
-
.then((
|
|
178
|
-
if (
|
|
152
|
+
.then(() => {
|
|
153
|
+
if (!cancelled) {
|
|
179
154
|
continueRenderOnce();
|
|
180
155
|
}
|
|
181
156
|
})
|
|
@@ -216,28 +191,97 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
216
191
|
}, [
|
|
217
192
|
actualSrc,
|
|
218
193
|
cancelRender,
|
|
219
|
-
chainState,
|
|
220
194
|
continueRender,
|
|
221
195
|
delayPlayback,
|
|
222
196
|
delayRender,
|
|
223
197
|
delayRenderRetries,
|
|
224
198
|
delayRenderTimeoutInMilliseconds,
|
|
225
|
-
fit,
|
|
226
|
-
height,
|
|
227
199
|
maxRetries,
|
|
228
|
-
memoizedEffects,
|
|
229
200
|
onError,
|
|
230
|
-
outputCanvas,
|
|
231
201
|
pauseWhenLoading,
|
|
232
202
|
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.postmounting,
|
|
233
203
|
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.premounting,
|
|
204
|
+
]);
|
|
205
|
+
(0, react_1.useEffect)(() => {
|
|
206
|
+
if (!loadedImage || !outputCanvas || !sourceCanvas) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
const handle = delayRender(`Applying effects to <CanvasImage> with src="${(0, truncate_src_for_label_js_1.truncateSrcForLabel)(actualSrc)}"`);
|
|
210
|
+
let cancelled = false;
|
|
211
|
+
let continued = false;
|
|
212
|
+
const continueRenderOnce = () => {
|
|
213
|
+
if (continued) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
continued = true;
|
|
217
|
+
continueRender(handle);
|
|
218
|
+
};
|
|
219
|
+
const canvasWidth = width !== null && width !== void 0 ? width : loadedImage.width;
|
|
220
|
+
const canvasHeight = height !== null && height !== void 0 ? height : loadedImage.height;
|
|
221
|
+
const sourceContext = sourceCanvas.getContext('2d', {
|
|
222
|
+
colorSpace: 'srgb',
|
|
223
|
+
});
|
|
224
|
+
if (!sourceContext) {
|
|
225
|
+
cancelRender(new Error('Could not get 2D context for <CanvasImage> source canvas'));
|
|
226
|
+
continueRenderOnce();
|
|
227
|
+
return () => {
|
|
228
|
+
continueRenderOnce();
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
sourceCanvas.width = canvasWidth;
|
|
232
|
+
sourceCanvas.height = canvasHeight;
|
|
233
|
+
outputCanvas.width = canvasWidth;
|
|
234
|
+
outputCanvas.height = canvasHeight;
|
|
235
|
+
sourceContext.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
236
|
+
sourceContext.drawImage(loadedImage.element, ...(0, calculate_image_fit_js_1.calculateImageFit)(fit, { width: loadedImage.width, height: loadedImage.height }, { width: canvasWidth, height: canvasHeight }));
|
|
237
|
+
(0, run_effect_chain_js_1.runEffectChain)({
|
|
238
|
+
state: chainState.get(canvasWidth, canvasHeight),
|
|
239
|
+
source: sourceCanvas,
|
|
240
|
+
effects: memoizedEffects,
|
|
241
|
+
output: outputCanvas,
|
|
242
|
+
width: canvasWidth,
|
|
243
|
+
height: canvasHeight,
|
|
244
|
+
})
|
|
245
|
+
.then((completed) => {
|
|
246
|
+
if (completed && !cancelled) {
|
|
247
|
+
continueRenderOnce();
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
.catch((err) => {
|
|
251
|
+
if (cancelled) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (onError) {
|
|
255
|
+
onError(err);
|
|
256
|
+
continueRenderOnce();
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
cancelRender(err);
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
return () => {
|
|
263
|
+
cancelled = true;
|
|
264
|
+
continueRenderOnce();
|
|
265
|
+
};
|
|
266
|
+
}, [
|
|
267
|
+
actualSrc,
|
|
268
|
+
cancelRender,
|
|
269
|
+
chainState,
|
|
270
|
+
continueRender,
|
|
271
|
+
delayRender,
|
|
272
|
+
fit,
|
|
273
|
+
height,
|
|
274
|
+
loadedImage,
|
|
275
|
+
memoizedEffects,
|
|
276
|
+
onError,
|
|
277
|
+
outputCanvas,
|
|
234
278
|
sourceCanvas,
|
|
235
279
|
width,
|
|
236
280
|
]);
|
|
237
281
|
return (jsx_runtime_1.jsx("canvas", { ...canvasProps, ref: canvasRef, width: width, height: height, className: className, style: style, id: id }));
|
|
238
282
|
});
|
|
239
283
|
CanvasImageContent.displayName = 'CanvasImageContent';
|
|
240
|
-
const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, effects = [], className, style, id, onError, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, durationInFrames, from, freeze, hidden, name, showInTimeline, stack,
|
|
284
|
+
const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, effects = [], className, style, id, onError, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, durationInFrames, from, freeze, hidden, name, showInTimeline, stack, controls, _remotionInternalDocumentationLink, outlineRef, ...canvasProps }, ref) => {
|
|
241
285
|
if (!src) {
|
|
242
286
|
throw new Error('No "src" prop was passed to <CanvasImage>.');
|
|
243
287
|
}
|
|
@@ -246,14 +290,15 @@ const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, eff
|
|
|
246
290
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
247
291
|
return actualRef.current;
|
|
248
292
|
}, []);
|
|
249
|
-
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, name: name !== null && name !== void 0 ? name : '<CanvasImage>', _remotionInternalDocumentationLink: _remotionInternalDocumentationLink !== null && _remotionInternalDocumentationLink !== void 0 ? _remotionInternalDocumentationLink : 'https://www.remotion.dev/docs/canvasimage',
|
|
293
|
+
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, name: name !== null && name !== void 0 ? name : '<CanvasImage>', _remotionInternalDocumentationLink: _remotionInternalDocumentationLink !== null && _remotionInternalDocumentationLink !== void 0 ? _remotionInternalDocumentationLink : 'https://www.remotion.dev/docs/canvasimage', controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, _remotionInternalIsMedia: { type: 'image', src }, _remotionInternalStack: stack, outlineRef: outlineRef !== null && outlineRef !== void 0 ? outlineRef : actualRef, children: jsx_runtime_1.jsx(CanvasImageContent, { ref: actualRef, src: src, width: width, height: height, fit: fit, effects: effects, controls: controls, className: className, style: style, id: id, onError: onError, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, refForOutline: outlineRef !== null && outlineRef !== void 0 ? outlineRef : null, ...canvasProps }) }));
|
|
250
294
|
});
|
|
251
295
|
/*
|
|
252
296
|
* @description Renders a static image to a `<canvas>` and applies Remotion effects.
|
|
253
297
|
* @see [Documentation](https://www.remotion.dev/docs/canvasimage)
|
|
254
298
|
*/
|
|
255
|
-
exports.CanvasImage = (0,
|
|
299
|
+
exports.CanvasImage = (0, with_interactivity_schema_js_1.withInteractivitySchema)({
|
|
256
300
|
Component: CanvasImageInner,
|
|
301
|
+
componentName: '<CanvasImage>',
|
|
257
302
|
componentIdentity: 'dev.remotion.remotion.CanvasImage',
|
|
258
303
|
schema: exports.canvasImageSchema,
|
|
259
304
|
supportsEffects: true,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { ImageFit } from '../calculate-image-fit.js';
|
|
3
3
|
import type { EffectsProp } from '../effects/effect-types.js';
|
|
4
|
-
import type {
|
|
5
|
-
type CanvasImageSequenceProps =
|
|
4
|
+
import type { InteractiveBaseProps } from '../Interactive.js';
|
|
5
|
+
type CanvasImageSequenceProps = InteractiveBaseProps & {
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated For internal use only.
|
|
8
8
|
*/
|
|
@@ -28,8 +28,9 @@ export type CanvasImageProps = CanvasImageSequenceProps & CanvasImageCanvasProps
|
|
|
28
28
|
*/
|
|
29
29
|
readonly _remotionInternalDocumentationLink?: string;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* A React ref pointing to the element that Remotion Studio should use for
|
|
32
|
+
* drawing the selection outline in the preview.
|
|
32
33
|
*/
|
|
33
|
-
readonly
|
|
34
|
+
readonly outlineRef?: React.RefObject<HTMLElement | null> | null;
|
|
34
35
|
};
|
|
35
36
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { InteractiveBaseProps } from '../Interactive.js';
|
|
3
3
|
import type { EffectsProp } from './effect-types.js';
|
|
4
4
|
type MandatoryProps = {
|
|
5
5
|
readonly width: number;
|
|
@@ -13,5 +13,5 @@ type OptionalProps = {
|
|
|
13
13
|
readonly pixelDensity: number | undefined;
|
|
14
14
|
};
|
|
15
15
|
export type SolidProps = MandatoryProps & Partial<OptionalProps>;
|
|
16
|
-
export declare const Solid: React.ComponentType<MandatoryProps & Partial<OptionalProps> &
|
|
16
|
+
export declare const Solid: React.ComponentType<MandatoryProps & Partial<OptionalProps> & InteractiveBaseProps & React.RefAttributes<HTMLCanvasElement>>;
|
|
17
17
|
export {};
|
|
@@ -4,10 +4,10 @@ exports.Solid = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const enable_sequence_stack_traces_js_1 = require("../enable-sequence-stack-traces.js");
|
|
7
|
-
const
|
|
7
|
+
const interactivity_schema_js_1 = require("../interactivity-schema.js");
|
|
8
8
|
const Sequence_js_1 = require("../Sequence.js");
|
|
9
9
|
const use_delay_render_js_1 = require("../use-delay-render.js");
|
|
10
|
-
const
|
|
10
|
+
const with_interactivity_schema_js_1 = require("../with-interactivity-schema.js");
|
|
11
11
|
const run_effect_chain_js_1 = require("./run-effect-chain.js");
|
|
12
12
|
const use_effect_chain_state_js_1 = require("./use-effect-chain-state.js");
|
|
13
13
|
const use_memoized_effects_js_1 = require("./use-memoized-effects.js");
|
|
@@ -23,9 +23,7 @@ const resolveSolidPixelDensity = (pixelDensity) => {
|
|
|
23
23
|
return pixelDensity;
|
|
24
24
|
};
|
|
25
25
|
const solidSchema = {
|
|
26
|
-
|
|
27
|
-
from: sequence_field_schema_js_1.fromField,
|
|
28
|
-
freeze: sequence_field_schema_js_1.freezeField,
|
|
26
|
+
...interactivity_schema_js_1.baseSchema,
|
|
29
27
|
color: {
|
|
30
28
|
type: 'color',
|
|
31
29
|
default: 'transparent',
|
|
@@ -47,8 +45,7 @@ const solidSchema = {
|
|
|
47
45
|
description: 'Height',
|
|
48
46
|
hiddenFromList: false,
|
|
49
47
|
},
|
|
50
|
-
...
|
|
51
|
-
hidden: sequence_field_schema_js_1.hiddenField,
|
|
48
|
+
...interactivity_schema_js_1.transformSchema,
|
|
52
49
|
};
|
|
53
50
|
const SolidInner = ({ color, width, height, effects = [], className, style, pixelDensity, overrideId, reference, }) => {
|
|
54
51
|
const { delayRender, continueRender, cancelRender } = (0, use_delay_render_js_1.useDelayRender)();
|
|
@@ -141,7 +138,7 @@ const SolidInner = ({ color, width, height, effects = [], className, style, pixe
|
|
|
141
138
|
}, [height, style, width]);
|
|
142
139
|
return (jsx_runtime_1.jsx("canvas", { ref: canvasRef, width: canvasWidth, height: canvasHeight, className: className, style: canvasStyle }));
|
|
143
140
|
};
|
|
144
|
-
const SolidOuter = (0, react_1.forwardRef)(({ effects = [],
|
|
141
|
+
const SolidOuter = (0, react_1.forwardRef)(({ effects = [], controls, color, height, width, className, durationInFrames, style, name, from, freeze, hidden, showInTimeline, pixelDensity, ...props }, ref) => {
|
|
145
142
|
var _a;
|
|
146
143
|
props;
|
|
147
144
|
const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(effects);
|
|
@@ -149,10 +146,11 @@ const SolidOuter = (0, react_1.forwardRef)(({ effects = [], _experimentalControl
|
|
|
149
146
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
150
147
|
return actualRef.current;
|
|
151
148
|
}, []);
|
|
152
|
-
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline,
|
|
149
|
+
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : '<Solid>', outlineRef: actualRef, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/solid", ...props, children: jsx_runtime_1.jsx(SolidInner, { reference: actualRef, overrideId: (_a = controls === null || controls === void 0 ? void 0 : controls.overrideId) !== null && _a !== void 0 ? _a : null, color: color, height: height, width: width, className: className, style: style, effects: effects, pixelDensity: pixelDensity }) }));
|
|
153
150
|
});
|
|
154
|
-
exports.Solid = (0,
|
|
151
|
+
exports.Solid = (0, with_interactivity_schema_js_1.withInteractivitySchema)({
|
|
155
152
|
Component: SolidOuter,
|
|
153
|
+
componentName: '<Solid>',
|
|
156
154
|
componentIdentity: 'dev.remotion.remotion.Solid',
|
|
157
155
|
schema: solidSchema,
|
|
158
156
|
supportsEffects: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InteractivitySchemaField } from '../interactivity-schema.js';
|
|
2
2
|
import type { EffectDefinition, EffectFactory } from './effect-types.js';
|
|
3
|
-
export declare const disabledEffectField:
|
|
3
|
+
export declare const disabledEffectField: InteractivitySchemaField;
|
|
4
4
|
export declare const createEffect: <P, S>(definition: EffectDefinition<P, S>) => EffectFactory<P>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InteractivitySchema } from '../interactivity-schema.js';
|
|
2
2
|
export type Backend = '2d' | 'webgl2' | 'webgpu';
|
|
3
3
|
type AnyGpuDevice = unknown;
|
|
4
4
|
export type EffectApplyParams<P, S> = {
|
|
@@ -31,7 +31,7 @@ export type EffectDefinition<P, S = unknown> = {
|
|
|
31
31
|
readonly setup: (target: HTMLCanvasElement) => S;
|
|
32
32
|
readonly apply: (params: EffectApplyParams<P, S>) => void;
|
|
33
33
|
readonly cleanup: (state: S) => void;
|
|
34
|
-
readonly schema:
|
|
34
|
+
readonly schema: InteractivitySchema;
|
|
35
35
|
/** Throws when mandatory params are missing or invalid. Called by `createEffect` before returning a descriptor. */
|
|
36
36
|
readonly validateParams: (params: P) => void;
|
|
37
37
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { createEffect } from './create-effect.js';
|
|
2
|
+
export type { Backend, EffectApplyParams, EffectDefinitionAndStack, EffectDescriptor, EffectsProp, EffectDefinition, EffectFactory, } from './effect-types.js';
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createEffect = void 0;
|
|
4
|
+
const create_effect_js_1 = require("./create-effect.js");
|
|
5
|
+
Object.defineProperty(exports, "createEffect", { enumerable: true, get: function () { return create_effect_js_1.createEffect; } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InteractivitySchema } from './internals';
|
|
2
2
|
export declare const findPropsToDelete: ({ schema, key, value, }: {
|
|
3
|
-
schema:
|
|
3
|
+
schema: InteractivitySchema;
|
|
4
4
|
key: string;
|
|
5
5
|
value: unknown;
|
|
6
6
|
}) => string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InteractivitySchema } from './interactivity-schema';
|
|
2
2
|
export type ResolveValue = (key: string) => unknown;
|
|
3
|
-
export declare const flattenActiveSchema: (schema:
|
|
4
|
-
export declare const getFlatSchemaWithAllKeys: (schema:
|
|
3
|
+
export declare const flattenActiveSchema: (schema: InteractivitySchema, resolve: ResolveValue) => InteractivitySchema;
|
|
4
|
+
export declare const getFlatSchemaWithAllKeys: (schema: InteractivitySchema) => InteractivitySchema;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import type { AnyCompMetadata, AnyComposition, AudioOrVideoAsset, JsxComponentId
|
|
|
5
5
|
import type { DelayRenderScope } from './delay-render.js';
|
|
6
6
|
import { type TFolder } from './Folder.js';
|
|
7
7
|
import type { StaticFile } from './get-static-files.js';
|
|
8
|
+
import type { ArrayFieldSchema, ArrayItemFieldSchema, InteractivitySchemaField, InteractivitySchema } from './interactivity-schema.js';
|
|
8
9
|
import type { LogLevel } from './log.js';
|
|
9
10
|
import type { ProResProfile } from './prores-profile.js';
|
|
10
11
|
import type { PixelFormat, VideoImageFormat } from './render-types.js';
|
|
11
|
-
import type { ArrayFieldSchema, ArrayItemFieldSchema, SequenceFieldSchema, SequenceSchema } from './sequence-field-schema.js';
|
|
12
12
|
import type { UseBufferState } from './use-buffer-state';
|
|
13
13
|
import type { VideoConfig } from './video-config.js';
|
|
14
14
|
export type VideoConfigWithSerializedProps = Omit<VideoConfig, 'defaultProps' | 'props'> & {
|
|
@@ -94,7 +94,7 @@ export type BundleEvaluationState = {
|
|
|
94
94
|
export type BundleState = BundleIndexState | BundleEvaluationState | BundleCompositionState;
|
|
95
95
|
export * from './AbsoluteFill.js';
|
|
96
96
|
export * from './animated-image/index.js';
|
|
97
|
-
export type
|
|
97
|
+
export { createEffect, type Backend, type EffectApplyParams, type EffectDefinition, type EffectDefinitionAndStack, type EffectDescriptor, type EffectFactory, type EffectsProp, } from './effects/index.js';
|
|
98
98
|
/**
|
|
99
99
|
* @description Renders a solid-color rectangle on a `<canvas>`.
|
|
100
100
|
* @see [Documentation](https://www.remotion.dev/docs/solid)
|
|
@@ -127,7 +127,7 @@ export { getRemotionEnvironment } from './get-remotion-environment.js';
|
|
|
127
127
|
export { getStaticFiles, StaticFile } from './get-static-files.js';
|
|
128
128
|
export * from './IFrame.js';
|
|
129
129
|
export { Img, ImgProps } from './Img.js';
|
|
130
|
-
export { Interactive, type InteractiveProps } from './Interactive.js';
|
|
130
|
+
export { Interactive, type InteractiveBaseProps, type InteractivePremountProps, type InteractiveProps, type InteractiveTransformProps, } from './Interactive.js';
|
|
131
131
|
export * from './internals.js';
|
|
132
132
|
export { interpolateColors, type InterpolateColorsOptions, } from './interpolate-colors.js';
|
|
133
133
|
export { LogLevel } from './log.js';
|
|
@@ -182,4 +182,4 @@ export type _InternalTypes = {
|
|
|
182
182
|
TRenderAsset: TRenderAsset;
|
|
183
183
|
ProResProfile: ProResProfile;
|
|
184
184
|
};
|
|
185
|
-
export type { AnyComposition, ArrayFieldSchema, ArrayItemFieldSchema, DelayRenderScope, JsxComponentIdentity, LoopDisplay, SequenceControls,
|
|
185
|
+
export type { AnyComposition, ArrayFieldSchema, ArrayItemFieldSchema, DelayRenderScope, JsxComponentIdentity, LoopDisplay, SequenceControls, InteractivitySchemaField, InteractivitySchema, UseBufferState, };
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Config = exports.Experimental = exports.watchStaticFile = exports.MediaPlaybackError = exports.Video = exports.OffthreadVideo = exports.Html5Video = exports.useRemotionEnvironment = exports.usePixelDensity = exports.useDelayRender = exports.useCurrentScale = exports.useCurrentFrame = exports.useBufferState = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.prefetch = exports.random = exports.interpolate = exports.assertValidInterpolatePosterizeOption = exports.assertValidInterpolateEasingOption = exports.Loop = exports.interpolateColors = exports.Interactive = exports.Img = exports.getStaticFiles = exports.getRemotionEnvironment = exports.delayRender = exports.continueRender = exports.getInputProps = exports.Composition = exports.CanvasImage = exports.isHtmlInCanvasSupported = exports.HtmlInCanvas = exports.HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = exports.Solid = exports.cancelRender = exports.Html5Audio = exports.Audio = exports.Artifact = void 0;
|
|
17
|
+
exports.Config = exports.Experimental = exports.watchStaticFile = exports.MediaPlaybackError = exports.Video = exports.OffthreadVideo = exports.Html5Video = exports.useRemotionEnvironment = exports.usePixelDensity = exports.useDelayRender = exports.useCurrentScale = exports.useCurrentFrame = exports.useBufferState = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.prefetch = exports.random = exports.interpolate = exports.assertValidInterpolatePosterizeOption = exports.assertValidInterpolateEasingOption = exports.Loop = exports.interpolateColors = exports.Interactive = exports.Img = exports.getStaticFiles = exports.getRemotionEnvironment = exports.delayRender = exports.continueRender = exports.getInputProps = exports.Composition = exports.CanvasImage = exports.isHtmlInCanvasSupported = exports.HtmlInCanvas = exports.HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = exports.Solid = exports.cancelRender = exports.Html5Audio = exports.Audio = exports.Artifact = exports.createEffect = void 0;
|
|
18
18
|
require("./_check-rsc.js");
|
|
19
19
|
require("./asset-types.js");
|
|
20
20
|
const Clipper_js_1 = require("./Clipper.js");
|
|
@@ -28,11 +28,13 @@ const Sequence_js_1 = require("./Sequence.js");
|
|
|
28
28
|
(0, multiple_versions_warning_js_1.checkMultipleRemotionVersions)();
|
|
29
29
|
__exportStar(require("./AbsoluteFill.js"), exports);
|
|
30
30
|
__exportStar(require("./animated-image/index.js"), exports);
|
|
31
|
+
const index_js_1 = require("./effects/index.js");
|
|
32
|
+
Object.defineProperty(exports, "createEffect", { enumerable: true, get: function () { return index_js_1.createEffect; } });
|
|
31
33
|
const Artifact_js_1 = require("./Artifact.js");
|
|
32
34
|
Object.defineProperty(exports, "Artifact", { enumerable: true, get: function () { return Artifact_js_1.Artifact; } });
|
|
33
|
-
const
|
|
34
|
-
Object.defineProperty(exports, "Audio", { enumerable: true, get: function () { return
|
|
35
|
-
Object.defineProperty(exports, "Html5Audio", { enumerable: true, get: function () { return
|
|
35
|
+
const index_js_2 = require("./audio/index.js");
|
|
36
|
+
Object.defineProperty(exports, "Audio", { enumerable: true, get: function () { return index_js_2.Audio; } });
|
|
37
|
+
Object.defineProperty(exports, "Html5Audio", { enumerable: true, get: function () { return index_js_2.Html5Audio; } });
|
|
36
38
|
const cancel_render_js_1 = require("./cancel-render.js");
|
|
37
39
|
Object.defineProperty(exports, "cancelRender", { enumerable: true, get: function () { return cancel_render_js_1.cancelRender; } });
|
|
38
40
|
const Solid_js_1 = require("./effects/Solid.js");
|
|
@@ -45,8 +47,8 @@ Object.defineProperty(exports, "isHtmlInCanvasSupported", { enumerable: true, ge
|
|
|
45
47
|
* @description Renders a static image to a `<canvas>` and applies Remotion effects.
|
|
46
48
|
* @see [Documentation](https://www.remotion.dev/docs/canvasimage)
|
|
47
49
|
*/
|
|
48
|
-
const
|
|
49
|
-
Object.defineProperty(exports, "CanvasImage", { enumerable: true, get: function () { return
|
|
50
|
+
const index_js_3 = require("./canvas-image/index.js");
|
|
51
|
+
Object.defineProperty(exports, "CanvasImage", { enumerable: true, get: function () { return index_js_3.CanvasImage; } });
|
|
50
52
|
const Composition_js_2 = require("./Composition.js");
|
|
51
53
|
Object.defineProperty(exports, "Composition", { enumerable: true, get: function () { return Composition_js_2.Composition; } });
|
|
52
54
|
const input_props_js_1 = require("./config/input-props.js");
|
|
@@ -69,8 +71,8 @@ Object.defineProperty(exports, "Interactive", { enumerable: true, get: function
|
|
|
69
71
|
__exportStar(require("./internals.js"), exports);
|
|
70
72
|
const interpolate_colors_js_1 = require("./interpolate-colors.js");
|
|
71
73
|
Object.defineProperty(exports, "interpolateColors", { enumerable: true, get: function () { return interpolate_colors_js_1.interpolateColors; } });
|
|
72
|
-
const
|
|
73
|
-
Object.defineProperty(exports, "Loop", { enumerable: true, get: function () { return
|
|
74
|
+
const index_js_4 = require("./loop/index.js");
|
|
75
|
+
Object.defineProperty(exports, "Loop", { enumerable: true, get: function () { return index_js_4.Loop; } });
|
|
74
76
|
const no_react_1 = require("./no-react");
|
|
75
77
|
Object.defineProperty(exports, "assertValidInterpolateEasingOption", { enumerable: true, get: function () { return no_react_1.assertValidInterpolateEasingOption; } });
|
|
76
78
|
Object.defineProperty(exports, "assertValidInterpolatePosterizeOption", { enumerable: true, get: function () { return no_react_1.assertValidInterpolatePosterizeOption; } });
|
|
@@ -82,8 +84,8 @@ const register_root_js_1 = require("./register-root.js");
|
|
|
82
84
|
Object.defineProperty(exports, "registerRoot", { enumerable: true, get: function () { return register_root_js_1.registerRoot; } });
|
|
83
85
|
const Sequence_js_2 = require("./Sequence.js");
|
|
84
86
|
Object.defineProperty(exports, "Sequence", { enumerable: true, get: function () { return Sequence_js_2.Sequence; } });
|
|
85
|
-
const
|
|
86
|
-
Object.defineProperty(exports, "Series", { enumerable: true, get: function () { return
|
|
87
|
+
const index_js_5 = require("./series/index.js");
|
|
88
|
+
Object.defineProperty(exports, "Series", { enumerable: true, get: function () { return index_js_5.Series; } });
|
|
87
89
|
__exportStar(require("./spring/index.js"), exports);
|
|
88
90
|
const static_file_js_1 = require("./static-file.js");
|
|
89
91
|
Object.defineProperty(exports, "staticFile", { enumerable: true, get: function () { return static_file_js_1.staticFile; } });
|
|
@@ -103,10 +105,10 @@ Object.defineProperty(exports, "useRemotionEnvironment", { enumerable: true, get
|
|
|
103
105
|
__exportStar(require("./use-video-config.js"), exports);
|
|
104
106
|
__exportStar(require("./version.js"), exports);
|
|
105
107
|
__exportStar(require("./video-config.js"), exports);
|
|
106
|
-
const
|
|
107
|
-
Object.defineProperty(exports, "Html5Video", { enumerable: true, get: function () { return
|
|
108
|
-
Object.defineProperty(exports, "OffthreadVideo", { enumerable: true, get: function () { return
|
|
109
|
-
Object.defineProperty(exports, "Video", { enumerable: true, get: function () { return
|
|
108
|
+
const index_js_6 = require("./video/index.js");
|
|
109
|
+
Object.defineProperty(exports, "Html5Video", { enumerable: true, get: function () { return index_js_6.Html5Video; } });
|
|
110
|
+
Object.defineProperty(exports, "OffthreadVideo", { enumerable: true, get: function () { return index_js_6.OffthreadVideo; } });
|
|
111
|
+
Object.defineProperty(exports, "Video", { enumerable: true, get: function () { return index_js_6.Video; } });
|
|
110
112
|
const MediaPlaybackError_js_1 = require("./video/MediaPlaybackError.js");
|
|
111
113
|
Object.defineProperty(exports, "MediaPlaybackError", { enumerable: true, get: function () { return MediaPlaybackError_js_1.MediaPlaybackError; } });
|
|
112
114
|
const watch_static_file_js_1 = require("./watch-static-file.js");
|