remotion 4.0.514 → 4.0.515
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/internals.d.ts +9 -0
- package/dist/cjs/internals.js +5 -0
- package/dist/cjs/interpolate-translate.d.ts +8 -0
- package/dist/cjs/interpolate-translate.js +70 -0
- package/dist/cjs/media-resource-manager.d.ts +25 -0
- package/dist/cjs/media-resource-manager.js +112 -0
- package/dist/cjs/sequence-field-schema.d.ts +425 -0
- package/dist/cjs/sequence-field-schema.js +133 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrap-in-schema.d.ts +20 -0
- package/dist/cjs/wrap-in-schema.js +203 -0
- package/dist/esm/index.mjs +120 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -27,6 +27,15 @@ export type { EffectChainState } from './effects/run-effect-chain.js';
|
|
|
27
27
|
export declare const Internals: {
|
|
28
28
|
readonly AbsoluteFillElement: import("react").ForwardRefExoticComponent<Omit<import("./AbsoluteFillElement.js").AbsoluteFillElementProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
29
29
|
readonly MaxMediaCacheSizeContext: import("react").Context<number | null>;
|
|
30
|
+
readonly getMediabunnyInputResourceKey: ({ src, credentials, requestInitFingerprint, revision, }: {
|
|
31
|
+
src: string;
|
|
32
|
+
credentials: RequestCredentials | null;
|
|
33
|
+
requestInitFingerprint: unknown;
|
|
34
|
+
revision: string | null;
|
|
35
|
+
}) => string;
|
|
36
|
+
readonly globalMediaResourceManager: import("./media-resource-manager.js").MediaResourceManager;
|
|
37
|
+
readonly makeMediaResourceManager: () => import("./media-resource-manager.js").MediaResourceManager;
|
|
38
|
+
readonly MEDIABUNNY_DURATION_VALUE_KEY: "mediabunny-duration";
|
|
30
39
|
readonly makeRenderResourceManager: () => import("./render-resource-manager.js").RenderResourceManager;
|
|
31
40
|
readonly RenderResourceManagerContext: import("react").Context<import("./render-resource-manager.js").RenderResourceManager | null>;
|
|
32
41
|
readonly useUnsafeVideoConfig: () => import("./video-config.js").VideoConfig | null;
|
package/dist/cjs/internals.js
CHANGED
|
@@ -70,6 +70,7 @@ const is_player_js_1 = require("./is-player.js");
|
|
|
70
70
|
const log_level_context_js_1 = require("./log-level-context.js");
|
|
71
71
|
const log_js_1 = require("./log.js");
|
|
72
72
|
const max_video_cache_size_js_1 = require("./max-video-cache-size.js");
|
|
73
|
+
const media_resource_manager_js_1 = require("./media-resource-manager.js");
|
|
73
74
|
const nonce_js_1 = require("./nonce.js");
|
|
74
75
|
const playback_logging_js_1 = require("./playback-logging.js");
|
|
75
76
|
const portal_node_js_1 = require("./portal-node.js");
|
|
@@ -126,6 +127,10 @@ const compositionSelectorRef = (0, react_1.createRef)();
|
|
|
126
127
|
exports.Internals = {
|
|
127
128
|
AbsoluteFillElement: AbsoluteFillElement_js_1.AbsoluteFillElement,
|
|
128
129
|
MaxMediaCacheSizeContext: max_video_cache_size_js_1.MaxMediaCacheSizeContext,
|
|
130
|
+
getMediabunnyInputResourceKey: media_resource_manager_js_1.getMediabunnyInputResourceKey,
|
|
131
|
+
globalMediaResourceManager: media_resource_manager_js_1.globalMediaResourceManager,
|
|
132
|
+
makeMediaResourceManager: media_resource_manager_js_1.makeMediaResourceManager,
|
|
133
|
+
MEDIABUNNY_DURATION_VALUE_KEY: media_resource_manager_js_1.MEDIABUNNY_DURATION_VALUE_KEY,
|
|
129
134
|
makeRenderResourceManager: render_resource_manager_js_1.makeRenderResourceManager,
|
|
130
135
|
RenderResourceManagerContext: render_resource_manager_js_1.RenderResourceManagerContext,
|
|
131
136
|
useUnsafeVideoConfig: use_unsafe_video_config_js_1.useUnsafeVideoConfig,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type InterpolateOptions } from './interpolate.js';
|
|
2
|
+
export type InterpolateTranslateOptions = InterpolateOptions;
|
|
3
|
+
export declare const interpolateTranslate: (input: number, inputRange: readonly number[], outputRange: readonly string[], options?: Partial<{
|
|
4
|
+
easing: import("./interpolate.js").EasingFunction | readonly import("./interpolate.js").EasingFunction[];
|
|
5
|
+
extrapolateLeft: import("./interpolate.js").ExtrapolateType;
|
|
6
|
+
extrapolateRight: import("./interpolate.js").ExtrapolateType;
|
|
7
|
+
posterize: number;
|
|
8
|
+
}> | undefined) => string;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.interpolateTranslate = void 0;
|
|
4
|
+
const interpolate_js_1 = require("./interpolate.js");
|
|
5
|
+
const pixelValueRegex = /^([+-]?(?:\d+\.?\d*|\.\d+))px$/;
|
|
6
|
+
const parseTranslate = (value) => {
|
|
7
|
+
if (typeof value !== 'string') {
|
|
8
|
+
throw new TypeError(`outputRange must contain only strings, but got ${typeof value}`);
|
|
9
|
+
}
|
|
10
|
+
const parts = value.trim().split(/\s+/);
|
|
11
|
+
if (parts.length < 1 || parts.length > 3 || parts[0] === '') {
|
|
12
|
+
throw new TypeError(`translate values must contain 1 to 3 pixel values, but got "${value}"`);
|
|
13
|
+
}
|
|
14
|
+
return parts.map((part) => {
|
|
15
|
+
const match = pixelValueRegex.exec(part);
|
|
16
|
+
if (match === null) {
|
|
17
|
+
throw new TypeError(`interpolateTranslate() only supports px values, but got "${part}" in "${value}"`);
|
|
18
|
+
}
|
|
19
|
+
return Number(match[1]);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
/*
|
|
23
|
+
* @description Allows you to map a range of values to CSS translate values using pixel units.
|
|
24
|
+
* @see [Documentation](https://remotion.dev/docs/interpolate-translate)
|
|
25
|
+
*/
|
|
26
|
+
const interpolateTranslate = (input, inputRange, outputRange, options) => {
|
|
27
|
+
var _a;
|
|
28
|
+
if (typeof input === 'undefined') {
|
|
29
|
+
throw new TypeError('input can not be undefined');
|
|
30
|
+
}
|
|
31
|
+
if (typeof inputRange === 'undefined') {
|
|
32
|
+
throw new TypeError('inputRange can not be undefined');
|
|
33
|
+
}
|
|
34
|
+
if (typeof outputRange === 'undefined') {
|
|
35
|
+
throw new TypeError('outputRange can not be undefined');
|
|
36
|
+
}
|
|
37
|
+
if (inputRange.length !== outputRange.length) {
|
|
38
|
+
throw new TypeError('inputRange (' +
|
|
39
|
+
inputRange.length +
|
|
40
|
+
' values provided) and outputRange (' +
|
|
41
|
+
outputRange.length +
|
|
42
|
+
' values provided) must have the same length');
|
|
43
|
+
}
|
|
44
|
+
const parsedOutputRange = outputRange.map((translateValue) => parseTranslate(translateValue));
|
|
45
|
+
const firstValueLength = (_a = parsedOutputRange[0]) === null || _a === void 0 ? void 0 : _a.length;
|
|
46
|
+
if (firstValueLength === undefined) {
|
|
47
|
+
throw new TypeError('outputRange must have at least 1 element');
|
|
48
|
+
}
|
|
49
|
+
for (const parsedTranslate of parsedOutputRange) {
|
|
50
|
+
if (parsedTranslate.length !== firstValueLength) {
|
|
51
|
+
throw new TypeError(`All translate values must have the same number of pixel values, but got ${firstValueLength} and ${parsedTranslate.length}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return new Array(firstValueLength)
|
|
55
|
+
.fill(true)
|
|
56
|
+
.map((_, index) => {
|
|
57
|
+
const outputValues = [];
|
|
58
|
+
for (const translateValue of parsedOutputRange) {
|
|
59
|
+
const value = translateValue[index];
|
|
60
|
+
if (value === undefined) {
|
|
61
|
+
throw new TypeError(`All translate values must have the same number of pixel values, but got ${firstValueLength} and ${translateValue.length}`);
|
|
62
|
+
}
|
|
63
|
+
outputValues.push(value);
|
|
64
|
+
}
|
|
65
|
+
const interpolatedValue = (0, interpolate_js_1.interpolate)(input, inputRange, outputValues, options);
|
|
66
|
+
return `${interpolatedValue}px`;
|
|
67
|
+
})
|
|
68
|
+
.join(' ');
|
|
69
|
+
};
|
|
70
|
+
exports.interpolateTranslate = interpolateTranslate;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type MediaResourceLease<T> = {
|
|
2
|
+
resource: T;
|
|
3
|
+
getOrCreateValue: <Value>(key: string, create: () => Value) => Value;
|
|
4
|
+
release: () => void;
|
|
5
|
+
};
|
|
6
|
+
export type MediaResourceManager = {
|
|
7
|
+
acquire: <T>({ key, create }: {
|
|
8
|
+
key: string;
|
|
9
|
+
create: () => {
|
|
10
|
+
resource: T;
|
|
11
|
+
dispose: () => void;
|
|
12
|
+
};
|
|
13
|
+
}) => MediaResourceLease<T>;
|
|
14
|
+
invalidate: (key: string) => void;
|
|
15
|
+
dispose: () => void;
|
|
16
|
+
};
|
|
17
|
+
export declare const makeMediaResourceManager: () => MediaResourceManager;
|
|
18
|
+
export declare const getMediabunnyInputResourceKey: ({ src, credentials, requestInitFingerprint, revision, }: {
|
|
19
|
+
src: string;
|
|
20
|
+
credentials: RequestCredentials | null;
|
|
21
|
+
requestInitFingerprint: unknown;
|
|
22
|
+
revision: string | null;
|
|
23
|
+
}) => string;
|
|
24
|
+
export declare const MEDIABUNNY_DURATION_VALUE_KEY = "mediabunny-duration";
|
|
25
|
+
export declare const globalMediaResourceManager: MediaResourceManager;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.globalMediaResourceManager = exports.MEDIABUNNY_DURATION_VALUE_KEY = exports.getMediabunnyInputResourceKey = exports.makeMediaResourceManager = void 0;
|
|
4
|
+
const disposeResource = (resource) => {
|
|
5
|
+
if (resource.disposed) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
resource.disposed = true;
|
|
9
|
+
resource.values.clear();
|
|
10
|
+
resource.dispose();
|
|
11
|
+
};
|
|
12
|
+
const makeMediaResourceManager = () => {
|
|
13
|
+
const resources = new Map();
|
|
14
|
+
let disposed = false;
|
|
15
|
+
return {
|
|
16
|
+
acquire: ({ key, create, }) => {
|
|
17
|
+
if (disposed) {
|
|
18
|
+
throw new Error('Media resource manager has already been disposed');
|
|
19
|
+
}
|
|
20
|
+
let entry = resources.get(key);
|
|
21
|
+
if (!entry) {
|
|
22
|
+
const created = create();
|
|
23
|
+
entry = {
|
|
24
|
+
resource: created.resource,
|
|
25
|
+
dispose: created.dispose,
|
|
26
|
+
refCount: 0,
|
|
27
|
+
disposeGeneration: 0,
|
|
28
|
+
disposed: false,
|
|
29
|
+
values: new Map(),
|
|
30
|
+
};
|
|
31
|
+
resources.set(key, entry);
|
|
32
|
+
}
|
|
33
|
+
entry.refCount++;
|
|
34
|
+
entry.disposeGeneration++;
|
|
35
|
+
let released = false;
|
|
36
|
+
return {
|
|
37
|
+
resource: entry.resource,
|
|
38
|
+
getOrCreateValue: (valueKey, createValue) => {
|
|
39
|
+
if (entry.values.has(valueKey)) {
|
|
40
|
+
return entry.values.get(valueKey);
|
|
41
|
+
}
|
|
42
|
+
const value = createValue();
|
|
43
|
+
entry.values.set(valueKey, value);
|
|
44
|
+
return value;
|
|
45
|
+
},
|
|
46
|
+
release: () => {
|
|
47
|
+
if (released) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
released = true;
|
|
51
|
+
entry.refCount--;
|
|
52
|
+
if (entry.refCount !== 0) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const disposeGeneration = ++entry.disposeGeneration;
|
|
56
|
+
queueMicrotask(() => {
|
|
57
|
+
if (entry.refCount !== 0 ||
|
|
58
|
+
entry.disposeGeneration !== disposeGeneration) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (resources.get(key) === entry) {
|
|
62
|
+
resources.delete(key);
|
|
63
|
+
}
|
|
64
|
+
disposeResource(entry);
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
invalidate: (key) => {
|
|
70
|
+
const entry = resources.get(key);
|
|
71
|
+
if (!entry) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
resources.delete(key);
|
|
75
|
+
entry.disposeGeneration++;
|
|
76
|
+
if (entry.refCount === 0) {
|
|
77
|
+
disposeResource(entry);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
dispose: () => {
|
|
81
|
+
if (disposed) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
disposed = true;
|
|
85
|
+
const entries = Array.from(resources.values());
|
|
86
|
+
resources.clear();
|
|
87
|
+
let firstError = null;
|
|
88
|
+
for (const entry of entries) {
|
|
89
|
+
try {
|
|
90
|
+
disposeResource(entry);
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
firstError !== null && firstError !== void 0 ? firstError : (firstError = error);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (firstError !== null) {
|
|
97
|
+
throw firstError;
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
exports.makeMediaResourceManager = makeMediaResourceManager;
|
|
103
|
+
const getMediabunnyInputResourceKey = ({ src, credentials, requestInitFingerprint, revision, }) => JSON.stringify([
|
|
104
|
+
'mediabunny-input',
|
|
105
|
+
src,
|
|
106
|
+
credentials,
|
|
107
|
+
requestInitFingerprint,
|
|
108
|
+
revision,
|
|
109
|
+
]);
|
|
110
|
+
exports.getMediabunnyInputResourceKey = getMediabunnyInputResourceKey;
|
|
111
|
+
exports.MEDIABUNNY_DURATION_VALUE_KEY = 'mediabunny-duration';
|
|
112
|
+
exports.globalMediaResourceManager = (0, exports.makeMediaResourceManager)();
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
export type HiddenFieldSchema = {
|
|
2
|
+
type: 'hidden';
|
|
3
|
+
keyframable?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export type NumberFieldSchema = {
|
|
6
|
+
type: 'number';
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
default: number | null | undefined;
|
|
11
|
+
description?: string;
|
|
12
|
+
hiddenFromList: boolean;
|
|
13
|
+
keyframable?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type BooleanFieldSchema = {
|
|
16
|
+
type: 'boolean';
|
|
17
|
+
default: boolean;
|
|
18
|
+
description?: string;
|
|
19
|
+
keyframable?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type RotationCssFieldSchema = {
|
|
22
|
+
type: 'rotation-css';
|
|
23
|
+
step?: number;
|
|
24
|
+
default: string | undefined;
|
|
25
|
+
description?: string;
|
|
26
|
+
keyframable?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type RotationDegreesFieldSchema = {
|
|
29
|
+
type: 'rotation-degrees';
|
|
30
|
+
min?: number;
|
|
31
|
+
max?: number;
|
|
32
|
+
step?: number;
|
|
33
|
+
default: number | undefined;
|
|
34
|
+
description?: string;
|
|
35
|
+
keyframable?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type TranslateFieldSchema = {
|
|
38
|
+
type: 'translate';
|
|
39
|
+
step?: number;
|
|
40
|
+
default: string | undefined;
|
|
41
|
+
description?: string;
|
|
42
|
+
keyframable?: boolean;
|
|
43
|
+
};
|
|
44
|
+
export type TransformOriginFieldSchema = {
|
|
45
|
+
type: 'transform-origin';
|
|
46
|
+
step?: number;
|
|
47
|
+
default: string | undefined;
|
|
48
|
+
description?: string;
|
|
49
|
+
keyframable?: boolean;
|
|
50
|
+
};
|
|
51
|
+
export type ScaleFieldSchema = {
|
|
52
|
+
type: 'scale';
|
|
53
|
+
min?: number;
|
|
54
|
+
max?: number;
|
|
55
|
+
step?: number;
|
|
56
|
+
default: number | string | undefined;
|
|
57
|
+
description?: string;
|
|
58
|
+
keyframable?: boolean;
|
|
59
|
+
};
|
|
60
|
+
export type UvCoordinateFieldSchema = {
|
|
61
|
+
type: 'uv-coordinate';
|
|
62
|
+
min?: number;
|
|
63
|
+
max?: number;
|
|
64
|
+
step?: number;
|
|
65
|
+
lineTo?: string;
|
|
66
|
+
default: readonly [number, number] | undefined;
|
|
67
|
+
description?: string;
|
|
68
|
+
keyframable?: boolean;
|
|
69
|
+
};
|
|
70
|
+
export type ColorFieldSchema = {
|
|
71
|
+
type: 'color';
|
|
72
|
+
default: string | undefined;
|
|
73
|
+
description?: string;
|
|
74
|
+
keyframable?: boolean;
|
|
75
|
+
};
|
|
76
|
+
export type EnumFieldSchema = {
|
|
77
|
+
type: 'enum';
|
|
78
|
+
default: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
variants: Record<string, SequenceSchema>;
|
|
81
|
+
keyframable?: boolean;
|
|
82
|
+
};
|
|
83
|
+
export type NumberArrayItemSchema = Omit<NumberFieldSchema, 'default' | 'description' | 'hiddenFromList' | 'keyframable'>;
|
|
84
|
+
export type BooleanArrayItemSchema = Omit<BooleanFieldSchema, 'default' | 'description' | 'keyframable'>;
|
|
85
|
+
export type RotationCssArrayItemSchema = Omit<RotationCssFieldSchema, 'default' | 'description' | 'keyframable'>;
|
|
86
|
+
export type RotationDegreesArrayItemSchema = Omit<RotationDegreesFieldSchema, 'default' | 'description' | 'keyframable'>;
|
|
87
|
+
export type TranslateArrayItemSchema = Omit<TranslateFieldSchema, 'default' | 'description' | 'keyframable'>;
|
|
88
|
+
export type UvCoordinateArrayItemSchema = Omit<UvCoordinateFieldSchema, 'default' | 'description' | 'keyframable'>;
|
|
89
|
+
export type ColorArrayItemSchema = Omit<ColorFieldSchema, 'default' | 'description' | 'keyframable'>;
|
|
90
|
+
export type EnumArrayItemSchema = {
|
|
91
|
+
type: 'enum';
|
|
92
|
+
variants: readonly string[];
|
|
93
|
+
};
|
|
94
|
+
export type ArrayItemFieldSchema = NumberArrayItemSchema | BooleanArrayItemSchema | RotationCssArrayItemSchema | RotationDegreesArrayItemSchema | TranslateArrayItemSchema | UvCoordinateArrayItemSchema | ColorArrayItemSchema | EnumArrayItemSchema;
|
|
95
|
+
export type ArrayFieldSchema = {
|
|
96
|
+
type: 'array';
|
|
97
|
+
item: ArrayItemFieldSchema;
|
|
98
|
+
default: readonly unknown[] | undefined;
|
|
99
|
+
minLength?: number;
|
|
100
|
+
maxLength?: number;
|
|
101
|
+
newItemDefault: unknown;
|
|
102
|
+
description?: string;
|
|
103
|
+
keyframable?: false;
|
|
104
|
+
};
|
|
105
|
+
export type VisibleFieldSchema = NumberFieldSchema | BooleanFieldSchema | RotationCssFieldSchema | RotationDegreesFieldSchema | TranslateFieldSchema | TransformOriginFieldSchema | ScaleFieldSchema | UvCoordinateFieldSchema | ColorFieldSchema | ArrayFieldSchema | EnumFieldSchema;
|
|
106
|
+
export type SequenceFieldSchema = VisibleFieldSchema | HiddenFieldSchema;
|
|
107
|
+
export type SequenceSchema = {
|
|
108
|
+
[key: string]: SequenceFieldSchema;
|
|
109
|
+
};
|
|
110
|
+
export type SchemaKeysRecord<S extends SequenceSchema> = Record<keyof S, unknown>;
|
|
111
|
+
export declare const sequenceVisualStyleSchema: {
|
|
112
|
+
readonly 'style.transformOrigin': {
|
|
113
|
+
readonly type: "transform-origin";
|
|
114
|
+
readonly step: 1;
|
|
115
|
+
readonly default: "50% 50%";
|
|
116
|
+
readonly description: "Transform origin";
|
|
117
|
+
};
|
|
118
|
+
readonly 'style.translate': {
|
|
119
|
+
readonly type: "translate";
|
|
120
|
+
readonly step: 1;
|
|
121
|
+
readonly default: "0px 0px";
|
|
122
|
+
readonly description: "Offset";
|
|
123
|
+
};
|
|
124
|
+
readonly 'style.scale': {
|
|
125
|
+
readonly type: "scale";
|
|
126
|
+
readonly max: 100;
|
|
127
|
+
readonly step: 0.01;
|
|
128
|
+
readonly default: 1;
|
|
129
|
+
readonly description: "Scale";
|
|
130
|
+
};
|
|
131
|
+
readonly 'style.rotate': {
|
|
132
|
+
readonly type: "rotation-css";
|
|
133
|
+
readonly step: 1;
|
|
134
|
+
readonly default: "0deg";
|
|
135
|
+
readonly description: "Rotation";
|
|
136
|
+
};
|
|
137
|
+
readonly 'style.opacity': {
|
|
138
|
+
readonly type: "number";
|
|
139
|
+
readonly min: 0;
|
|
140
|
+
readonly max: 1;
|
|
141
|
+
readonly step: 0.01;
|
|
142
|
+
readonly default: 1;
|
|
143
|
+
readonly description: "Opacity";
|
|
144
|
+
readonly hiddenFromList: false;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
export declare const sequencePremountSchema: {
|
|
148
|
+
readonly premountFor: {
|
|
149
|
+
readonly type: "number";
|
|
150
|
+
readonly default: 0;
|
|
151
|
+
readonly description: "Premount For";
|
|
152
|
+
readonly min: 0;
|
|
153
|
+
readonly step: 1;
|
|
154
|
+
readonly hiddenFromList: false;
|
|
155
|
+
};
|
|
156
|
+
readonly postmountFor: {
|
|
157
|
+
readonly type: "number";
|
|
158
|
+
readonly default: 0;
|
|
159
|
+
readonly min: 0;
|
|
160
|
+
readonly step: 1;
|
|
161
|
+
readonly hiddenFromList: true;
|
|
162
|
+
};
|
|
163
|
+
readonly styleWhilePremounted: {
|
|
164
|
+
readonly type: "hidden";
|
|
165
|
+
};
|
|
166
|
+
readonly styleWhilePostmounted: {
|
|
167
|
+
readonly type: "hidden";
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
export declare const sequenceStyleSchema: {
|
|
171
|
+
readonly 'style.transformOrigin': {
|
|
172
|
+
readonly type: "transform-origin";
|
|
173
|
+
readonly step: 1;
|
|
174
|
+
readonly default: "50% 50%";
|
|
175
|
+
readonly description: "Transform origin";
|
|
176
|
+
};
|
|
177
|
+
readonly 'style.translate': {
|
|
178
|
+
readonly type: "translate";
|
|
179
|
+
readonly step: 1;
|
|
180
|
+
readonly default: "0px 0px";
|
|
181
|
+
readonly description: "Offset";
|
|
182
|
+
};
|
|
183
|
+
readonly 'style.scale': {
|
|
184
|
+
readonly type: "scale";
|
|
185
|
+
readonly max: 100;
|
|
186
|
+
readonly step: 0.01;
|
|
187
|
+
readonly default: 1;
|
|
188
|
+
readonly description: "Scale";
|
|
189
|
+
};
|
|
190
|
+
readonly 'style.rotate': {
|
|
191
|
+
readonly type: "rotation-css";
|
|
192
|
+
readonly step: 1;
|
|
193
|
+
readonly default: "0deg";
|
|
194
|
+
readonly description: "Rotation";
|
|
195
|
+
};
|
|
196
|
+
readonly 'style.opacity': {
|
|
197
|
+
readonly type: "number";
|
|
198
|
+
readonly min: 0;
|
|
199
|
+
readonly max: 1;
|
|
200
|
+
readonly step: 0.01;
|
|
201
|
+
readonly default: 1;
|
|
202
|
+
readonly description: "Opacity";
|
|
203
|
+
readonly hiddenFromList: false;
|
|
204
|
+
};
|
|
205
|
+
readonly premountFor: {
|
|
206
|
+
readonly type: "number";
|
|
207
|
+
readonly default: 0;
|
|
208
|
+
readonly description: "Premount For";
|
|
209
|
+
readonly min: 0;
|
|
210
|
+
readonly step: 1;
|
|
211
|
+
readonly hiddenFromList: false;
|
|
212
|
+
};
|
|
213
|
+
readonly postmountFor: {
|
|
214
|
+
readonly type: "number";
|
|
215
|
+
readonly default: 0;
|
|
216
|
+
readonly min: 0;
|
|
217
|
+
readonly step: 1;
|
|
218
|
+
readonly hiddenFromList: true;
|
|
219
|
+
};
|
|
220
|
+
readonly styleWhilePremounted: {
|
|
221
|
+
readonly type: "hidden";
|
|
222
|
+
};
|
|
223
|
+
readonly styleWhilePostmounted: {
|
|
224
|
+
readonly type: "hidden";
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
export declare const hiddenField: SequenceFieldSchema;
|
|
228
|
+
export declare const sequenceNameField: SequenceFieldSchema;
|
|
229
|
+
export declare const extendSchemaWithSequenceName: <S extends SequenceSchema>(schema: S) => S & {
|
|
230
|
+
name: SequenceFieldSchema;
|
|
231
|
+
};
|
|
232
|
+
export declare const durationInFramesField: {
|
|
233
|
+
readonly type: "number";
|
|
234
|
+
readonly default: undefined;
|
|
235
|
+
readonly min: 1;
|
|
236
|
+
readonly step: 1;
|
|
237
|
+
readonly hiddenFromList: true;
|
|
238
|
+
};
|
|
239
|
+
export declare const fromField: {
|
|
240
|
+
readonly type: "number";
|
|
241
|
+
readonly default: 0;
|
|
242
|
+
readonly step: 1;
|
|
243
|
+
readonly hiddenFromList: true;
|
|
244
|
+
};
|
|
245
|
+
export declare const freezeField: {
|
|
246
|
+
readonly type: "number";
|
|
247
|
+
readonly default: null;
|
|
248
|
+
readonly step: 1;
|
|
249
|
+
readonly hiddenFromList: true;
|
|
250
|
+
};
|
|
251
|
+
export declare const sequenceSchema: {
|
|
252
|
+
readonly hidden: BooleanFieldSchema;
|
|
253
|
+
readonly showInTimeline: HiddenFieldSchema;
|
|
254
|
+
readonly from: {
|
|
255
|
+
readonly type: "number";
|
|
256
|
+
readonly default: 0;
|
|
257
|
+
readonly step: 1;
|
|
258
|
+
readonly hiddenFromList: true;
|
|
259
|
+
};
|
|
260
|
+
readonly freeze: {
|
|
261
|
+
readonly type: "number";
|
|
262
|
+
readonly default: null;
|
|
263
|
+
readonly step: 1;
|
|
264
|
+
readonly hiddenFromList: true;
|
|
265
|
+
};
|
|
266
|
+
readonly durationInFrames: {
|
|
267
|
+
readonly type: "number";
|
|
268
|
+
readonly default: undefined;
|
|
269
|
+
readonly min: 1;
|
|
270
|
+
readonly step: 1;
|
|
271
|
+
readonly hiddenFromList: true;
|
|
272
|
+
};
|
|
273
|
+
readonly layout: {
|
|
274
|
+
readonly type: "enum";
|
|
275
|
+
readonly default: "absolute-fill";
|
|
276
|
+
readonly description: "Layout";
|
|
277
|
+
readonly variants: {
|
|
278
|
+
readonly 'absolute-fill': {
|
|
279
|
+
readonly 'style.transformOrigin': {
|
|
280
|
+
readonly type: "transform-origin";
|
|
281
|
+
readonly step: 1;
|
|
282
|
+
readonly default: "50% 50%";
|
|
283
|
+
readonly description: "Transform origin";
|
|
284
|
+
};
|
|
285
|
+
readonly 'style.translate': {
|
|
286
|
+
readonly type: "translate";
|
|
287
|
+
readonly step: 1;
|
|
288
|
+
readonly default: "0px 0px";
|
|
289
|
+
readonly description: "Offset";
|
|
290
|
+
};
|
|
291
|
+
readonly 'style.scale': {
|
|
292
|
+
readonly type: "scale";
|
|
293
|
+
readonly max: 100;
|
|
294
|
+
readonly step: 0.01;
|
|
295
|
+
readonly default: 1;
|
|
296
|
+
readonly description: "Scale";
|
|
297
|
+
};
|
|
298
|
+
readonly 'style.rotate': {
|
|
299
|
+
readonly type: "rotation-css";
|
|
300
|
+
readonly step: 1;
|
|
301
|
+
readonly default: "0deg";
|
|
302
|
+
readonly description: "Rotation";
|
|
303
|
+
};
|
|
304
|
+
readonly 'style.opacity': {
|
|
305
|
+
readonly type: "number";
|
|
306
|
+
readonly min: 0;
|
|
307
|
+
readonly max: 1;
|
|
308
|
+
readonly step: 0.01;
|
|
309
|
+
readonly default: 1;
|
|
310
|
+
readonly description: "Opacity";
|
|
311
|
+
readonly hiddenFromList: false;
|
|
312
|
+
};
|
|
313
|
+
readonly premountFor: {
|
|
314
|
+
readonly type: "number";
|
|
315
|
+
readonly default: 0;
|
|
316
|
+
readonly description: "Premount For";
|
|
317
|
+
readonly min: 0;
|
|
318
|
+
readonly step: 1;
|
|
319
|
+
readonly hiddenFromList: false;
|
|
320
|
+
};
|
|
321
|
+
readonly postmountFor: {
|
|
322
|
+
readonly type: "number";
|
|
323
|
+
readonly default: 0;
|
|
324
|
+
readonly min: 0;
|
|
325
|
+
readonly step: 1;
|
|
326
|
+
readonly hiddenFromList: true;
|
|
327
|
+
};
|
|
328
|
+
readonly styleWhilePremounted: {
|
|
329
|
+
readonly type: "hidden";
|
|
330
|
+
};
|
|
331
|
+
readonly styleWhilePostmounted: {
|
|
332
|
+
readonly type: "hidden";
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
readonly none: {};
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
} & {
|
|
339
|
+
name: SequenceFieldSchema;
|
|
340
|
+
};
|
|
341
|
+
export declare const sequenceSchemaWithoutFrom: {
|
|
342
|
+
readonly hidden: BooleanFieldSchema;
|
|
343
|
+
readonly showInTimeline: HiddenFieldSchema;
|
|
344
|
+
readonly freeze: {
|
|
345
|
+
readonly type: "number";
|
|
346
|
+
readonly default: null;
|
|
347
|
+
readonly step: 1;
|
|
348
|
+
readonly hiddenFromList: true;
|
|
349
|
+
};
|
|
350
|
+
readonly durationInFrames: {
|
|
351
|
+
readonly type: "number";
|
|
352
|
+
readonly default: undefined;
|
|
353
|
+
readonly min: 1;
|
|
354
|
+
readonly step: 1;
|
|
355
|
+
readonly hiddenFromList: true;
|
|
356
|
+
};
|
|
357
|
+
readonly layout: {
|
|
358
|
+
readonly type: "enum";
|
|
359
|
+
readonly default: "absolute-fill";
|
|
360
|
+
readonly description: "Layout";
|
|
361
|
+
readonly variants: {
|
|
362
|
+
readonly 'absolute-fill': {
|
|
363
|
+
readonly 'style.transformOrigin': {
|
|
364
|
+
readonly type: "transform-origin";
|
|
365
|
+
readonly step: 1;
|
|
366
|
+
readonly default: "50% 50%";
|
|
367
|
+
readonly description: "Transform origin";
|
|
368
|
+
};
|
|
369
|
+
readonly 'style.translate': {
|
|
370
|
+
readonly type: "translate";
|
|
371
|
+
readonly step: 1;
|
|
372
|
+
readonly default: "0px 0px";
|
|
373
|
+
readonly description: "Offset";
|
|
374
|
+
};
|
|
375
|
+
readonly 'style.scale': {
|
|
376
|
+
readonly type: "scale";
|
|
377
|
+
readonly max: 100;
|
|
378
|
+
readonly step: 0.01;
|
|
379
|
+
readonly default: 1;
|
|
380
|
+
readonly description: "Scale";
|
|
381
|
+
};
|
|
382
|
+
readonly 'style.rotate': {
|
|
383
|
+
readonly type: "rotation-css";
|
|
384
|
+
readonly step: 1;
|
|
385
|
+
readonly default: "0deg";
|
|
386
|
+
readonly description: "Rotation";
|
|
387
|
+
};
|
|
388
|
+
readonly 'style.opacity': {
|
|
389
|
+
readonly type: "number";
|
|
390
|
+
readonly min: 0;
|
|
391
|
+
readonly max: 1;
|
|
392
|
+
readonly step: 0.01;
|
|
393
|
+
readonly default: 1;
|
|
394
|
+
readonly description: "Opacity";
|
|
395
|
+
readonly hiddenFromList: false;
|
|
396
|
+
};
|
|
397
|
+
readonly premountFor: {
|
|
398
|
+
readonly type: "number";
|
|
399
|
+
readonly default: 0;
|
|
400
|
+
readonly description: "Premount For";
|
|
401
|
+
readonly min: 0;
|
|
402
|
+
readonly step: 1;
|
|
403
|
+
readonly hiddenFromList: false;
|
|
404
|
+
};
|
|
405
|
+
readonly postmountFor: {
|
|
406
|
+
readonly type: "number";
|
|
407
|
+
readonly default: 0;
|
|
408
|
+
readonly min: 0;
|
|
409
|
+
readonly step: 1;
|
|
410
|
+
readonly hiddenFromList: true;
|
|
411
|
+
};
|
|
412
|
+
readonly styleWhilePremounted: {
|
|
413
|
+
readonly type: "hidden";
|
|
414
|
+
};
|
|
415
|
+
readonly styleWhilePostmounted: {
|
|
416
|
+
readonly type: "hidden";
|
|
417
|
+
};
|
|
418
|
+
};
|
|
419
|
+
readonly none: {};
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
} & {
|
|
423
|
+
name: SequenceFieldSchema;
|
|
424
|
+
};
|
|
425
|
+
export declare const sequenceSchemaDefaultLayoutNone: SequenceSchema;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sequenceSchemaDefaultLayoutNone = exports.sequenceSchemaWithoutFrom = exports.sequenceSchema = exports.freezeField = exports.fromField = exports.durationInFramesField = exports.extendSchemaWithSequenceName = exports.sequenceNameField = exports.hiddenField = exports.sequenceStyleSchema = exports.sequencePremountSchema = exports.sequenceVisualStyleSchema = void 0;
|
|
4
|
+
exports.sequenceVisualStyleSchema = {
|
|
5
|
+
'style.transformOrigin': {
|
|
6
|
+
type: 'transform-origin',
|
|
7
|
+
step: 1,
|
|
8
|
+
default: '50% 50%',
|
|
9
|
+
description: 'Transform origin',
|
|
10
|
+
},
|
|
11
|
+
'style.translate': {
|
|
12
|
+
type: 'translate',
|
|
13
|
+
step: 1,
|
|
14
|
+
default: '0px 0px',
|
|
15
|
+
description: 'Offset',
|
|
16
|
+
},
|
|
17
|
+
'style.scale': {
|
|
18
|
+
type: 'scale',
|
|
19
|
+
max: 100,
|
|
20
|
+
step: 0.01,
|
|
21
|
+
default: 1,
|
|
22
|
+
description: 'Scale',
|
|
23
|
+
},
|
|
24
|
+
'style.rotate': {
|
|
25
|
+
type: 'rotation-css',
|
|
26
|
+
step: 1,
|
|
27
|
+
default: '0deg',
|
|
28
|
+
description: 'Rotation',
|
|
29
|
+
},
|
|
30
|
+
'style.opacity': {
|
|
31
|
+
type: 'number',
|
|
32
|
+
min: 0,
|
|
33
|
+
max: 1,
|
|
34
|
+
step: 0.01,
|
|
35
|
+
default: 1,
|
|
36
|
+
description: 'Opacity',
|
|
37
|
+
hiddenFromList: false,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
exports.sequencePremountSchema = {
|
|
41
|
+
premountFor: {
|
|
42
|
+
type: 'number',
|
|
43
|
+
default: 0,
|
|
44
|
+
description: 'Premount For',
|
|
45
|
+
min: 0,
|
|
46
|
+
step: 1,
|
|
47
|
+
hiddenFromList: false,
|
|
48
|
+
},
|
|
49
|
+
postmountFor: {
|
|
50
|
+
type: 'number',
|
|
51
|
+
default: 0,
|
|
52
|
+
min: 0,
|
|
53
|
+
step: 1,
|
|
54
|
+
hiddenFromList: true,
|
|
55
|
+
},
|
|
56
|
+
styleWhilePremounted: {
|
|
57
|
+
type: 'hidden',
|
|
58
|
+
},
|
|
59
|
+
styleWhilePostmounted: {
|
|
60
|
+
type: 'hidden',
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
exports.sequenceStyleSchema = {
|
|
64
|
+
...exports.sequenceVisualStyleSchema,
|
|
65
|
+
...exports.sequencePremountSchema,
|
|
66
|
+
};
|
|
67
|
+
exports.hiddenField = {
|
|
68
|
+
type: 'boolean',
|
|
69
|
+
default: false,
|
|
70
|
+
description: 'Hidden',
|
|
71
|
+
};
|
|
72
|
+
const showInTimelineField = {
|
|
73
|
+
type: 'hidden',
|
|
74
|
+
};
|
|
75
|
+
exports.sequenceNameField = {
|
|
76
|
+
type: 'hidden',
|
|
77
|
+
};
|
|
78
|
+
const extendSchemaWithSequenceName = (schema) => {
|
|
79
|
+
return {
|
|
80
|
+
name: exports.sequenceNameField,
|
|
81
|
+
...schema,
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
exports.extendSchemaWithSequenceName = extendSchemaWithSequenceName;
|
|
85
|
+
exports.durationInFramesField = {
|
|
86
|
+
type: 'number',
|
|
87
|
+
default: undefined,
|
|
88
|
+
min: 1,
|
|
89
|
+
step: 1,
|
|
90
|
+
hiddenFromList: true,
|
|
91
|
+
};
|
|
92
|
+
exports.fromField = {
|
|
93
|
+
type: 'number',
|
|
94
|
+
default: 0,
|
|
95
|
+
step: 1,
|
|
96
|
+
hiddenFromList: true,
|
|
97
|
+
};
|
|
98
|
+
exports.freezeField = {
|
|
99
|
+
type: 'number',
|
|
100
|
+
default: null,
|
|
101
|
+
step: 1,
|
|
102
|
+
hiddenFromList: true,
|
|
103
|
+
};
|
|
104
|
+
exports.sequenceSchema = (0, exports.extendSchemaWithSequenceName)({
|
|
105
|
+
hidden: exports.hiddenField,
|
|
106
|
+
showInTimeline: showInTimelineField,
|
|
107
|
+
from: exports.fromField,
|
|
108
|
+
freeze: exports.freezeField,
|
|
109
|
+
durationInFrames: exports.durationInFramesField,
|
|
110
|
+
layout: {
|
|
111
|
+
type: 'enum',
|
|
112
|
+
default: 'absolute-fill',
|
|
113
|
+
description: 'Layout',
|
|
114
|
+
variants: {
|
|
115
|
+
'absolute-fill': exports.sequenceStyleSchema,
|
|
116
|
+
none: {},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
exports.sequenceSchemaWithoutFrom = (0, exports.extendSchemaWithSequenceName)({
|
|
121
|
+
hidden: exports.hiddenField,
|
|
122
|
+
showInTimeline: showInTimelineField,
|
|
123
|
+
freeze: exports.freezeField,
|
|
124
|
+
durationInFrames: exports.durationInFramesField,
|
|
125
|
+
layout: exports.sequenceSchema.layout,
|
|
126
|
+
});
|
|
127
|
+
exports.sequenceSchemaDefaultLayoutNone = {
|
|
128
|
+
...exports.sequenceSchema,
|
|
129
|
+
layout: {
|
|
130
|
+
...exports.sequenceSchema.layout,
|
|
131
|
+
default: 'none',
|
|
132
|
+
},
|
|
133
|
+
};
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SequenceControls } from './CompositionManager.js';
|
|
3
|
+
import { type SequenceSchema } from './sequence-field-schema.js';
|
|
4
|
+
export declare const getNestedValue: (obj: Record<string, unknown>, key: string) => unknown;
|
|
5
|
+
export declare const readValuesFromProps: (props: Record<string, unknown>, keys: string[]) => Record<string, unknown>;
|
|
6
|
+
export declare const selectActiveKeys: (schema: SequenceSchema, values: Record<string, unknown>) => string[];
|
|
7
|
+
export declare const mergeValues: ({ props, valuesDotNotation, schemaKeys, propsToDelete, }: {
|
|
8
|
+
props: Record<string, unknown>;
|
|
9
|
+
valuesDotNotation: Record<string, unknown>;
|
|
10
|
+
schemaKeys: string[];
|
|
11
|
+
propsToDelete: Set<string>;
|
|
12
|
+
}) => Record<string, unknown>;
|
|
13
|
+
export declare const wrapInSchema: <S extends SequenceSchema, Props extends object>({ Component, componentIdentity, schema, supportsEffects, }: {
|
|
14
|
+
Component: React.ComponentType<Props & {
|
|
15
|
+
readonly _experimentalControls: SequenceControls | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
componentIdentity: string | null;
|
|
18
|
+
schema: S;
|
|
19
|
+
supportsEffects: boolean;
|
|
20
|
+
}) => React.ComponentType<Props>;
|
|
@@ -0,0 +1,203 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.wrapInSchema = exports.mergeValues = exports.selectActiveKeys = exports.readValuesFromProps = exports.getNestedValue = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const delete_nested_key_js_1 = require("./delete-nested-key.js");
|
|
39
|
+
const use_memoized_effects_js_1 = require("./effects/use-memoized-effects.js");
|
|
40
|
+
const flatten_schema_js_1 = require("./flatten-schema.js");
|
|
41
|
+
const sequence_field_schema_js_1 = require("./sequence-field-schema.js");
|
|
42
|
+
const sequence_node_path_js_1 = require("./sequence-node-path.js");
|
|
43
|
+
const SequenceManager_js_1 = require("./SequenceManager.js");
|
|
44
|
+
const use_current_frame_js_1 = require("./use-current-frame.js");
|
|
45
|
+
const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
|
|
46
|
+
const use_schema_js_1 = require("./use-schema.js");
|
|
47
|
+
const getNestedValue = (obj, key) => {
|
|
48
|
+
const parts = key.split('.');
|
|
49
|
+
let current = obj;
|
|
50
|
+
for (const part of parts) {
|
|
51
|
+
if (current === null ||
|
|
52
|
+
current === undefined ||
|
|
53
|
+
typeof current !== 'object')
|
|
54
|
+
return undefined;
|
|
55
|
+
current = current[part];
|
|
56
|
+
}
|
|
57
|
+
return current;
|
|
58
|
+
};
|
|
59
|
+
exports.getNestedValue = getNestedValue;
|
|
60
|
+
const readValuesFromProps = (props, keys) => {
|
|
61
|
+
const out = {};
|
|
62
|
+
for (const key of keys) {
|
|
63
|
+
out[key] = (0, exports.getNestedValue)(props, key);
|
|
64
|
+
}
|
|
65
|
+
return out;
|
|
66
|
+
};
|
|
67
|
+
exports.readValuesFromProps = readValuesFromProps;
|
|
68
|
+
const selectActiveKeys = (schema, values) => {
|
|
69
|
+
return Object.keys((0, flatten_schema_js_1.flattenActiveSchema)(schema, (key) => values[key]));
|
|
70
|
+
};
|
|
71
|
+
exports.selectActiveKeys = selectActiveKeys;
|
|
72
|
+
const mergeValues = ({ props, valuesDotNotation, schemaKeys, propsToDelete, }) => {
|
|
73
|
+
const merged = { ...props };
|
|
74
|
+
for (const key of schemaKeys) {
|
|
75
|
+
const value = valuesDotNotation[key];
|
|
76
|
+
const parts = key.split('.');
|
|
77
|
+
if (parts.length === 1) {
|
|
78
|
+
merged[key] = value;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
// For dot-notation keys like 'style.opacity',
|
|
82
|
+
// clone and set the nested path
|
|
83
|
+
let current = merged;
|
|
84
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
85
|
+
const part = parts[i];
|
|
86
|
+
if (typeof current[part] === 'object' && current[part] !== null) {
|
|
87
|
+
current[part] = { ...current[part] };
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
current[part] = {};
|
|
91
|
+
}
|
|
92
|
+
current = current[part];
|
|
93
|
+
}
|
|
94
|
+
current[parts[parts.length - 1]] = value;
|
|
95
|
+
}
|
|
96
|
+
(0, delete_nested_key_js_1.deleteNestedKey)(merged, propsToDelete);
|
|
97
|
+
return merged;
|
|
98
|
+
};
|
|
99
|
+
exports.mergeValues = mergeValues;
|
|
100
|
+
const stackToOverrideMap = {};
|
|
101
|
+
const wrapInSchema = ({ Component, componentIdentity, schema, supportsEffects, }) => {
|
|
102
|
+
// Schema is static for a component, so we move this outside
|
|
103
|
+
const schemaWithSequenceName = (0, sequence_field_schema_js_1.extendSchemaWithSequenceName)(schema);
|
|
104
|
+
const flatSchema = (0, flatten_schema_js_1.getFlatSchemaWithAllKeys)(schemaWithSequenceName);
|
|
105
|
+
const flatKeys = Object.keys(flatSchema);
|
|
106
|
+
const Wrapped = (0, react_1.forwardRef)((props, ref) => {
|
|
107
|
+
var _a;
|
|
108
|
+
const env = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
|
|
109
|
+
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
|
|
110
|
+
return react_1.default.createElement(Component, {
|
|
111
|
+
...props,
|
|
112
|
+
_experimentalControls: null,
|
|
113
|
+
ref,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
117
|
+
const { propStatuses } = (0, react_1.useContext)(SequenceManager_js_1.VisualModePropStatusesContext);
|
|
118
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
119
|
+
const { getDragOverrides } = (0, react_1.useContext)(SequenceManager_js_1.VisualModeDragOverridesContext);
|
|
120
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
121
|
+
const nodePathMapping = (0, react_1.useContext)(sequence_node_path_js_1.OverrideIdsToNodePathsGettersContext);
|
|
122
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
123
|
+
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
124
|
+
// If the parent has passed `_experimentalControls`, we should not override it.
|
|
125
|
+
// @ts-expect-error
|
|
126
|
+
if (props._experimentalControls) {
|
|
127
|
+
return react_1.default.createElement(Component, {
|
|
128
|
+
...props,
|
|
129
|
+
ref,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
133
|
+
const [overrideId] = (0, react_1.useState)(() => {
|
|
134
|
+
const { stack } = props;
|
|
135
|
+
if (!stack) {
|
|
136
|
+
return String(Math.random());
|
|
137
|
+
}
|
|
138
|
+
const existingOverrideId = stackToOverrideMap[stack];
|
|
139
|
+
if (existingOverrideId) {
|
|
140
|
+
return existingOverrideId;
|
|
141
|
+
}
|
|
142
|
+
const newOverrideId = String(Math.random());
|
|
143
|
+
stackToOverrideMap[stack] = newOverrideId;
|
|
144
|
+
return newOverrideId;
|
|
145
|
+
});
|
|
146
|
+
const nodePath = (_a = nodePathMapping.overrideIdToNodePathMappings[overrideId]) !== null && _a !== void 0 ? _a : null;
|
|
147
|
+
// Read the runtime values for every flat key from the JSX props,
|
|
148
|
+
// memoized on the leaf values so the object reference is stable
|
|
149
|
+
// when nothing changed — otherwise downstream `useMemo`s churn and
|
|
150
|
+
// effects (e.g. Sequence registration) re-fire every render.
|
|
151
|
+
const runtimeValues = flatKeys.map((k) => (0, exports.getNestedValue)(props, k));
|
|
152
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
153
|
+
const currentRuntimeValueDotNotation = (0, react_1.useMemo)(() => (0, exports.readValuesFromProps)(props, flatKeys),
|
|
154
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
155
|
+
runtimeValues);
|
|
156
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
157
|
+
const controls = (0, react_1.useMemo)(() => {
|
|
158
|
+
return {
|
|
159
|
+
schema: schemaWithSequenceName,
|
|
160
|
+
currentRuntimeValueDotNotation,
|
|
161
|
+
overrideId,
|
|
162
|
+
supportsEffects,
|
|
163
|
+
componentIdentity,
|
|
164
|
+
};
|
|
165
|
+
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
166
|
+
// 3. Apply drag/code overrides on top of the runtime values.
|
|
167
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
168
|
+
const { merged: valuesDotNotation, propsToDelete } = (0, react_1.useMemo)(() => {
|
|
169
|
+
return (0, use_schema_js_1.computeEffectiveSchemaValuesDotNotation)({
|
|
170
|
+
schema: schemaWithSequenceName,
|
|
171
|
+
currentValue: currentRuntimeValueDotNotation,
|
|
172
|
+
overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
|
|
173
|
+
propStatus: nodePath === null
|
|
174
|
+
? undefined
|
|
175
|
+
: (0, use_memoized_effects_js_1.getPropStatusesCtx)(propStatuses, nodePath),
|
|
176
|
+
frame,
|
|
177
|
+
});
|
|
178
|
+
}, [
|
|
179
|
+
currentRuntimeValueDotNotation,
|
|
180
|
+
getDragOverrides,
|
|
181
|
+
nodePath,
|
|
182
|
+
propStatuses,
|
|
183
|
+
frame,
|
|
184
|
+
]);
|
|
185
|
+
// 4. Eliminate values forbidden by the resolved discriminated union.
|
|
186
|
+
const activeKeys = (0, exports.selectActiveKeys)(schemaWithSequenceName, valuesDotNotation);
|
|
187
|
+
// 5. Apply the active values back onto the props.
|
|
188
|
+
const mergedProps = (0, exports.mergeValues)({
|
|
189
|
+
props: props,
|
|
190
|
+
valuesDotNotation,
|
|
191
|
+
schemaKeys: activeKeys,
|
|
192
|
+
propsToDelete,
|
|
193
|
+
});
|
|
194
|
+
return react_1.default.createElement(Component, {
|
|
195
|
+
...mergedProps,
|
|
196
|
+
_experimentalControls: controls,
|
|
197
|
+
ref,
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || 'Component'})`;
|
|
201
|
+
return Wrapped;
|
|
202
|
+
};
|
|
203
|
+
exports.wrapInSchema = wrapInSchema;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1352,7 +1352,7 @@ var getSingleChildComponent = (children) => {
|
|
|
1352
1352
|
};
|
|
1353
1353
|
|
|
1354
1354
|
// src/version.ts
|
|
1355
|
-
var VERSION = "4.0.
|
|
1355
|
+
var VERSION = "4.0.515";
|
|
1356
1356
|
|
|
1357
1357
|
// src/multiple-versions-warning.ts
|
|
1358
1358
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -11870,6 +11870,121 @@ var getPreviewDomElement = () => {
|
|
|
11870
11870
|
import React33 from "react";
|
|
11871
11871
|
var MaxMediaCacheSizeContext = React33.createContext(null);
|
|
11872
11872
|
|
|
11873
|
+
// src/media-resource-manager.ts
|
|
11874
|
+
var disposeResource = (resource) => {
|
|
11875
|
+
if (resource.disposed) {
|
|
11876
|
+
return;
|
|
11877
|
+
}
|
|
11878
|
+
resource.disposed = true;
|
|
11879
|
+
resource.values.clear();
|
|
11880
|
+
resource.dispose();
|
|
11881
|
+
};
|
|
11882
|
+
var makeMediaResourceManager = () => {
|
|
11883
|
+
const resources = new Map;
|
|
11884
|
+
let disposed = false;
|
|
11885
|
+
return {
|
|
11886
|
+
acquire: ({
|
|
11887
|
+
key,
|
|
11888
|
+
create
|
|
11889
|
+
}) => {
|
|
11890
|
+
if (disposed) {
|
|
11891
|
+
throw new Error("Media resource manager has already been disposed");
|
|
11892
|
+
}
|
|
11893
|
+
let entry = resources.get(key);
|
|
11894
|
+
if (!entry) {
|
|
11895
|
+
const created = create();
|
|
11896
|
+
entry = {
|
|
11897
|
+
resource: created.resource,
|
|
11898
|
+
dispose: created.dispose,
|
|
11899
|
+
refCount: 0,
|
|
11900
|
+
disposeGeneration: 0,
|
|
11901
|
+
disposed: false,
|
|
11902
|
+
values: new Map
|
|
11903
|
+
};
|
|
11904
|
+
resources.set(key, entry);
|
|
11905
|
+
}
|
|
11906
|
+
entry.refCount++;
|
|
11907
|
+
entry.disposeGeneration++;
|
|
11908
|
+
let released = false;
|
|
11909
|
+
return {
|
|
11910
|
+
resource: entry.resource,
|
|
11911
|
+
getOrCreateValue: (valueKey, createValue) => {
|
|
11912
|
+
if (entry.values.has(valueKey)) {
|
|
11913
|
+
return entry.values.get(valueKey);
|
|
11914
|
+
}
|
|
11915
|
+
const value = createValue();
|
|
11916
|
+
entry.values.set(valueKey, value);
|
|
11917
|
+
return value;
|
|
11918
|
+
},
|
|
11919
|
+
release: () => {
|
|
11920
|
+
if (released) {
|
|
11921
|
+
return;
|
|
11922
|
+
}
|
|
11923
|
+
released = true;
|
|
11924
|
+
entry.refCount--;
|
|
11925
|
+
if (entry.refCount !== 0) {
|
|
11926
|
+
return;
|
|
11927
|
+
}
|
|
11928
|
+
const disposeGeneration = ++entry.disposeGeneration;
|
|
11929
|
+
queueMicrotask(() => {
|
|
11930
|
+
if (entry.refCount !== 0 || entry.disposeGeneration !== disposeGeneration) {
|
|
11931
|
+
return;
|
|
11932
|
+
}
|
|
11933
|
+
if (resources.get(key) === entry) {
|
|
11934
|
+
resources.delete(key);
|
|
11935
|
+
}
|
|
11936
|
+
disposeResource(entry);
|
|
11937
|
+
});
|
|
11938
|
+
}
|
|
11939
|
+
};
|
|
11940
|
+
},
|
|
11941
|
+
invalidate: (key) => {
|
|
11942
|
+
const entry = resources.get(key);
|
|
11943
|
+
if (!entry) {
|
|
11944
|
+
return;
|
|
11945
|
+
}
|
|
11946
|
+
resources.delete(key);
|
|
11947
|
+
entry.disposeGeneration++;
|
|
11948
|
+
if (entry.refCount === 0) {
|
|
11949
|
+
disposeResource(entry);
|
|
11950
|
+
}
|
|
11951
|
+
},
|
|
11952
|
+
dispose: () => {
|
|
11953
|
+
if (disposed) {
|
|
11954
|
+
return;
|
|
11955
|
+
}
|
|
11956
|
+
disposed = true;
|
|
11957
|
+
const entries = Array.from(resources.values());
|
|
11958
|
+
resources.clear();
|
|
11959
|
+
let firstError = null;
|
|
11960
|
+
for (const entry of entries) {
|
|
11961
|
+
try {
|
|
11962
|
+
disposeResource(entry);
|
|
11963
|
+
} catch (error2) {
|
|
11964
|
+
firstError ??= error2;
|
|
11965
|
+
}
|
|
11966
|
+
}
|
|
11967
|
+
if (firstError !== null) {
|
|
11968
|
+
throw firstError;
|
|
11969
|
+
}
|
|
11970
|
+
}
|
|
11971
|
+
};
|
|
11972
|
+
};
|
|
11973
|
+
var getMediabunnyInputResourceKey = ({
|
|
11974
|
+
src,
|
|
11975
|
+
credentials,
|
|
11976
|
+
requestInitFingerprint,
|
|
11977
|
+
revision
|
|
11978
|
+
}) => JSON.stringify([
|
|
11979
|
+
"mediabunny-input",
|
|
11980
|
+
src,
|
|
11981
|
+
credentials,
|
|
11982
|
+
requestInitFingerprint,
|
|
11983
|
+
revision
|
|
11984
|
+
]);
|
|
11985
|
+
var MEDIABUNNY_DURATION_VALUE_KEY = "mediabunny-duration";
|
|
11986
|
+
var globalMediaResourceManager = makeMediaResourceManager();
|
|
11987
|
+
|
|
11873
11988
|
// src/register-root.ts
|
|
11874
11989
|
var Root = null;
|
|
11875
11990
|
var listeners = [];
|
|
@@ -13172,6 +13287,10 @@ var compositionSelectorRef = createRef3();
|
|
|
13172
13287
|
var Internals = {
|
|
13173
13288
|
AbsoluteFillElement,
|
|
13174
13289
|
MaxMediaCacheSizeContext,
|
|
13290
|
+
getMediabunnyInputResourceKey,
|
|
13291
|
+
globalMediaResourceManager,
|
|
13292
|
+
makeMediaResourceManager,
|
|
13293
|
+
MEDIABUNNY_DURATION_VALUE_KEY,
|
|
13175
13294
|
makeRenderResourceManager,
|
|
13176
13295
|
RenderResourceManagerContext,
|
|
13177
13296
|
useUnsafeVideoConfig,
|
package/dist/esm/version.mjs
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
|
|
4
4
|
},
|
|
5
5
|
"name": "remotion",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.515",
|
|
7
7
|
"description": "Make videos programmatically",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-dom": "19.2.3",
|
|
36
36
|
"webpack": "5.105.0",
|
|
37
37
|
"zod": "4.4.3",
|
|
38
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
38
|
+
"@remotion/eslint-config-internal": "4.0.515",
|
|
39
39
|
"eslint": "9.19.0",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
41
41
|
},
|