remotion 3.3.26 → 3.3.28
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/.turbo/turbo-build.log +1 -1
- package/dist/LayerMaster.d.ts +8 -0
- package/dist/LayerMaster.js +29 -0
- package/dist/audio/Audio.d.ts +1 -1
- package/dist/get-compositions-from-markup.d.ts +3 -0
- package/dist/get-compositions-from-markup.js +18 -0
- package/dist/layers.d.ts +24 -0
- package/dist/layers.js +142 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/video/video-fragment.js +9 -0
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Layer } from './layers';
|
|
3
|
+
export declare const LayerMaster: <T extends object>({ layers, defaultProps, inputProps, fallbackComponent: FallbackComponent, }: {
|
|
4
|
+
layers: Layer<T>[];
|
|
5
|
+
defaultProps: T | undefined;
|
|
6
|
+
inputProps: any;
|
|
7
|
+
fallbackComponent: React.FC | null;
|
|
8
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LayerMaster = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const AbsoluteFill_1 = require("./AbsoluteFill");
|
|
7
|
+
const LayerMaster = ({ layers, defaultProps, inputProps, fallbackComponent: FallbackComponent, }) => {
|
|
8
|
+
return (
|
|
9
|
+
// TODO: Same styles as normal
|
|
10
|
+
(0, jsx_runtime_1.jsx)(AbsoluteFill_1.AbsoluteFill, { children: layers.map((layer, i) => {
|
|
11
|
+
const Comp = layer.component;
|
|
12
|
+
if (layer.type === 'web') {
|
|
13
|
+
if (FallbackComponent === null) {
|
|
14
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
15
|
+
return (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }, String(i));
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
19
|
+
(0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(FallbackComponent, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }) }, String(i)));
|
|
20
|
+
}
|
|
21
|
+
// SVG should not support suspense
|
|
22
|
+
if (layer.type === 'svg') {
|
|
23
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
24
|
+
return (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }, String(i));
|
|
25
|
+
}
|
|
26
|
+
throw new Error('Unknown layer type');
|
|
27
|
+
}) }));
|
|
28
|
+
};
|
|
29
|
+
exports.LayerMaster = LayerMaster;
|
package/dist/audio/Audio.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.Deta
|
|
|
5
5
|
playbackRate?: number | undefined;
|
|
6
6
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
7
7
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
8
|
-
} & RemotionMainAudioProps, "id" | "
|
|
8
|
+
} & RemotionMainAudioProps, "id" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "src" | "volume" | "playbackRate" | "allowAmplificationDuringRender" | "controlsList" | "crossOrigin" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "acceptableTimeShiftInSeconds" | keyof RemotionMainAudioProps> & React.RefAttributes<HTMLAudioElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCompositionsFromMarkup = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const server_1 = require("react-dom/server");
|
|
6
|
+
const Composition_1 = require("./Composition");
|
|
7
|
+
const getCompositionsFromMarkup = (Comp) => {
|
|
8
|
+
process.env.REMOTION_SERVER_RENDERING = 'true';
|
|
9
|
+
const str = (0, server_1.renderToString)((0, jsx_runtime_1.jsx)(Composition_1.GetCompositionsFromMarkupModeProvider, { children: (0, jsx_runtime_1.jsx)(Comp, {}) }));
|
|
10
|
+
const matches = str.matchAll(/<div>(.*?)<\/div>/g);
|
|
11
|
+
const metadata = [];
|
|
12
|
+
for (const match of matches) {
|
|
13
|
+
const json = JSON.parse(match[1]);
|
|
14
|
+
metadata.push(json);
|
|
15
|
+
}
|
|
16
|
+
return metadata;
|
|
17
|
+
};
|
|
18
|
+
exports.getCompositionsFromMarkup = getCompositionsFromMarkup;
|
package/dist/layers.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComponentType, LazyExoticComponent } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare type LooseComponentType<T> = ComponentType<T> | ((props: T) => React.ReactNode);
|
|
4
|
+
export declare type InputLayer<T> = {
|
|
5
|
+
component: LooseComponentType<T>;
|
|
6
|
+
type: 'web' | 'svg';
|
|
7
|
+
};
|
|
8
|
+
export declare type CompProps<T> = {
|
|
9
|
+
lazyComponent: () => Promise<{
|
|
10
|
+
default: LooseComponentType<T>;
|
|
11
|
+
}>;
|
|
12
|
+
} | {
|
|
13
|
+
component: LooseComponentType<T>;
|
|
14
|
+
} | {
|
|
15
|
+
layers: InputLayer<T>[];
|
|
16
|
+
};
|
|
17
|
+
export declare type Layer<T> = {
|
|
18
|
+
component: LazyExoticComponent<ComponentType<T>>;
|
|
19
|
+
type: 'web' | 'svg';
|
|
20
|
+
};
|
|
21
|
+
export declare type SmallLayer = Pick<Layer<unknown>, 'type'>;
|
|
22
|
+
export declare const convertComponentTypesToLayers: <T>(compProps: CompProps<T>) => Layer<T>[];
|
|
23
|
+
export declare const convertComponentTypesToLayersWithCache: <T>(compProps: CompProps<T>, prevCompProps: CompProps<T> | null, prevReturnValue: Layer<T>[] | null) => Layer<T>[];
|
|
24
|
+
export declare const useLayers: <T>(compProps: CompProps<T>) => Layer<T>[];
|
package/dist/layers.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useLayers = exports.convertComponentTypesToLayersWithCache = exports.convertComponentTypesToLayers = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const inputLayersToLayers = (layers) => {
|
|
29
|
+
return layers.map((layer) => {
|
|
30
|
+
if (layer.type === 'web') {
|
|
31
|
+
return {
|
|
32
|
+
component: react_1.default.lazy(() => Promise.resolve({ default: layer.component })),
|
|
33
|
+
type: 'web',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
// No lazy for SVG allowed!
|
|
37
|
+
return {
|
|
38
|
+
component: layer.component,
|
|
39
|
+
type: 'svg',
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const convertComponentTypesToLayers = (compProps) => {
|
|
44
|
+
if ('component' in compProps) {
|
|
45
|
+
// In SSR, suspense is not yet supported, we cannot use React.lazy
|
|
46
|
+
if (typeof document === 'undefined') {
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
component: compProps.component,
|
|
50
|
+
type: 'web',
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
return [
|
|
55
|
+
{
|
|
56
|
+
component: react_1.default.lazy(() => Promise.resolve({ default: compProps.component })),
|
|
57
|
+
type: 'web',
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
if ('lazyComponent' in compProps) {
|
|
62
|
+
return [
|
|
63
|
+
{
|
|
64
|
+
component: react_1.default.lazy(compProps.lazyComponent),
|
|
65
|
+
type: 'web',
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
if ('layers' in compProps) {
|
|
70
|
+
return inputLayersToLayers(compProps.layers);
|
|
71
|
+
}
|
|
72
|
+
throw new Error('Unknown component type');
|
|
73
|
+
};
|
|
74
|
+
exports.convertComponentTypesToLayers = convertComponentTypesToLayers;
|
|
75
|
+
const convertComponentTypesToLayersWithCache = (compProps, prevCompProps, prevReturnValue) => {
|
|
76
|
+
if ('component' in compProps) {
|
|
77
|
+
if (prevCompProps &&
|
|
78
|
+
'component' in prevCompProps &&
|
|
79
|
+
compProps.component === prevCompProps.component &&
|
|
80
|
+
prevReturnValue) {
|
|
81
|
+
return prevReturnValue;
|
|
82
|
+
}
|
|
83
|
+
return [
|
|
84
|
+
{
|
|
85
|
+
type: 'web',
|
|
86
|
+
component: react_1.default.lazy(() => Promise.resolve({ default: compProps.component })),
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
if ('lazyComponent' in compProps) {
|
|
91
|
+
if (prevCompProps &&
|
|
92
|
+
'lazyComponent' in prevCompProps &&
|
|
93
|
+
compProps.lazyComponent === prevCompProps.lazyComponent &&
|
|
94
|
+
prevReturnValue) {
|
|
95
|
+
return prevReturnValue;
|
|
96
|
+
}
|
|
97
|
+
return [
|
|
98
|
+
{
|
|
99
|
+
type: 'web',
|
|
100
|
+
component: react_1.default.lazy(compProps.lazyComponent),
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
if ('layers' in compProps) {
|
|
105
|
+
const isTheSame = () => {
|
|
106
|
+
if (!prevCompProps) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (!('layers' in prevCompProps)) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (compProps.layers.length !== prevCompProps.layers.length) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
for (let i = 0; i < compProps.layers.length; i++) {
|
|
116
|
+
if (compProps.layers[i].component !== prevCompProps.layers[i].component) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
if (compProps.layers[i].type !== prevCompProps.layers[i].type) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return true;
|
|
124
|
+
};
|
|
125
|
+
if (isTheSame()) {
|
|
126
|
+
return prevReturnValue;
|
|
127
|
+
}
|
|
128
|
+
return inputLayersToLayers(compProps.layers);
|
|
129
|
+
}
|
|
130
|
+
throw new Error('Unknown component type');
|
|
131
|
+
};
|
|
132
|
+
exports.convertComponentTypesToLayersWithCache = convertComponentTypesToLayersWithCache;
|
|
133
|
+
const useLayers = (compProps) => {
|
|
134
|
+
var _a, _b;
|
|
135
|
+
const prevCompProps = (0, react_1.useRef)();
|
|
136
|
+
const prevLayers = (0, react_1.useRef)();
|
|
137
|
+
const layers = (0, exports.convertComponentTypesToLayersWithCache)(compProps, (_a = prevCompProps.current) !== null && _a !== void 0 ? _a : null, (_b = prevLayers.current) !== null && _b !== void 0 ? _b : null);
|
|
138
|
+
prevCompProps.current = compProps;
|
|
139
|
+
prevLayers.current = layers;
|
|
140
|
+
return layers;
|
|
141
|
+
};
|
|
142
|
+
exports.useLayers = useLayers;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.3.
|
|
1
|
+
export declare const VERSION = "3.3.28";
|
package/dist/version.js
CHANGED
|
@@ -27,8 +27,17 @@ const useAppendVideoFragment = ({ actualSrc: initialActualSrc, actualFrom: initi
|
|
|
27
27
|
return appended;
|
|
28
28
|
};
|
|
29
29
|
exports.useAppendVideoFragment = useAppendVideoFragment;
|
|
30
|
+
// https://github.com/remotion-dev/remotion/issues/1655
|
|
31
|
+
const isIOSSafariCase = (actualSrc) => {
|
|
32
|
+
return (/iP(ad|od|hone)/i.test(window.navigator.userAgent) &&
|
|
33
|
+
Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/)) &&
|
|
34
|
+
actualSrc.startsWith('blob:'));
|
|
35
|
+
};
|
|
30
36
|
const appendVideoFragment = ({ actualSrc, actualFrom, duration, fps, }) => {
|
|
31
37
|
var _a;
|
|
38
|
+
if (isIOSSafariCase(actualSrc)) {
|
|
39
|
+
return actualSrc;
|
|
40
|
+
}
|
|
32
41
|
if (actualSrc.startsWith('data:')) {
|
|
33
42
|
return actualSrc;
|
|
34
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remotion",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.28",
|
|
4
4
|
"description": "Render videos in React",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "0caa0bec583b5e4c2b12b7375c365e02c2378eeb"
|
|
72
72
|
}
|