remotion 4.0.473 → 4.0.475
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 +1 -1
- package/dist/cjs/Img.d.ts +6 -0
- package/dist/cjs/Interactive.d.ts +56 -0
- package/dist/cjs/Interactive.js +119 -0
- package/dist/cjs/Sequence.d.ts +1 -1
- package/dist/cjs/SequenceManager.d.ts +13 -5
- package/dist/cjs/SequenceManager.js +23 -13
- package/dist/cjs/animated-image/AnimatedImage.js +1 -1
- package/dist/cjs/calculate-media-duration.js +1 -1
- package/dist/cjs/canvas-image/CanvasImage.d.ts +6 -0
- package/dist/cjs/effects/use-memoized-effects.d.ts +5 -5
- package/dist/cjs/effects/use-memoized-effects.js +32 -21
- package/dist/cjs/get-effective-visual-mode-value.d.ts +2 -2
- package/dist/cjs/get-effective-visual-mode-value.js +11 -8
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/internals.d.ts +30 -10
- package/dist/cjs/internals.js +5 -3
- package/dist/cjs/interpolate-colors.d.ts +2 -3
- package/dist/cjs/interpolate-colors.js +1 -0
- package/dist/cjs/interpolate-keyframed-status.js +1 -0
- package/dist/cjs/interpolate.js +147 -0
- package/dist/cjs/no-react.d.ts +6 -0
- package/dist/cjs/sequence-field-schema.d.ts +32 -1
- package/dist/cjs/sequence-field-schema.js +6 -0
- package/dist/cjs/use-media-in-timeline.d.ts +1 -1
- package/dist/cjs/use-schema.d.ts +3 -4
- package/dist/cjs/use-schema.js +6 -6
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrap-in-schema.js +3 -3
- package/dist/cjs/wrap-remotion-context.d.ts +2 -0
- package/dist/cjs/wrap-remotion-context.js +7 -1
- package/dist/esm/index.mjs +465 -183
- package/dist/esm/no-react.mjs +139 -0
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ import { type CanUpdateEffectPropsResponse, type CanUpdateEffectPropsResponseFal
|
|
|
18
18
|
import * as TimelinePosition from './timeline-position-state.js';
|
|
19
19
|
import { type PlaybackRateContextValue, type SetTimelineContextValue, type TimelineContextValue } from './TimelineContext.js';
|
|
20
20
|
import { truthy } from './truthy.js';
|
|
21
|
-
import type { CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, DragOverrideValue,
|
|
22
|
-
import { type CanUpdateSequencePropStatus, type
|
|
21
|
+
import type { CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, DragOverrideValue, GetDragOverrides, GetEffectDragOverrides, GetEffectPropStatuses, GetPropStatuses } from './use-schema.js';
|
|
22
|
+
import { type CanUpdateSequencePropStatus, type DragOverrides, type EffectDragOverrides, type PropStatuses } from './use-schema.js';
|
|
23
23
|
import type { MediaVolumeContextValue, SetMediaVolumeContextValue } from './volume-position-state.js';
|
|
24
24
|
import type { WatchRemotionStaticFilesPayload } from './watch-static-file.js';
|
|
25
25
|
import { useRemotionContexts } from './wrap-remotion-context.js';
|
|
@@ -70,10 +70,12 @@ export declare const Internals: {
|
|
|
70
70
|
}, "ref"> & import("react").RefAttributes<HTMLVideoElement>>;
|
|
71
71
|
readonly CompositionManager: import("react").Context<CompositionManagerContext>;
|
|
72
72
|
readonly CompositionSetters: import("react").Context<import("./CompositionManagerContext.js").CompositionManagerSetters>;
|
|
73
|
-
readonly
|
|
73
|
+
readonly VisualModePropStatusesContext: import("react").Context<import("./SequenceManager.js").VisualModePropStatuses>;
|
|
74
|
+
readonly VisualModePropStatusesRefContext: import("react").Context<import("./SequenceManager.js").VisualModePropStatusesRef>;
|
|
74
75
|
readonly VisualModeDragOverridesContext: import("react").Context<import("./SequenceManager.js").VisualModeDragOverrides>;
|
|
75
76
|
readonly VisualModeSettersContext: import("react").Context<import("./SequenceManager.js").VisualModeSetters>;
|
|
76
77
|
readonly SequenceManager: import("react").Context<import("./SequenceManager.js").SequenceManagerContext>;
|
|
78
|
+
readonly SequenceManagerRefContext: import("react").Context<import("./SequenceManager.js").SequenceManagerRef>;
|
|
77
79
|
readonly SequenceStackTracesUpdateContext: import("react").Context<import("./sequence-stack-traces.js").UpdateResolvedStackTraceFn>;
|
|
78
80
|
readonly wrapInSchema: <S extends SequenceSchema, Props extends object>({ Component, schema, supportsEffects, }: {
|
|
79
81
|
Component: import("react").ComponentType<Props & {
|
|
@@ -103,6 +105,12 @@ export declare const Internals: {
|
|
|
103
105
|
readonly description: "Layout";
|
|
104
106
|
readonly variants: {
|
|
105
107
|
readonly 'absolute-fill': {
|
|
108
|
+
readonly 'style.transformOrigin': {
|
|
109
|
+
readonly type: "transform-origin";
|
|
110
|
+
readonly step: 1;
|
|
111
|
+
readonly default: "50% 50%";
|
|
112
|
+
readonly description: "Transform origin";
|
|
113
|
+
};
|
|
106
114
|
readonly 'style.translate': {
|
|
107
115
|
readonly type: "translate";
|
|
108
116
|
readonly step: 1;
|
|
@@ -159,6 +167,12 @@ export declare const Internals: {
|
|
|
159
167
|
};
|
|
160
168
|
readonly SequenceWithoutSchema: import("react").ForwardRefExoticComponent<import("./Sequence.js").SequenceProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
161
169
|
readonly sequenceStyleSchema: {
|
|
170
|
+
readonly 'style.transformOrigin': {
|
|
171
|
+
readonly type: "transform-origin";
|
|
172
|
+
readonly step: 1;
|
|
173
|
+
readonly default: "50% 50%";
|
|
174
|
+
readonly description: "Transform origin";
|
|
175
|
+
};
|
|
162
176
|
readonly 'style.translate': {
|
|
163
177
|
readonly type: "translate";
|
|
164
178
|
readonly step: 1;
|
|
@@ -210,6 +224,12 @@ export declare const Internals: {
|
|
|
210
224
|
};
|
|
211
225
|
};
|
|
212
226
|
readonly sequenceVisualStyleSchema: {
|
|
227
|
+
readonly 'style.transformOrigin': {
|
|
228
|
+
readonly type: "transform-origin";
|
|
229
|
+
readonly step: 1;
|
|
230
|
+
readonly default: "50% 50%";
|
|
231
|
+
readonly description: "Transform origin";
|
|
232
|
+
};
|
|
213
233
|
readonly 'style.translate': {
|
|
214
234
|
readonly type: "translate";
|
|
215
235
|
readonly step: 1;
|
|
@@ -301,7 +321,7 @@ export declare const Internals: {
|
|
|
301
321
|
postmountDisplay: number | null;
|
|
302
322
|
loopDisplay: import("./CompositionManager.js").LoopDisplay | undefined;
|
|
303
323
|
documentationLink: string | null;
|
|
304
|
-
refForOutline: import("react").RefObject<
|
|
324
|
+
refForOutline: import("react").RefObject<Element | null> | null;
|
|
305
325
|
}) => void;
|
|
306
326
|
readonly useLazyComponent: <Props>({ compProps, componentName, noSuspense, }: {
|
|
307
327
|
compProps: CompProps<Props>;
|
|
@@ -638,8 +658,8 @@ export declare const Internals: {
|
|
|
638
658
|
children: import("react").ReactNode;
|
|
639
659
|
collectAssets: import("react").RefObject<import("./RenderAssetManager.js").CollectAssetsRef | null> | null;
|
|
640
660
|
}>;
|
|
641
|
-
readonly getEffectiveVisualModeValue: ({
|
|
642
|
-
|
|
661
|
+
readonly getEffectiveVisualModeValue: ({ propStatus, dragOverrideValue, defaultValue, frame, shouldResortToDefaultValueIfUndefined, }: {
|
|
662
|
+
propStatus: CanUpdateSequencePropStatusKeyframed | CanUpdateSequencePropStatusStatic;
|
|
643
663
|
dragOverrideValue: DragOverrideValue | undefined;
|
|
644
664
|
defaultValue: unknown;
|
|
645
665
|
frame?: number | null | undefined;
|
|
@@ -693,9 +713,9 @@ export declare const Internals: {
|
|
|
693
713
|
value: unknown;
|
|
694
714
|
}) => string[];
|
|
695
715
|
readonly makeSequencePropsSubscriptionKey: (key: SequencePropsSubscriptionKey) => string;
|
|
696
|
-
readonly
|
|
697
|
-
readonly
|
|
698
|
-
|
|
716
|
+
readonly getPropStatusesCtx: (propStatuses: PropStatuses, nodePath: SequencePropsSubscriptionKey) => Record<string, CanUpdateSequencePropStatus> | undefined;
|
|
717
|
+
readonly getEffectPropStatusesCtx: ({ propStatuses, nodePath, effectIndex, }: {
|
|
718
|
+
propStatuses: PropStatuses;
|
|
699
719
|
nodePath: SequencePropsSubscriptionKey;
|
|
700
720
|
effectIndex: number;
|
|
701
721
|
}) => {
|
|
@@ -723,4 +743,4 @@ export declare const Internals: {
|
|
|
723
743
|
readonly hiddenFromList: true;
|
|
724
744
|
};
|
|
725
745
|
};
|
|
726
|
-
export type { ArrayFieldSchema, ArrayItemFieldSchema, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateEffectPropsResponseFalse, CanUpdateEffectPropsResponseTrue, CanUpdateSequencePropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic,
|
|
746
|
+
export type { ArrayFieldSchema, ArrayItemFieldSchema, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateEffectPropsResponseFalse, CanUpdateEffectPropsResponseTrue, CanUpdateSequencePropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, CompositionManagerContext, CompProps, DragOverrides, DragOverrideValue, EffectDragOverrides, GetDragOverrides, GetEffectDragOverrides, GetEffectPropStatuses, GetPropStatuses, LoggingContextValue, MediaVolumeContextValue, NonceHistory, OverrideIdsToNodePathsGettersContext, OverrideIdsToNodePathsSettersContext, OverrideIdToNodePaths, OverrideToNodePathGetters, OverrideToNodeSetters, PlaybackRateContextValue, PropStatuses, RemotionAudioContextState, RemotionEnvironment, ResolvedStackLocation, ScheduleAudioNodeOptions, ScheduleAudioNodeResult, SequenceFieldSchema, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, VisibleFieldSchema, WatchRemotionStaticFilesPayload, };
|
package/dist/cjs/internals.js
CHANGED
|
@@ -134,10 +134,12 @@ exports.Internals = {
|
|
|
134
134
|
VideoForPreview: VideoForPreview_js_1.VideoForPreview,
|
|
135
135
|
CompositionManager: CompositionManagerContext_js_1.CompositionManager,
|
|
136
136
|
CompositionSetters: CompositionManagerContext_js_1.CompositionSetters,
|
|
137
|
-
|
|
137
|
+
VisualModePropStatusesContext: SequenceManager_js_1.VisualModePropStatusesContext,
|
|
138
|
+
VisualModePropStatusesRefContext: SequenceManager_js_1.VisualModePropStatusesRefContext,
|
|
138
139
|
VisualModeDragOverridesContext: SequenceManager_js_1.VisualModeDragOverridesContext,
|
|
139
140
|
VisualModeSettersContext: SequenceManager_js_1.VisualModeSettersContext,
|
|
140
141
|
SequenceManager: SequenceManager_js_1.SequenceManager,
|
|
142
|
+
SequenceManagerRefContext: SequenceManager_js_1.SequenceManagerRefContext,
|
|
141
143
|
SequenceStackTracesUpdateContext: sequence_stack_traces_js_1.SequenceStackTracesUpdateContext,
|
|
142
144
|
wrapInSchema: wrap_in_schema_js_1.wrapInSchema,
|
|
143
145
|
sequenceSchema: sequence_field_schema_js_1.sequenceSchema,
|
|
@@ -256,8 +258,8 @@ exports.Internals = {
|
|
|
256
258
|
OverrideIdsToNodePathsSettersContext: sequence_node_path_js_1.OverrideIdsToNodePathsSettersContext,
|
|
257
259
|
findPropsToDelete: find_props_to_delete_js_1.findPropsToDelete,
|
|
258
260
|
makeSequencePropsSubscriptionKey: SequenceManager_js_1.makeSequencePropsSubscriptionKey,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
+
getPropStatusesCtx: use_memoized_effects_js_1.getPropStatusesCtx,
|
|
262
|
+
getEffectPropStatusesCtx: use_memoized_effects_js_1.getEffectPropStatusesCtx,
|
|
261
263
|
hiddenField: sequence_field_schema_js_1.hiddenField,
|
|
262
264
|
durationInFramesField: sequence_field_schema_js_1.durationInFramesField,
|
|
263
265
|
fromField: sequence_field_schema_js_1.fromField,
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* Copied from:
|
|
3
3
|
* https://github.com/software-mansion/react-native-reanimated/blob/master/src/reanimated2/Colors.ts
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
5
|
+
import { type InterpolateOptions } from './interpolate.js';
|
|
6
|
+
export type InterpolateColorsOptions = Pick<InterpolateOptions, 'easing' | 'posterize'>;
|
|
8
7
|
export declare const colorNames: {
|
|
9
8
|
[key: string]: number;
|
|
10
9
|
};
|
|
@@ -539,6 +539,7 @@ function processColor(color) {
|
|
|
539
539
|
const interpolateColorsRGB = (value, inputRange, colors, options) => {
|
|
540
540
|
const [r, g, b, a] = [red, green, blue, opacity].map((f) => {
|
|
541
541
|
const unrounded = (0, interpolate_js_1.interpolate)(value, inputRange, colors.map((c) => f(c)), {
|
|
542
|
+
easing: options === null || options === void 0 ? void 0 : options.easing,
|
|
542
543
|
extrapolateLeft: 'clamp',
|
|
543
544
|
extrapolateRight: 'clamp',
|
|
544
545
|
posterize: options === null || options === void 0 ? void 0 : options.posterize,
|
package/dist/cjs/interpolate.js
CHANGED
|
@@ -42,6 +42,32 @@ const lengthUnits = new Set([
|
|
|
42
42
|
'vw',
|
|
43
43
|
]);
|
|
44
44
|
const cssNumberRegex = /^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/;
|
|
45
|
+
const transformOriginKeywords = new Set([
|
|
46
|
+
'left',
|
|
47
|
+
'center',
|
|
48
|
+
'right',
|
|
49
|
+
'top',
|
|
50
|
+
'bottom',
|
|
51
|
+
]);
|
|
52
|
+
const transformOriginKeywordOptions = (keyword) => {
|
|
53
|
+
if (keyword === 'left') {
|
|
54
|
+
return [{ axis: 'x', value: { value: 0, unit: '%' } }];
|
|
55
|
+
}
|
|
56
|
+
if (keyword === 'right') {
|
|
57
|
+
return [{ axis: 'x', value: { value: 100, unit: '%' } }];
|
|
58
|
+
}
|
|
59
|
+
if (keyword === 'top') {
|
|
60
|
+
return [{ axis: 'y', value: { value: 0, unit: '%' } }];
|
|
61
|
+
}
|
|
62
|
+
if (keyword === 'bottom') {
|
|
63
|
+
return [{ axis: 'y', value: { value: 100, unit: '%' } }];
|
|
64
|
+
}
|
|
65
|
+
return [
|
|
66
|
+
{ axis: 'x', value: { value: 50, unit: '%' } },
|
|
67
|
+
{ axis: 'y', value: { value: 50, unit: '%' } },
|
|
68
|
+
];
|
|
69
|
+
};
|
|
70
|
+
const transformOriginCenter = { value: 50, unit: '%' };
|
|
45
71
|
const stringifyNumber = (value) => {
|
|
46
72
|
return String((0, normalize_number_js_1.normalizeNumber)(value));
|
|
47
73
|
};
|
|
@@ -67,6 +93,124 @@ const parseStringInterpolationComponent = (component, value) => {
|
|
|
67
93
|
}
|
|
68
94
|
throw new TypeError(`Cannot interpolate "${value}" because "${unit}" is not a supported translate or rotate unit`);
|
|
69
95
|
};
|
|
96
|
+
const parseTransformOriginLengthPercentage = ({ component, value, allowPercentage, }) => {
|
|
97
|
+
var _a;
|
|
98
|
+
const match = cssNumberRegex.exec(component);
|
|
99
|
+
if (match === null) {
|
|
100
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not a supported transform-origin ${allowPercentage ? 'length-percentage' : 'z length'}`);
|
|
101
|
+
}
|
|
102
|
+
const unit = (_a = match[2]) !== null && _a !== void 0 ? _a : null;
|
|
103
|
+
const numberValue = Number(match[1]);
|
|
104
|
+
if (!Number.isFinite(numberValue)) {
|
|
105
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not finite`);
|
|
106
|
+
}
|
|
107
|
+
if (unit === null ||
|
|
108
|
+
!lengthUnits.has(unit) ||
|
|
109
|
+
(!allowPercentage && unit === '%')) {
|
|
110
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not a supported transform-origin ${allowPercentage ? 'length-percentage' : 'z length'}`);
|
|
111
|
+
}
|
|
112
|
+
return { value: numberValue, unit };
|
|
113
|
+
};
|
|
114
|
+
const parseTransformOriginToken = (component, value) => {
|
|
115
|
+
const lower = component.toLowerCase();
|
|
116
|
+
if (transformOriginKeywords.has(lower)) {
|
|
117
|
+
return { type: 'keyword', keyword: lower };
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
type: 'length-percentage',
|
|
121
|
+
parsed: parseTransformOriginLengthPercentage({
|
|
122
|
+
component,
|
|
123
|
+
value,
|
|
124
|
+
allowPercentage: true,
|
|
125
|
+
}),
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
const parseTwoTransformOriginKeywords = (first, second, value) => {
|
|
129
|
+
const candidates = [];
|
|
130
|
+
for (const firstOption of transformOriginKeywordOptions(first)) {
|
|
131
|
+
for (const secondOption of transformOriginKeywordOptions(second)) {
|
|
132
|
+
if (firstOption.axis === secondOption.axis) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
candidates.push(firstOption.axis === 'x'
|
|
136
|
+
? [firstOption.value, secondOption.value]
|
|
137
|
+
: [secondOption.value, firstOption.value]);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (candidates.length === 0) {
|
|
141
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${first} ${second}" is not a valid transform-origin keyword pair`);
|
|
142
|
+
}
|
|
143
|
+
return candidates[0];
|
|
144
|
+
};
|
|
145
|
+
const parseTransformOriginXY = (parts, value) => {
|
|
146
|
+
if (parts.length === 1) {
|
|
147
|
+
const token = parseTransformOriginToken(parts[0], value);
|
|
148
|
+
if (token.type === 'length-percentage') {
|
|
149
|
+
return [token.parsed, transformOriginCenter];
|
|
150
|
+
}
|
|
151
|
+
if (token.keyword === 'top' || token.keyword === 'bottom') {
|
|
152
|
+
return [
|
|
153
|
+
transformOriginCenter,
|
|
154
|
+
transformOriginKeywordOptions(token.keyword)[0].value,
|
|
155
|
+
];
|
|
156
|
+
}
|
|
157
|
+
return [
|
|
158
|
+
transformOriginKeywordOptions(token.keyword)[0].value,
|
|
159
|
+
transformOriginCenter,
|
|
160
|
+
];
|
|
161
|
+
}
|
|
162
|
+
const first = parseTransformOriginToken(parts[0], value);
|
|
163
|
+
const second = parseTransformOriginToken(parts[1], value);
|
|
164
|
+
if (first.type === 'length-percentage' &&
|
|
165
|
+
second.type === 'length-percentage') {
|
|
166
|
+
return [first.parsed, second.parsed];
|
|
167
|
+
}
|
|
168
|
+
if (first.type === 'keyword' && second.type === 'keyword') {
|
|
169
|
+
return parseTwoTransformOriginKeywords(first.keyword, second.keyword, value);
|
|
170
|
+
}
|
|
171
|
+
const keyword = first.type === 'keyword'
|
|
172
|
+
? first
|
|
173
|
+
: second.type === 'keyword'
|
|
174
|
+
? second
|
|
175
|
+
: null;
|
|
176
|
+
const length = first.type === 'length-percentage'
|
|
177
|
+
? first.parsed
|
|
178
|
+
: second.type === 'length-percentage'
|
|
179
|
+
? second.parsed
|
|
180
|
+
: null;
|
|
181
|
+
if (keyword === null || length === null) {
|
|
182
|
+
throw new Error('Expected a keyword and a length-percentage value');
|
|
183
|
+
}
|
|
184
|
+
const keywordIsFirst = first.type === 'keyword';
|
|
185
|
+
if (keyword.keyword === 'left' || keyword.keyword === 'right') {
|
|
186
|
+
if (!keywordIsFirst) {
|
|
187
|
+
throw new TypeError(`Cannot interpolate "${value}" because horizontal transform-origin keywords must come before a length-percentage value`);
|
|
188
|
+
}
|
|
189
|
+
return [transformOriginKeywordOptions(keyword.keyword)[0].value, length];
|
|
190
|
+
}
|
|
191
|
+
if (keyword.keyword === 'top' || keyword.keyword === 'bottom') {
|
|
192
|
+
return [length, transformOriginKeywordOptions(keyword.keyword)[0].value];
|
|
193
|
+
}
|
|
194
|
+
return keywordIsFirst
|
|
195
|
+
? [transformOriginCenter, length]
|
|
196
|
+
: [length, transformOriginCenter];
|
|
197
|
+
};
|
|
198
|
+
const parseTransformOriginValue = (output, parts) => {
|
|
199
|
+
const [x, y] = parseTransformOriginXY(parts.slice(0, 2), output);
|
|
200
|
+
const z = parts[2] === undefined
|
|
201
|
+
? { value: 0, unit: null }
|
|
202
|
+
: parseTransformOriginLengthPercentage({
|
|
203
|
+
component: parts[2],
|
|
204
|
+
value: output,
|
|
205
|
+
allowPercentage: false,
|
|
206
|
+
});
|
|
207
|
+
return {
|
|
208
|
+
kind: 'translate',
|
|
209
|
+
values: [x.value, y.value, z.value],
|
|
210
|
+
units: [x.unit, y.unit, z.unit],
|
|
211
|
+
dimensions: parts[2] === undefined ? 2 : 3,
|
|
212
|
+
};
|
|
213
|
+
};
|
|
70
214
|
const parseStringInterpolationValue = (output) => {
|
|
71
215
|
var _a, _b, _c, _d, _e, _f;
|
|
72
216
|
var _g, _h, _j, _k, _l, _m;
|
|
@@ -85,6 +229,9 @@ const parseStringInterpolationValue = (output) => {
|
|
|
85
229
|
if (parts.length < 1 || parts.length > 3 || parts[0] === '') {
|
|
86
230
|
throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${output}"`);
|
|
87
231
|
}
|
|
232
|
+
if (parts.some((part) => transformOriginKeywords.has(part.toLowerCase()))) {
|
|
233
|
+
return parseTransformOriginValue(output, parts);
|
|
234
|
+
}
|
|
88
235
|
const parsed = parts.map((part) => parseStringInterpolationComponent(part, output));
|
|
89
236
|
const [{ kind }] = parsed;
|
|
90
237
|
for (const part of parsed) {
|
package/dist/cjs/no-react.d.ts
CHANGED
|
@@ -82,6 +82,12 @@ export declare const NoReactInternals: {
|
|
|
82
82
|
readonly description: "Layout";
|
|
83
83
|
readonly variants: {
|
|
84
84
|
readonly 'absolute-fill': {
|
|
85
|
+
readonly 'style.transformOrigin': {
|
|
86
|
+
readonly type: "transform-origin";
|
|
87
|
+
readonly step: 1;
|
|
88
|
+
readonly default: "50% 50%";
|
|
89
|
+
readonly description: "Transform origin";
|
|
90
|
+
};
|
|
85
91
|
readonly 'style.translate': {
|
|
86
92
|
readonly type: "translate";
|
|
87
93
|
readonly step: 1;
|
|
@@ -41,6 +41,13 @@ export type TranslateFieldSchema = {
|
|
|
41
41
|
description?: string;
|
|
42
42
|
keyframable?: boolean;
|
|
43
43
|
};
|
|
44
|
+
export type TransformOriginFieldSchema = {
|
|
45
|
+
type: 'transform-origin';
|
|
46
|
+
step?: number;
|
|
47
|
+
default: string | undefined;
|
|
48
|
+
description?: string;
|
|
49
|
+
keyframable?: boolean;
|
|
50
|
+
};
|
|
44
51
|
export type ScaleFieldSchema = {
|
|
45
52
|
type: 'scale';
|
|
46
53
|
min?: number;
|
|
@@ -95,13 +102,19 @@ export type ArrayFieldSchema = {
|
|
|
95
102
|
description?: string;
|
|
96
103
|
keyframable?: false;
|
|
97
104
|
};
|
|
98
|
-
export type VisibleFieldSchema = NumberFieldSchema | BooleanFieldSchema | RotationCssFieldSchema | RotationDegreesFieldSchema | TranslateFieldSchema | ScaleFieldSchema | UvCoordinateFieldSchema | ColorFieldSchema | ArrayFieldSchema | EnumFieldSchema;
|
|
105
|
+
export type VisibleFieldSchema = NumberFieldSchema | BooleanFieldSchema | RotationCssFieldSchema | RotationDegreesFieldSchema | TranslateFieldSchema | TransformOriginFieldSchema | ScaleFieldSchema | UvCoordinateFieldSchema | ColorFieldSchema | ArrayFieldSchema | EnumFieldSchema;
|
|
99
106
|
export type SequenceFieldSchema = VisibleFieldSchema | HiddenFieldSchema;
|
|
100
107
|
export type SequenceSchema = {
|
|
101
108
|
[key: string]: SequenceFieldSchema;
|
|
102
109
|
};
|
|
103
110
|
export type SchemaKeysRecord<S extends SequenceSchema> = Record<keyof S, unknown>;
|
|
104
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
|
+
};
|
|
105
118
|
readonly 'style.translate': {
|
|
106
119
|
readonly type: "translate";
|
|
107
120
|
readonly step: 1;
|
|
@@ -155,6 +168,12 @@ export declare const sequencePremountSchema: {
|
|
|
155
168
|
};
|
|
156
169
|
};
|
|
157
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
|
+
};
|
|
158
177
|
readonly 'style.translate': {
|
|
159
178
|
readonly type: "translate";
|
|
160
179
|
readonly step: 1;
|
|
@@ -240,6 +259,12 @@ export declare const sequenceSchema: {
|
|
|
240
259
|
readonly description: "Layout";
|
|
241
260
|
readonly variants: {
|
|
242
261
|
readonly 'absolute-fill': {
|
|
262
|
+
readonly 'style.transformOrigin': {
|
|
263
|
+
readonly type: "transform-origin";
|
|
264
|
+
readonly step: 1;
|
|
265
|
+
readonly default: "50% 50%";
|
|
266
|
+
readonly description: "Transform origin";
|
|
267
|
+
};
|
|
243
268
|
readonly 'style.translate': {
|
|
244
269
|
readonly type: "translate";
|
|
245
270
|
readonly step: 1;
|
|
@@ -309,6 +334,12 @@ export declare const sequenceSchemaWithoutFrom: {
|
|
|
309
334
|
readonly description: "Layout";
|
|
310
335
|
readonly variants: {
|
|
311
336
|
readonly 'absolute-fill': {
|
|
337
|
+
readonly 'style.transformOrigin': {
|
|
338
|
+
readonly type: "transform-origin";
|
|
339
|
+
readonly step: 1;
|
|
340
|
+
readonly default: "50% 50%";
|
|
341
|
+
readonly description: "Transform origin";
|
|
342
|
+
};
|
|
312
343
|
readonly 'style.translate': {
|
|
313
344
|
readonly type: "translate";
|
|
314
345
|
readonly step: 1;
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sequenceSchemaDefaultLayoutNone = exports.sequenceSchemaWithoutFrom = exports.sequenceSchema = exports.fromField = exports.durationInFramesField = exports.hiddenField = exports.sequenceStyleSchema = exports.sequencePremountSchema = exports.sequenceVisualStyleSchema = void 0;
|
|
4
4
|
exports.sequenceVisualStyleSchema = {
|
|
5
|
+
'style.transformOrigin': {
|
|
6
|
+
type: 'transform-origin',
|
|
7
|
+
step: 1,
|
|
8
|
+
default: '50% 50%',
|
|
9
|
+
description: 'Transform origin',
|
|
10
|
+
},
|
|
5
11
|
'style.translate': {
|
|
6
12
|
type: 'translate',
|
|
7
13
|
step: 1,
|
|
@@ -38,5 +38,5 @@ export declare const useMediaInTimeline: ({ volume, mediaVolume, src, mediaType,
|
|
|
38
38
|
postmountDisplay: number | null;
|
|
39
39
|
loopDisplay: LoopDisplay | undefined;
|
|
40
40
|
documentationLink: string | null;
|
|
41
|
-
refForOutline: import("react").RefObject<
|
|
41
|
+
refForOutline: import("react").RefObject<Element | null> | null;
|
|
42
42
|
}) => void;
|
package/dist/cjs/use-schema.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export type CanUpdateSequencePropStatusComputed = {
|
|
|
20
20
|
};
|
|
21
21
|
export type CanUpdateSequencePropStatusKeyframed = {
|
|
22
22
|
status: 'keyframed';
|
|
23
|
-
codeValue: unknown;
|
|
24
23
|
interpolationFunction: CanUpdateSequencePropStatusInterpolationFunction;
|
|
25
24
|
keyframes: CanUpdateSequencePropStatusKeyframe[];
|
|
26
25
|
easing: CanUpdateSequencePropStatusEasing[];
|
|
@@ -38,9 +37,9 @@ export type DragOverrideValue = {
|
|
|
38
37
|
};
|
|
39
38
|
export type DragOverrides = Record<string, Record<string, DragOverrideValue>>;
|
|
40
39
|
export type EffectDragOverrides = Record<string, Record<string, DragOverrideValue>>;
|
|
41
|
-
export type
|
|
42
|
-
export type
|
|
43
|
-
export type
|
|
40
|
+
export type PropStatuses = Record<string, CanUpdateSequencePropsResponse>;
|
|
41
|
+
export type GetPropStatuses = (nodePath: SequencePropsSubscriptionKey) => Record<string, CanUpdateSequencePropStatus> | undefined;
|
|
42
|
+
export type GetEffectPropStatuses = (nodePath: SequencePropsSubscriptionKey, effectIndex: number) => Record<string, CanUpdateSequencePropStatus> | undefined;
|
|
44
43
|
export type GetDragOverrides = (nodePath: SequencePropsSubscriptionKey) => DragOverrides[string];
|
|
45
44
|
export type GetEffectDragOverrides = (nodePath: SequencePropsSubscriptionKey, effectIndex: number) => Record<string, DragOverrideValue>;
|
|
46
45
|
export declare const makeStaticDragOverride: (value: unknown) => DragOverrideValue;
|
package/dist/cjs/use-schema.js
CHANGED
|
@@ -64,16 +64,16 @@ const computeEffectiveSchemaValuesDotNotation = ({ schema, currentValue, overrid
|
|
|
64
64
|
const merged = {};
|
|
65
65
|
const propsToDelete = new Set();
|
|
66
66
|
for (const key of Object.keys(currentValue)) {
|
|
67
|
-
const
|
|
67
|
+
const status = (_b = propStatus === null || propStatus === void 0 ? void 0 : propStatus[key]) !== null && _b !== void 0 ? _b : null;
|
|
68
68
|
const field = findFieldInSchema(schema, key);
|
|
69
69
|
if ((field === null || field === void 0 ? void 0 : field.type) === 'hidden') {
|
|
70
70
|
continue;
|
|
71
71
|
}
|
|
72
72
|
let value;
|
|
73
|
-
if (
|
|
73
|
+
if (status === null) {
|
|
74
74
|
value = currentValue[key];
|
|
75
75
|
}
|
|
76
|
-
else if ((0, exports.isKeyframedStatus)(
|
|
76
|
+
else if ((0, exports.isKeyframedStatus)(status)) {
|
|
77
77
|
if ((field === null || field === void 0 ? void 0 : field.type) === 'array' || (field === null || field === void 0 ? void 0 : field.keyframable) === false) {
|
|
78
78
|
value = currentValue[key];
|
|
79
79
|
}
|
|
@@ -88,7 +88,7 @@ const computeEffectiveSchemaValuesDotNotation = ({ schema, currentValue, overrid
|
|
|
88
88
|
else if (frame !== null) {
|
|
89
89
|
const interpolated = (0, interpolate_keyframed_status_js_1.interpolateKeyframedStatus)({
|
|
90
90
|
frame,
|
|
91
|
-
status
|
|
91
|
+
status,
|
|
92
92
|
});
|
|
93
93
|
value = interpolated !== null && interpolated !== void 0 ? interpolated : currentValue[key];
|
|
94
94
|
}
|
|
@@ -97,12 +97,12 @@ const computeEffectiveSchemaValuesDotNotation = ({ schema, currentValue, overrid
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
else if (
|
|
100
|
+
else if (status.status === 'computed') {
|
|
101
101
|
value = currentValue[key];
|
|
102
102
|
}
|
|
103
103
|
else {
|
|
104
104
|
value = (0, get_effective_visual_mode_value_js_1.getEffectiveVisualModeValue)({
|
|
105
|
-
|
|
105
|
+
propStatus: status,
|
|
106
106
|
dragOverrideValue: overrideValues[key],
|
|
107
107
|
defaultValue: field === null || field === void 0 ? void 0 : field.default,
|
|
108
108
|
frame,
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -112,7 +112,7 @@ const wrapInSchema = ({ Component, schema, supportsEffects, }) => {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
115
|
-
const {
|
|
115
|
+
const { propStatuses } = (0, react_1.useContext)(SequenceManager_js_1.VisualModePropStatusesContext);
|
|
116
116
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
117
117
|
const { getDragOverrides } = (0, react_1.useContext)(SequenceManager_js_1.VisualModeDragOverridesContext);
|
|
118
118
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -169,14 +169,14 @@ const wrapInSchema = ({ Component, schema, supportsEffects, }) => {
|
|
|
169
169
|
overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
|
|
170
170
|
propStatus: nodePath === null
|
|
171
171
|
? undefined
|
|
172
|
-
: (0, use_memoized_effects_js_1.
|
|
172
|
+
: (0, use_memoized_effects_js_1.getPropStatusesCtx)(propStatuses, nodePath),
|
|
173
173
|
frame,
|
|
174
174
|
});
|
|
175
175
|
}, [
|
|
176
176
|
currentRuntimeValueDotNotation,
|
|
177
177
|
getDragOverrides,
|
|
178
178
|
nodePath,
|
|
179
|
-
|
|
179
|
+
propStatuses,
|
|
180
180
|
frame,
|
|
181
181
|
]);
|
|
182
182
|
// 4. Eliminate values forbidden by the resolved discriminated union.
|
|
@@ -25,6 +25,8 @@ export declare function useRemotionContexts(): {
|
|
|
25
25
|
} | null;
|
|
26
26
|
renderAssetManagerContext: import("./RenderAssetManager.js").RenderAssetManagerContext;
|
|
27
27
|
sequenceManagerContext: import("./SequenceManager.js").SequenceManagerContext;
|
|
28
|
+
sequenceManagerRefContext: import("./SequenceManager.js").SequenceManagerRef;
|
|
29
|
+
visualModePropStatusesRefContext: import("./SequenceManager.js").VisualModePropStatusesRef;
|
|
28
30
|
bufferManagerContext: {
|
|
29
31
|
addBlock: (block: {
|
|
30
32
|
id: string;
|
|
@@ -62,6 +62,8 @@ function useRemotionContexts() {
|
|
|
62
62
|
const resolveCompositionContext = react_1.default.useContext(ResolveCompositionConfig_js_1.ResolveCompositionContext);
|
|
63
63
|
const renderAssetManagerContext = react_1.default.useContext(RenderAssetManager_js_1.RenderAssetManager);
|
|
64
64
|
const sequenceManagerContext = react_1.default.useContext(SequenceManager_js_1.SequenceManager);
|
|
65
|
+
const sequenceManagerRefContext = react_1.default.useContext(SequenceManager_js_1.SequenceManagerRefContext);
|
|
66
|
+
const visualModePropStatusesRefContext = react_1.default.useContext(SequenceManager_js_1.VisualModePropStatusesRefContext);
|
|
65
67
|
const bufferManagerContext = react_1.default.useContext(buffering_js_1.BufferingContextReact);
|
|
66
68
|
const logLevelContext = react_1.default.useContext(log_level_context_js_1.LogLevelContext);
|
|
67
69
|
return (0, react_1.useMemo)(() => ({
|
|
@@ -75,6 +77,8 @@ function useRemotionContexts() {
|
|
|
75
77
|
resolveCompositionContext,
|
|
76
78
|
renderAssetManagerContext,
|
|
77
79
|
sequenceManagerContext,
|
|
80
|
+
sequenceManagerRefContext,
|
|
81
|
+
visualModePropStatusesRefContext,
|
|
78
82
|
bufferManagerContext,
|
|
79
83
|
logLevelContext,
|
|
80
84
|
}), [
|
|
@@ -88,12 +92,14 @@ function useRemotionContexts() {
|
|
|
88
92
|
resolveCompositionContext,
|
|
89
93
|
renderAssetManagerContext,
|
|
90
94
|
sequenceManagerContext,
|
|
95
|
+
sequenceManagerRefContext,
|
|
96
|
+
visualModePropStatusesRefContext,
|
|
91
97
|
bufferManagerContext,
|
|
92
98
|
logLevelContext,
|
|
93
99
|
]);
|
|
94
100
|
}
|
|
95
101
|
const RemotionContextProvider = (props) => {
|
|
96
102
|
const { children, contexts } = props;
|
|
97
|
-
return (jsx_runtime_1.jsx(log_level_context_js_1.LogLevelContext.Provider, { value: contexts.logLevelContext, children: jsx_runtime_1.jsx(CanUseRemotionHooks_js_1.CanUseRemotionHooks.Provider, { value: contexts.canUseRemotionHooksContext, children: jsx_runtime_1.jsx(nonce_js_1.NonceContext.Provider, { value: contexts.nonceContext, children: jsx_runtime_1.jsx(prefetch_state_js_1.PreloadContext.Provider, { value: contexts.preloadContext, children: jsx_runtime_1.jsx(CompositionManagerContext_js_1.CompositionManager.Provider, { value: contexts.compositionManagerCtx, children: jsx_runtime_1.jsx(SequenceManager_js_1.SequenceManager.Provider, { value: contexts.sequenceManagerContext, children: jsx_runtime_1.jsx(RenderAssetManager_js_1.RenderAssetManager.Provider, { value: contexts.renderAssetManagerContext, children: jsx_runtime_1.jsx(ResolveCompositionConfig_js_1.ResolveCompositionContext.Provider, { value: contexts.resolveCompositionContext, children: jsx_runtime_1.jsx(TimelineContext_js_1.TimelineContext.Provider, { value: contexts.timelineContext, children: jsx_runtime_1.jsx(TimelineContext_js_1.SetTimelineContext.Provider, { value: contexts.setTimelineContext, children: jsx_runtime_1.jsx(SequenceContext_js_1.SequenceContext.Provider, { value: contexts.sequenceContext, children: jsx_runtime_1.jsx(buffering_js_1.BufferingContextReact.Provider, { value: contexts.bufferManagerContext, children: children }) }) }) }) }) }) }) }) }) }) }) }));
|
|
103
|
+
return (jsx_runtime_1.jsx(log_level_context_js_1.LogLevelContext.Provider, { value: contexts.logLevelContext, children: jsx_runtime_1.jsx(CanUseRemotionHooks_js_1.CanUseRemotionHooks.Provider, { value: contexts.canUseRemotionHooksContext, children: jsx_runtime_1.jsx(nonce_js_1.NonceContext.Provider, { value: contexts.nonceContext, children: jsx_runtime_1.jsx(prefetch_state_js_1.PreloadContext.Provider, { value: contexts.preloadContext, children: jsx_runtime_1.jsx(CompositionManagerContext_js_1.CompositionManager.Provider, { value: contexts.compositionManagerCtx, children: jsx_runtime_1.jsx(SequenceManager_js_1.SequenceManagerRefContext.Provider, { value: contexts.sequenceManagerRefContext, children: jsx_runtime_1.jsx(SequenceManager_js_1.SequenceManager.Provider, { value: contexts.sequenceManagerContext, children: jsx_runtime_1.jsx(SequenceManager_js_1.VisualModePropStatusesRefContext.Provider, { value: contexts.visualModePropStatusesRefContext, children: jsx_runtime_1.jsx(RenderAssetManager_js_1.RenderAssetManager.Provider, { value: contexts.renderAssetManagerContext, children: jsx_runtime_1.jsx(ResolveCompositionConfig_js_1.ResolveCompositionContext.Provider, { value: contexts.resolveCompositionContext, children: jsx_runtime_1.jsx(TimelineContext_js_1.TimelineContext.Provider, { value: contexts.timelineContext, children: jsx_runtime_1.jsx(TimelineContext_js_1.SetTimelineContext.Provider, { value: contexts.setTimelineContext, children: jsx_runtime_1.jsx(SequenceContext_js_1.SequenceContext.Provider, { value: contexts.sequenceContext, children: jsx_runtime_1.jsx(buffering_js_1.BufferingContextReact.Provider, { value: contexts.bufferManagerContext, children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
98
104
|
};
|
|
99
105
|
exports.RemotionContextProvider = RemotionContextProvider;
|