@remotion/studio 4.0.429 → 4.0.431
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/components/NewComposition/InputDragger.js +1 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +87 -20
- package/dist/components/Timeline/TimelineListItem.js +5 -2
- package/dist/components/Timeline/TimelineSchemaField.d.ts +0 -1
- package/dist/components/Timeline/TimelineSchemaField.js +33 -16
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/TimelineTracks.js +4 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +49 -34
- package/dist/esm/{chunk-0rv5nqc6.js → chunk-3msfwcwh.js} +407 -354
- package/dist/esm/internals.mjs +407 -354
- package/dist/esm/previewEntry.mjs +407 -355
- package/dist/esm/renderEntry.mjs +1 -2
- package/dist/helpers/extract-frames.js +23 -7
- package/dist/helpers/get-timeline-sequence-layout.js +4 -18
- package/dist/helpers/timeline-layout.d.ts +3 -3
- package/dist/helpers/timeline-layout.js +4 -16
- package/dist/previewEntry.js +0 -1
- package/dist/renderEntry.js +0 -1
- package/package.json +12 -11
|
@@ -2916,184 +2916,6 @@ var setCurrentFps = (d) => {
|
|
|
2916
2916
|
// src/components/Timeline/timeline-scroll-logic.ts
|
|
2917
2917
|
import { interpolate } from "remotion";
|
|
2918
2918
|
|
|
2919
|
-
// src/components/RenderModal/SchemaEditor/zod-schema-type.ts
|
|
2920
|
-
var zodSafeParse = (schema, data) => {
|
|
2921
|
-
return schema.safeParse(data);
|
|
2922
|
-
};
|
|
2923
|
-
var getZodDef = (schema) => {
|
|
2924
|
-
if (schema._def)
|
|
2925
|
-
return schema._def;
|
|
2926
|
-
if (schema._zod)
|
|
2927
|
-
return schema._zod.def;
|
|
2928
|
-
throw new Error("Invalid zod schema: missing _def and _zod");
|
|
2929
|
-
};
|
|
2930
|
-
var v3TypeNameMap = {
|
|
2931
|
-
ZodString: "string",
|
|
2932
|
-
ZodNumber: "number",
|
|
2933
|
-
ZodBoolean: "boolean",
|
|
2934
|
-
ZodObject: "object",
|
|
2935
|
-
ZodArray: "array",
|
|
2936
|
-
ZodEnum: "enum",
|
|
2937
|
-
ZodUnion: "union",
|
|
2938
|
-
ZodDiscriminatedUnion: "discriminatedUnion",
|
|
2939
|
-
ZodOptional: "optional",
|
|
2940
|
-
ZodNullable: "nullable",
|
|
2941
|
-
ZodDefault: "default",
|
|
2942
|
-
ZodTuple: "tuple",
|
|
2943
|
-
ZodDate: "date",
|
|
2944
|
-
ZodAny: "any",
|
|
2945
|
-
ZodUnknown: "unknown",
|
|
2946
|
-
ZodBigInt: "bigint",
|
|
2947
|
-
ZodNull: "null",
|
|
2948
|
-
ZodUndefined: "undefined",
|
|
2949
|
-
ZodEffects: "effects",
|
|
2950
|
-
ZodLiteral: "literal",
|
|
2951
|
-
ZodRecord: "record",
|
|
2952
|
-
ZodNever: "never",
|
|
2953
|
-
ZodVoid: "void",
|
|
2954
|
-
ZodNaN: "nan",
|
|
2955
|
-
ZodSymbol: "symbol",
|
|
2956
|
-
ZodIntersection: "intersection",
|
|
2957
|
-
ZodMap: "map",
|
|
2958
|
-
ZodSet: "set",
|
|
2959
|
-
ZodLazy: "lazy",
|
|
2960
|
-
ZodFunction: "function",
|
|
2961
|
-
ZodNativeEnum: "nativeEnum",
|
|
2962
|
-
ZodCatch: "catch",
|
|
2963
|
-
ZodPromise: "promise",
|
|
2964
|
-
ZodBranded: "branded",
|
|
2965
|
-
ZodPipeline: "pipeline"
|
|
2966
|
-
};
|
|
2967
|
-
var isZodV3Schema = (schema) => {
|
|
2968
|
-
const def = getZodDef(schema);
|
|
2969
|
-
return "typeName" in def;
|
|
2970
|
-
};
|
|
2971
|
-
var getZodSchemaType = (schema) => {
|
|
2972
|
-
const def = getZodDef(schema);
|
|
2973
|
-
if ("typeName" in def) {
|
|
2974
|
-
const { typeName } = def;
|
|
2975
|
-
return v3TypeNameMap[typeName] ?? typeName;
|
|
2976
|
-
}
|
|
2977
|
-
const { type } = def;
|
|
2978
|
-
if (type === "union" && def.discriminator !== undefined) {
|
|
2979
|
-
return "discriminatedUnion";
|
|
2980
|
-
}
|
|
2981
|
-
return type;
|
|
2982
|
-
};
|
|
2983
|
-
var getZodSchemaDescription = (schema) => {
|
|
2984
|
-
if (isZodV3Schema(schema)) {
|
|
2985
|
-
return getZodDef(schema).description;
|
|
2986
|
-
}
|
|
2987
|
-
return schema.description;
|
|
2988
|
-
};
|
|
2989
|
-
var getObjectShape = (schema) => {
|
|
2990
|
-
const { shape } = getZodDef(schema);
|
|
2991
|
-
return typeof shape === "function" ? shape() : shape;
|
|
2992
|
-
};
|
|
2993
|
-
var getArrayElement = (schema) => {
|
|
2994
|
-
const def = getZodDef(schema);
|
|
2995
|
-
return isZodV3Schema(schema) ? def.type : def.element;
|
|
2996
|
-
};
|
|
2997
|
-
var getInnerType = (schema) => {
|
|
2998
|
-
return getZodDef(schema).innerType;
|
|
2999
|
-
};
|
|
3000
|
-
var getEffectsInner = (schema) => {
|
|
3001
|
-
return getZodDef(schema).schema;
|
|
3002
|
-
};
|
|
3003
|
-
var getLiteralValue = (schema) => {
|
|
3004
|
-
const def = getZodDef(schema);
|
|
3005
|
-
if (isZodV3Schema(schema)) {
|
|
3006
|
-
return def.value;
|
|
3007
|
-
}
|
|
3008
|
-
return def.values?.[0];
|
|
3009
|
-
};
|
|
3010
|
-
var getEnumValues = (schema) => {
|
|
3011
|
-
const def = getZodDef(schema);
|
|
3012
|
-
if (isZodV3Schema(schema)) {
|
|
3013
|
-
return def.values;
|
|
3014
|
-
}
|
|
3015
|
-
const { entries } = def;
|
|
3016
|
-
return Object.values(entries);
|
|
3017
|
-
};
|
|
3018
|
-
var getFirstEnumValue = (schema) => {
|
|
3019
|
-
const def = getZodDef(schema);
|
|
3020
|
-
if (isZodV3Schema(schema)) {
|
|
3021
|
-
if (def.typeName === "ZodNativeEnum") {
|
|
3022
|
-
const vals = Object.values(def.values);
|
|
3023
|
-
return vals[0];
|
|
3024
|
-
}
|
|
3025
|
-
return def.values[0];
|
|
3026
|
-
}
|
|
3027
|
-
const { entries } = def;
|
|
3028
|
-
const pairs = Object.entries(entries);
|
|
3029
|
-
const hasReverseMapping = pairs.some(([key, value]) => key !== String(value));
|
|
3030
|
-
if (hasReverseMapping) {
|
|
3031
|
-
const forwardPairs = pairs.filter(([key]) => Number.isNaN(Number(key)));
|
|
3032
|
-
if (forwardPairs.length > 0) {
|
|
3033
|
-
return forwardPairs[0][1];
|
|
3034
|
-
}
|
|
3035
|
-
}
|
|
3036
|
-
return Object.values(entries)[0];
|
|
3037
|
-
};
|
|
3038
|
-
var getUnionOptions = (schema) => {
|
|
3039
|
-
return getZodDef(schema).options;
|
|
3040
|
-
};
|
|
3041
|
-
var getDefaultValue = (schema) => {
|
|
3042
|
-
const dv = getZodDef(schema).defaultValue;
|
|
3043
|
-
return typeof dv === "function" ? dv() : dv;
|
|
3044
|
-
};
|
|
3045
|
-
var getDiscriminator = (schema) => {
|
|
3046
|
-
return getZodDef(schema).discriminator;
|
|
3047
|
-
};
|
|
3048
|
-
var getDiscriminatedOptionKeys = (schema) => {
|
|
3049
|
-
const def = getZodDef(schema);
|
|
3050
|
-
const discriminator = getDiscriminator(schema);
|
|
3051
|
-
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
3052
|
-
return [...def.optionsMap.keys()];
|
|
3053
|
-
}
|
|
3054
|
-
const options = getUnionOptions(schema);
|
|
3055
|
-
return options.map((option) => {
|
|
3056
|
-
const shape = getObjectShape(option);
|
|
3057
|
-
const discriminatorSchema = shape[discriminator];
|
|
3058
|
-
return getLiteralValue(discriminatorSchema);
|
|
3059
|
-
});
|
|
3060
|
-
};
|
|
3061
|
-
var getDiscriminatedOption = (schema, discriminatorValue) => {
|
|
3062
|
-
const def = getZodDef(schema);
|
|
3063
|
-
const discriminator = getDiscriminator(schema);
|
|
3064
|
-
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
3065
|
-
return def.optionsMap.get(discriminatorValue);
|
|
3066
|
-
}
|
|
3067
|
-
const options = getUnionOptions(schema);
|
|
3068
|
-
return options.find((option) => {
|
|
3069
|
-
const shape = getObjectShape(option);
|
|
3070
|
-
const discriminatorSchema = shape[discriminator];
|
|
3071
|
-
return getLiteralValue(discriminatorSchema) === discriminatorValue;
|
|
3072
|
-
});
|
|
3073
|
-
};
|
|
3074
|
-
var getIntersectionSchemas = (schema) => {
|
|
3075
|
-
const def = getZodDef(schema);
|
|
3076
|
-
return { left: def.left, right: def.right };
|
|
3077
|
-
};
|
|
3078
|
-
var getTupleItems = (schema) => {
|
|
3079
|
-
return getZodDef(schema).items;
|
|
3080
|
-
};
|
|
3081
|
-
var getRecordValueType = (schema) => {
|
|
3082
|
-
return getZodDef(schema).valueType;
|
|
3083
|
-
};
|
|
3084
|
-
var getRecordKeyType = (schema) => {
|
|
3085
|
-
return getZodDef(schema).keyType;
|
|
3086
|
-
};
|
|
3087
|
-
var getPipelineOutput = (schema) => {
|
|
3088
|
-
return getZodDef(schema).out;
|
|
3089
|
-
};
|
|
3090
|
-
var getPipelineInput = (schema) => {
|
|
3091
|
-
return getZodDef(schema).in;
|
|
3092
|
-
};
|
|
3093
|
-
var getBrandedInner = (schema) => {
|
|
3094
|
-
return isZodV3Schema(schema) ? getZodDef(schema).type : schema;
|
|
3095
|
-
};
|
|
3096
|
-
|
|
3097
2919
|
// src/helpers/timeline-layout.ts
|
|
3098
2920
|
var TIMELINE_PADDING = 16;
|
|
3099
2921
|
var TIMELINE_BORDER = 1;
|
|
@@ -3101,28 +2923,17 @@ var TIMELINE_ITEM_BORDER_BOTTOM = 1;
|
|
|
3101
2923
|
var TIMELINE_TRACK_EXPANDED_HEIGHT = 100;
|
|
3102
2924
|
var SCHEMA_FIELD_ROW_HEIGHT = 26;
|
|
3103
2925
|
var UNSUPPORTED_FIELD_ROW_HEIGHT = 26;
|
|
3104
|
-
var SUPPORTED_SCHEMA_TYPES = new Set([
|
|
3105
|
-
"number",
|
|
3106
|
-
"string",
|
|
3107
|
-
"boolean",
|
|
3108
|
-
"enum",
|
|
3109
|
-
"date",
|
|
3110
|
-
"array",
|
|
3111
|
-
"object",
|
|
3112
|
-
"optional",
|
|
3113
|
-
"nullable",
|
|
3114
|
-
"default"
|
|
3115
|
-
]);
|
|
2926
|
+
var SUPPORTED_SCHEMA_TYPES = new Set(["number", "boolean"]);
|
|
3116
2927
|
var getSchemaFields = (controls) => {
|
|
3117
2928
|
if (!controls) {
|
|
3118
2929
|
return null;
|
|
3119
2930
|
}
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
const typeName = getZodSchemaType(fieldSchema);
|
|
2931
|
+
return Object.entries(controls.schema).map(([key, fieldSchema]) => {
|
|
2932
|
+
const typeName = fieldSchema.type;
|
|
3123
2933
|
const supported = SUPPORTED_SCHEMA_TYPES.has(typeName);
|
|
3124
2934
|
return {
|
|
3125
2935
|
key,
|
|
2936
|
+
description: fieldSchema.description,
|
|
3126
2937
|
typeName,
|
|
3127
2938
|
supported,
|
|
3128
2939
|
rowHeight: supported ? SCHEMA_FIELD_ROW_HEIGHT : UNSUPPORTED_FIELD_ROW_HEIGHT,
|
|
@@ -11935,6 +11746,184 @@ import { Internals as Internals30 } from "remotion";
|
|
|
11935
11746
|
// src/api/save-default-props.ts
|
|
11936
11747
|
import { getRemotionEnvironment as getRemotionEnvironment4 } from "remotion";
|
|
11937
11748
|
|
|
11749
|
+
// src/components/RenderModal/SchemaEditor/zod-schema-type.ts
|
|
11750
|
+
var zodSafeParse = (schema, data) => {
|
|
11751
|
+
return schema.safeParse(data);
|
|
11752
|
+
};
|
|
11753
|
+
var getZodDef = (schema) => {
|
|
11754
|
+
if (schema._def)
|
|
11755
|
+
return schema._def;
|
|
11756
|
+
if (schema._zod)
|
|
11757
|
+
return schema._zod.def;
|
|
11758
|
+
throw new Error("Invalid zod schema: missing _def and _zod");
|
|
11759
|
+
};
|
|
11760
|
+
var v3TypeNameMap = {
|
|
11761
|
+
ZodString: "string",
|
|
11762
|
+
ZodNumber: "number",
|
|
11763
|
+
ZodBoolean: "boolean",
|
|
11764
|
+
ZodObject: "object",
|
|
11765
|
+
ZodArray: "array",
|
|
11766
|
+
ZodEnum: "enum",
|
|
11767
|
+
ZodUnion: "union",
|
|
11768
|
+
ZodDiscriminatedUnion: "discriminatedUnion",
|
|
11769
|
+
ZodOptional: "optional",
|
|
11770
|
+
ZodNullable: "nullable",
|
|
11771
|
+
ZodDefault: "default",
|
|
11772
|
+
ZodTuple: "tuple",
|
|
11773
|
+
ZodDate: "date",
|
|
11774
|
+
ZodAny: "any",
|
|
11775
|
+
ZodUnknown: "unknown",
|
|
11776
|
+
ZodBigInt: "bigint",
|
|
11777
|
+
ZodNull: "null",
|
|
11778
|
+
ZodUndefined: "undefined",
|
|
11779
|
+
ZodEffects: "effects",
|
|
11780
|
+
ZodLiteral: "literal",
|
|
11781
|
+
ZodRecord: "record",
|
|
11782
|
+
ZodNever: "never",
|
|
11783
|
+
ZodVoid: "void",
|
|
11784
|
+
ZodNaN: "nan",
|
|
11785
|
+
ZodSymbol: "symbol",
|
|
11786
|
+
ZodIntersection: "intersection",
|
|
11787
|
+
ZodMap: "map",
|
|
11788
|
+
ZodSet: "set",
|
|
11789
|
+
ZodLazy: "lazy",
|
|
11790
|
+
ZodFunction: "function",
|
|
11791
|
+
ZodNativeEnum: "nativeEnum",
|
|
11792
|
+
ZodCatch: "catch",
|
|
11793
|
+
ZodPromise: "promise",
|
|
11794
|
+
ZodBranded: "branded",
|
|
11795
|
+
ZodPipeline: "pipeline"
|
|
11796
|
+
};
|
|
11797
|
+
var isZodV3Schema = (schema) => {
|
|
11798
|
+
const def = getZodDef(schema);
|
|
11799
|
+
return "typeName" in def;
|
|
11800
|
+
};
|
|
11801
|
+
var getZodSchemaType = (schema) => {
|
|
11802
|
+
const def = getZodDef(schema);
|
|
11803
|
+
if ("typeName" in def) {
|
|
11804
|
+
const { typeName } = def;
|
|
11805
|
+
return v3TypeNameMap[typeName] ?? typeName;
|
|
11806
|
+
}
|
|
11807
|
+
const { type } = def;
|
|
11808
|
+
if (type === "union" && def.discriminator !== undefined) {
|
|
11809
|
+
return "discriminatedUnion";
|
|
11810
|
+
}
|
|
11811
|
+
return type;
|
|
11812
|
+
};
|
|
11813
|
+
var getZodSchemaDescription = (schema) => {
|
|
11814
|
+
if (isZodV3Schema(schema)) {
|
|
11815
|
+
return getZodDef(schema).description;
|
|
11816
|
+
}
|
|
11817
|
+
return schema.description;
|
|
11818
|
+
};
|
|
11819
|
+
var getObjectShape = (schema) => {
|
|
11820
|
+
const { shape } = getZodDef(schema);
|
|
11821
|
+
return typeof shape === "function" ? shape() : shape;
|
|
11822
|
+
};
|
|
11823
|
+
var getArrayElement = (schema) => {
|
|
11824
|
+
const def = getZodDef(schema);
|
|
11825
|
+
return isZodV3Schema(schema) ? def.type : def.element;
|
|
11826
|
+
};
|
|
11827
|
+
var getInnerType = (schema) => {
|
|
11828
|
+
return getZodDef(schema).innerType;
|
|
11829
|
+
};
|
|
11830
|
+
var getEffectsInner = (schema) => {
|
|
11831
|
+
return getZodDef(schema).schema;
|
|
11832
|
+
};
|
|
11833
|
+
var getLiteralValue = (schema) => {
|
|
11834
|
+
const def = getZodDef(schema);
|
|
11835
|
+
if (isZodV3Schema(schema)) {
|
|
11836
|
+
return def.value;
|
|
11837
|
+
}
|
|
11838
|
+
return def.values?.[0];
|
|
11839
|
+
};
|
|
11840
|
+
var getEnumValues = (schema) => {
|
|
11841
|
+
const def = getZodDef(schema);
|
|
11842
|
+
if (isZodV3Schema(schema)) {
|
|
11843
|
+
return def.values;
|
|
11844
|
+
}
|
|
11845
|
+
const { entries } = def;
|
|
11846
|
+
return Object.values(entries);
|
|
11847
|
+
};
|
|
11848
|
+
var getFirstEnumValue = (schema) => {
|
|
11849
|
+
const def = getZodDef(schema);
|
|
11850
|
+
if (isZodV3Schema(schema)) {
|
|
11851
|
+
if (def.typeName === "ZodNativeEnum") {
|
|
11852
|
+
const vals = Object.values(def.values);
|
|
11853
|
+
return vals[0];
|
|
11854
|
+
}
|
|
11855
|
+
return def.values[0];
|
|
11856
|
+
}
|
|
11857
|
+
const { entries } = def;
|
|
11858
|
+
const pairs = Object.entries(entries);
|
|
11859
|
+
const hasReverseMapping = pairs.some(([key, value]) => key !== String(value));
|
|
11860
|
+
if (hasReverseMapping) {
|
|
11861
|
+
const forwardPairs = pairs.filter(([key]) => Number.isNaN(Number(key)));
|
|
11862
|
+
if (forwardPairs.length > 0) {
|
|
11863
|
+
return forwardPairs[0][1];
|
|
11864
|
+
}
|
|
11865
|
+
}
|
|
11866
|
+
return Object.values(entries)[0];
|
|
11867
|
+
};
|
|
11868
|
+
var getUnionOptions = (schema) => {
|
|
11869
|
+
return getZodDef(schema).options;
|
|
11870
|
+
};
|
|
11871
|
+
var getDefaultValue = (schema) => {
|
|
11872
|
+
const dv = getZodDef(schema).defaultValue;
|
|
11873
|
+
return typeof dv === "function" ? dv() : dv;
|
|
11874
|
+
};
|
|
11875
|
+
var getDiscriminator = (schema) => {
|
|
11876
|
+
return getZodDef(schema).discriminator;
|
|
11877
|
+
};
|
|
11878
|
+
var getDiscriminatedOptionKeys = (schema) => {
|
|
11879
|
+
const def = getZodDef(schema);
|
|
11880
|
+
const discriminator = getDiscriminator(schema);
|
|
11881
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
11882
|
+
return [...def.optionsMap.keys()];
|
|
11883
|
+
}
|
|
11884
|
+
const options = getUnionOptions(schema);
|
|
11885
|
+
return options.map((option) => {
|
|
11886
|
+
const shape = getObjectShape(option);
|
|
11887
|
+
const discriminatorSchema = shape[discriminator];
|
|
11888
|
+
return getLiteralValue(discriminatorSchema);
|
|
11889
|
+
});
|
|
11890
|
+
};
|
|
11891
|
+
var getDiscriminatedOption = (schema, discriminatorValue) => {
|
|
11892
|
+
const def = getZodDef(schema);
|
|
11893
|
+
const discriminator = getDiscriminator(schema);
|
|
11894
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
11895
|
+
return def.optionsMap.get(discriminatorValue);
|
|
11896
|
+
}
|
|
11897
|
+
const options = getUnionOptions(schema);
|
|
11898
|
+
return options.find((option) => {
|
|
11899
|
+
const shape = getObjectShape(option);
|
|
11900
|
+
const discriminatorSchema = shape[discriminator];
|
|
11901
|
+
return getLiteralValue(discriminatorSchema) === discriminatorValue;
|
|
11902
|
+
});
|
|
11903
|
+
};
|
|
11904
|
+
var getIntersectionSchemas = (schema) => {
|
|
11905
|
+
const def = getZodDef(schema);
|
|
11906
|
+
return { left: def.left, right: def.right };
|
|
11907
|
+
};
|
|
11908
|
+
var getTupleItems = (schema) => {
|
|
11909
|
+
return getZodDef(schema).items;
|
|
11910
|
+
};
|
|
11911
|
+
var getRecordValueType = (schema) => {
|
|
11912
|
+
return getZodDef(schema).valueType;
|
|
11913
|
+
};
|
|
11914
|
+
var getRecordKeyType = (schema) => {
|
|
11915
|
+
return getZodDef(schema).keyType;
|
|
11916
|
+
};
|
|
11917
|
+
var getPipelineOutput = (schema) => {
|
|
11918
|
+
return getZodDef(schema).out;
|
|
11919
|
+
};
|
|
11920
|
+
var getPipelineInput = (schema) => {
|
|
11921
|
+
return getZodDef(schema).in;
|
|
11922
|
+
};
|
|
11923
|
+
var getBrandedInner = (schema) => {
|
|
11924
|
+
return isZodV3Schema(schema) ? getZodDef(schema).type : schema;
|
|
11925
|
+
};
|
|
11926
|
+
|
|
11938
11927
|
// src/components/RenderModal/SchemaEditor/extract-enum-json-paths.ts
|
|
11939
11928
|
var extractEnumJsonPaths = ({
|
|
11940
11929
|
schema,
|
|
@@ -14286,7 +14275,8 @@ var InputDraggerForwardRefFn = ({
|
|
|
14286
14275
|
return {
|
|
14287
14276
|
...inputBaseStyle,
|
|
14288
14277
|
backgroundColor: "transparent",
|
|
14289
|
-
borderColor: "transparent"
|
|
14278
|
+
borderColor: "transparent",
|
|
14279
|
+
padding: "4px 6px"
|
|
14290
14280
|
};
|
|
14291
14281
|
}, []);
|
|
14292
14282
|
const span = useMemo69(() => ({
|
|
@@ -21832,7 +21822,7 @@ var Inner2 = () => {
|
|
|
21832
21822
|
|
|
21833
21823
|
// src/components/Timeline/TimelineList.tsx
|
|
21834
21824
|
import { PlayerInternals as PlayerInternals18 } from "@remotion/player";
|
|
21835
|
-
import { useRef as
|
|
21825
|
+
import { useRef as useRef40 } from "react";
|
|
21836
21826
|
|
|
21837
21827
|
// src/components/Timeline/TimelineListItem.tsx
|
|
21838
21828
|
import {
|
|
@@ -21877,6 +21867,7 @@ import {
|
|
|
21877
21867
|
useContext as useContext67,
|
|
21878
21868
|
useEffect as useEffect68,
|
|
21879
21869
|
useMemo as useMemo104,
|
|
21870
|
+
useRef as useRef37,
|
|
21880
21871
|
useState as useState72
|
|
21881
21872
|
} from "react";
|
|
21882
21873
|
import { Internals as Internals49 } from "remotion";
|
|
@@ -21894,19 +21885,15 @@ var draggerStyle = {
|
|
|
21894
21885
|
width: 80,
|
|
21895
21886
|
marginLeft: "auto"
|
|
21896
21887
|
};
|
|
21888
|
+
var checkboxContainer = {
|
|
21889
|
+
marginLeft: "auto"
|
|
21890
|
+
};
|
|
21897
21891
|
var notEditableBackground = {
|
|
21898
21892
|
backgroundColor: "rgba(255, 0, 0, 0.2)",
|
|
21899
21893
|
borderRadius: 3,
|
|
21900
21894
|
padding: "0 4px"
|
|
21901
21895
|
};
|
|
21902
|
-
var TimelineNumberField = ({
|
|
21903
|
-
field,
|
|
21904
|
-
canUpdate,
|
|
21905
|
-
onSave,
|
|
21906
|
-
onSavingChange,
|
|
21907
|
-
onDragValueChange,
|
|
21908
|
-
onDragEnd
|
|
21909
|
-
}) => {
|
|
21896
|
+
var TimelineNumberField = ({ field, codeValue, canUpdate, onSave, onDragValueChange, onDragEnd }) => {
|
|
21910
21897
|
const [dragValue, setDragValue] = useState71(null);
|
|
21911
21898
|
const dragging = useRef36(false);
|
|
21912
21899
|
const onValueChange = useCallback99((newVal) => {
|
|
@@ -21916,56 +21903,60 @@ var TimelineNumberField = ({
|
|
|
21916
21903
|
}, [onDragValueChange, field.key]);
|
|
21917
21904
|
useEffect67(() => {
|
|
21918
21905
|
setDragValue(null);
|
|
21919
|
-
onSavingChange(false);
|
|
21920
21906
|
onDragEnd();
|
|
21921
|
-
}, [field.currentValue,
|
|
21907
|
+
}, [field.currentValue, onDragEnd]);
|
|
21922
21908
|
const onValueChangeEnd = useCallback99((newVal) => {
|
|
21923
|
-
if (canUpdate && newVal !==
|
|
21924
|
-
onSavingChange(true);
|
|
21909
|
+
if (canUpdate && newVal !== codeValue) {
|
|
21925
21910
|
onSave(field.key, newVal).catch(() => {
|
|
21926
|
-
onSavingChange(false);
|
|
21927
21911
|
setDragValue(null);
|
|
21928
21912
|
});
|
|
21929
21913
|
} else {
|
|
21930
21914
|
setDragValue(null);
|
|
21931
21915
|
}
|
|
21932
|
-
}, [canUpdate, onSave,
|
|
21916
|
+
}, [canUpdate, onSave, field.key, codeValue]);
|
|
21933
21917
|
const onTextChange = useCallback99((newVal) => {
|
|
21934
21918
|
if (canUpdate) {
|
|
21935
21919
|
const parsed = Number(newVal);
|
|
21936
|
-
if (!Number.isNaN(parsed) && parsed !==
|
|
21920
|
+
if (!Number.isNaN(parsed) && parsed !== codeValue) {
|
|
21937
21921
|
setDragValue(parsed);
|
|
21938
|
-
onSavingChange(true);
|
|
21939
21922
|
onSave(field.key, parsed).catch(() => {
|
|
21940
|
-
onSavingChange(false);
|
|
21941
21923
|
setDragValue(null);
|
|
21942
21924
|
});
|
|
21943
21925
|
}
|
|
21944
21926
|
}
|
|
21945
|
-
}, [canUpdate, onSave,
|
|
21927
|
+
}, [canUpdate, onSave, field.key, codeValue]);
|
|
21946
21928
|
return /* @__PURE__ */ jsx195(InputDragger, {
|
|
21947
21929
|
type: "number",
|
|
21948
|
-
value: dragValue ??
|
|
21930
|
+
value: dragValue ?? codeValue,
|
|
21949
21931
|
style: draggerStyle,
|
|
21950
21932
|
status: "ok",
|
|
21951
21933
|
onValueChange,
|
|
21952
21934
|
onValueChangeEnd,
|
|
21953
21935
|
onTextChange,
|
|
21954
|
-
min:
|
|
21955
|
-
max:
|
|
21956
|
-
step:
|
|
21936
|
+
min: field.fieldSchema.type === "number" ? field.fieldSchema.min ?? -Infinity : -Infinity,
|
|
21937
|
+
max: field.fieldSchema.type === "number" ? field.fieldSchema.max ?? Infinity : Infinity,
|
|
21938
|
+
step: field.fieldSchema.type === "number" ? field.fieldSchema.step ?? 1 : 1,
|
|
21957
21939
|
rightAlign: true
|
|
21958
21940
|
});
|
|
21959
21941
|
};
|
|
21960
|
-
var
|
|
21961
|
-
|
|
21962
|
-
|
|
21963
|
-
|
|
21964
|
-
|
|
21965
|
-
|
|
21966
|
-
|
|
21967
|
-
|
|
21968
|
-
|
|
21942
|
+
var TimelineBooleanField = ({ field, codeValue, canUpdate, onSave }) => {
|
|
21943
|
+
const checked = Boolean(codeValue);
|
|
21944
|
+
const onChange = useCallback99(() => {
|
|
21945
|
+
if (canUpdate) {
|
|
21946
|
+
onSave(field.key, !checked);
|
|
21947
|
+
}
|
|
21948
|
+
}, [canUpdate, onSave, field.key, checked]);
|
|
21949
|
+
return /* @__PURE__ */ jsx195("div", {
|
|
21950
|
+
style: checkboxContainer,
|
|
21951
|
+
children: /* @__PURE__ */ jsx195(Checkbox, {
|
|
21952
|
+
checked,
|
|
21953
|
+
onChange,
|
|
21954
|
+
name: field.key,
|
|
21955
|
+
disabled: !canUpdate
|
|
21956
|
+
})
|
|
21957
|
+
});
|
|
21958
|
+
};
|
|
21959
|
+
var TimelineFieldValue = ({ field, onSave, onDragValueChange, onDragEnd, propStatus, canUpdate }) => {
|
|
21969
21960
|
const wrapperStyle = canUpdate === null || canUpdate === false ? notEditableBackground : undefined;
|
|
21970
21961
|
if (!field.supported) {
|
|
21971
21962
|
return /* @__PURE__ */ jsx195("span", {
|
|
@@ -21988,31 +21979,34 @@ var TimelineFieldValue = ({
|
|
|
21988
21979
|
})
|
|
21989
21980
|
});
|
|
21990
21981
|
}
|
|
21982
|
+
const effectiveCodeValue = propStatus.codeValue ?? field.currentValue ?? field.fieldSchema.default;
|
|
21991
21983
|
if (field.typeName === "number") {
|
|
21992
21984
|
return /* @__PURE__ */ jsx195("span", {
|
|
21993
21985
|
style: wrapperStyle,
|
|
21994
21986
|
children: /* @__PURE__ */ jsx195(TimelineNumberField, {
|
|
21995
21987
|
field,
|
|
21988
|
+
codeValue: effectiveCodeValue,
|
|
21996
21989
|
canUpdate,
|
|
21997
21990
|
onSave,
|
|
21998
|
-
onSavingChange,
|
|
21999
21991
|
onDragValueChange,
|
|
22000
21992
|
onDragEnd
|
|
22001
21993
|
})
|
|
22002
21994
|
});
|
|
22003
21995
|
}
|
|
21996
|
+
if (field.typeName === "boolean") {
|
|
21997
|
+
return /* @__PURE__ */ jsx195("span", {
|
|
21998
|
+
style: wrapperStyle,
|
|
21999
|
+
children: /* @__PURE__ */ jsx195(TimelineBooleanField, {
|
|
22000
|
+
field,
|
|
22001
|
+
codeValue: effectiveCodeValue,
|
|
22002
|
+
canUpdate,
|
|
22003
|
+
onSave
|
|
22004
|
+
})
|
|
22005
|
+
});
|
|
22006
|
+
}
|
|
22004
22007
|
return /* @__PURE__ */ jsx195("span", {
|
|
22005
22008
|
style: { ...unsupportedLabel, fontStyle: "normal" },
|
|
22006
|
-
children: String(
|
|
22007
|
-
});
|
|
22008
|
-
};
|
|
22009
|
-
var TimelineFieldSavingSpinner = ({ saving }) => {
|
|
22010
|
-
if (!saving) {
|
|
22011
|
-
return null;
|
|
22012
|
-
}
|
|
22013
|
-
return /* @__PURE__ */ jsx195(Spinner, {
|
|
22014
|
-
duration: 0.5,
|
|
22015
|
-
size: 12
|
|
22009
|
+
children: String(effectiveCodeValue)
|
|
22016
22010
|
});
|
|
22017
22011
|
};
|
|
22018
22012
|
|
|
@@ -22044,30 +22038,20 @@ var fieldLabelRow = {
|
|
|
22044
22038
|
gap: 6
|
|
22045
22039
|
};
|
|
22046
22040
|
var TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatus }) => {
|
|
22047
|
-
const [saving, setSaving] = useState72(false);
|
|
22048
|
-
const onSavingChange = useCallback100((s) => {
|
|
22049
|
-
setSaving(s);
|
|
22050
|
-
}, []);
|
|
22051
22041
|
return /* @__PURE__ */ jsxs93("div", {
|
|
22052
22042
|
style: { ...fieldRow, height: field.rowHeight },
|
|
22053
22043
|
children: [
|
|
22054
|
-
/* @__PURE__ */
|
|
22044
|
+
/* @__PURE__ */ jsx196("div", {
|
|
22055
22045
|
style: fieldLabelRow,
|
|
22056
|
-
children:
|
|
22057
|
-
|
|
22058
|
-
|
|
22059
|
-
|
|
22060
|
-
}),
|
|
22061
|
-
/* @__PURE__ */ jsx196(TimelineFieldSavingSpinner, {
|
|
22062
|
-
saving
|
|
22063
|
-
})
|
|
22064
|
-
]
|
|
22046
|
+
children: /* @__PURE__ */ jsx196("span", {
|
|
22047
|
+
style: fieldName,
|
|
22048
|
+
children: field.description ?? field.key
|
|
22049
|
+
})
|
|
22065
22050
|
}),
|
|
22066
22051
|
/* @__PURE__ */ jsx196(TimelineFieldValue, {
|
|
22067
22052
|
field,
|
|
22068
22053
|
propStatus,
|
|
22069
22054
|
onSave,
|
|
22070
|
-
onSavingChange,
|
|
22071
22055
|
onDragValueChange,
|
|
22072
22056
|
onDragEnd,
|
|
22073
22057
|
canUpdate: propStatus?.canUpdate ?? false
|
|
@@ -22077,6 +22061,8 @@ var TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatu
|
|
|
22077
22061
|
};
|
|
22078
22062
|
var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
22079
22063
|
const [propStatuses, setPropStatuses] = useState72(null);
|
|
22064
|
+
const { previewServerState: state, subscribeToEvent } = useContext67(StudioServerConnectionCtx);
|
|
22065
|
+
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
22080
22066
|
const schemaFields = useMemo104(() => getSchemaFields(sequence.controls), [sequence.controls]);
|
|
22081
22067
|
const validatedLocation = useMemo104(() => {
|
|
22082
22068
|
if (!originalLocation || !originalLocation.source || !originalLocation.line) {
|
|
@@ -22088,17 +22074,32 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
22088
22074
|
column: originalLocation.column ?? 0
|
|
22089
22075
|
};
|
|
22090
22076
|
}, [originalLocation]);
|
|
22077
|
+
const locationSource = validatedLocation?.source ?? null;
|
|
22078
|
+
const locationLine = validatedLocation?.line ?? null;
|
|
22079
|
+
const locationColumn = validatedLocation?.column ?? null;
|
|
22080
|
+
const schemaKeysString = useMemo104(() => schemaFields ? schemaFields.map((f) => f.key).join(",") : null, [schemaFields]);
|
|
22081
|
+
const currentLocationSource = useRef37(locationSource);
|
|
22082
|
+
currentLocationSource.current = locationSource;
|
|
22083
|
+
const currentLocationLine = useRef37(locationLine);
|
|
22084
|
+
currentLocationLine.current = locationLine;
|
|
22085
|
+
const currentLocationColumn = useRef37(locationColumn);
|
|
22086
|
+
currentLocationColumn.current = locationColumn;
|
|
22091
22087
|
useEffect68(() => {
|
|
22092
|
-
if (!
|
|
22088
|
+
if (!clientId || !locationSource || !locationLine || locationColumn === null || !schemaKeysString) {
|
|
22093
22089
|
setPropStatuses(null);
|
|
22094
22090
|
return;
|
|
22095
22091
|
}
|
|
22096
|
-
|
|
22097
|
-
|
|
22098
|
-
|
|
22099
|
-
|
|
22100
|
-
|
|
22092
|
+
const keys = schemaKeysString.split(",");
|
|
22093
|
+
callApi("/api/subscribe-to-sequence-props", {
|
|
22094
|
+
fileName: locationSource,
|
|
22095
|
+
line: locationLine,
|
|
22096
|
+
column: locationColumn,
|
|
22097
|
+
keys,
|
|
22098
|
+
clientId
|
|
22101
22099
|
}).then((result) => {
|
|
22100
|
+
if (currentLocationSource.current !== locationSource || currentLocationLine.current !== locationLine || currentLocationColumn.current !== locationColumn) {
|
|
22101
|
+
return;
|
|
22102
|
+
}
|
|
22102
22103
|
if (result.canUpdate) {
|
|
22103
22104
|
setPropStatuses(result.props);
|
|
22104
22105
|
} else {
|
|
@@ -22107,7 +22108,43 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
22107
22108
|
}).catch(() => {
|
|
22108
22109
|
setPropStatuses(null);
|
|
22109
22110
|
});
|
|
22110
|
-
|
|
22111
|
+
return () => {
|
|
22112
|
+
callApi("/api/unsubscribe-from-sequence-props", {
|
|
22113
|
+
fileName: locationSource,
|
|
22114
|
+
line: locationLine,
|
|
22115
|
+
column: locationColumn,
|
|
22116
|
+
clientId
|
|
22117
|
+
}).catch(() => {});
|
|
22118
|
+
};
|
|
22119
|
+
}, [
|
|
22120
|
+
clientId,
|
|
22121
|
+
locationSource,
|
|
22122
|
+
locationLine,
|
|
22123
|
+
locationColumn,
|
|
22124
|
+
schemaKeysString
|
|
22125
|
+
]);
|
|
22126
|
+
useEffect68(() => {
|
|
22127
|
+
if (!locationSource || !locationLine || locationColumn === null) {
|
|
22128
|
+
return;
|
|
22129
|
+
}
|
|
22130
|
+
const listener = (event) => {
|
|
22131
|
+
if (event.type !== "sequence-props-updated") {
|
|
22132
|
+
return;
|
|
22133
|
+
}
|
|
22134
|
+
if (event.fileName !== currentLocationSource.current || event.line !== currentLocationLine.current || event.column !== currentLocationColumn.current) {
|
|
22135
|
+
return;
|
|
22136
|
+
}
|
|
22137
|
+
if (event.result.canUpdate) {
|
|
22138
|
+
setPropStatuses(event.result.props);
|
|
22139
|
+
} else {
|
|
22140
|
+
setPropStatuses(null);
|
|
22141
|
+
}
|
|
22142
|
+
};
|
|
22143
|
+
const unsub = subscribeToEvent("sequence-props-updated", listener);
|
|
22144
|
+
return () => {
|
|
22145
|
+
unsub();
|
|
22146
|
+
};
|
|
22147
|
+
}, [locationSource, locationLine, locationColumn, subscribeToEvent]);
|
|
22111
22148
|
const expandedHeight = useMemo104(() => getExpandedTrackHeight(sequence.controls), [sequence.controls]);
|
|
22112
22149
|
const { setOverride, clearOverrides } = useContext67(Internals49.SequenceControlOverrideContext);
|
|
22113
22150
|
const onSave = useCallback100((key4, value) => {
|
|
@@ -22118,23 +22155,27 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
22118
22155
|
if (!status || !status.canUpdate) {
|
|
22119
22156
|
return Promise.reject(new Error("Cannot save"));
|
|
22120
22157
|
}
|
|
22158
|
+
const field = schemaFields?.find((f) => f.key === key4);
|
|
22159
|
+
const defaultValue = field && field.fieldSchema.default !== undefined ? JSON.stringify(field.fieldSchema.default) : null;
|
|
22121
22160
|
return callApi("/api/save-sequence-props", {
|
|
22122
22161
|
fileName: validatedLocation.source,
|
|
22123
22162
|
line: validatedLocation.line,
|
|
22124
22163
|
column: validatedLocation.column,
|
|
22125
22164
|
key: key4,
|
|
22126
22165
|
value: JSON.stringify(value),
|
|
22127
|
-
enumPaths: []
|
|
22166
|
+
enumPaths: [],
|
|
22167
|
+
defaultValue
|
|
22128
22168
|
}).then(() => {
|
|
22129
22169
|
return;
|
|
22130
22170
|
});
|
|
22131
|
-
}, [propStatuses, validatedLocation]);
|
|
22171
|
+
}, [propStatuses, validatedLocation, schemaFields]);
|
|
22172
|
+
const overrideId = sequence.controls?.overrideId ?? sequence.id;
|
|
22132
22173
|
const onDragValueChange = useCallback100((key4, value) => {
|
|
22133
|
-
setOverride(
|
|
22134
|
-
}, [setOverride,
|
|
22174
|
+
setOverride(overrideId, key4, value);
|
|
22175
|
+
}, [setOverride, overrideId]);
|
|
22135
22176
|
const onDragEnd = useCallback100(() => {
|
|
22136
|
-
clearOverrides(
|
|
22137
|
-
}, [clearOverrides,
|
|
22177
|
+
clearOverrides(overrideId);
|
|
22178
|
+
}, [clearOverrides, overrideId]);
|
|
22138
22179
|
return /* @__PURE__ */ jsx196("div", {
|
|
22139
22180
|
style: { ...expandedSectionBase, height: expandedHeight },
|
|
22140
22181
|
children: schemaFields ? schemaFields.map((field) => /* @__PURE__ */ jsx196(TimelineFieldRow, {
|
|
@@ -22409,7 +22450,8 @@ var arrowButton = {
|
|
|
22409
22450
|
lineHeight: 1
|
|
22410
22451
|
};
|
|
22411
22452
|
var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
22412
|
-
const
|
|
22453
|
+
const { previewServerState } = useContext69(StudioServerConnectionCtx);
|
|
22454
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
22413
22455
|
const { hidden, setHidden } = useContext69(Internals50.SequenceVisibilityToggleContext);
|
|
22414
22456
|
const { expandedTracks, toggleTrack } = useContext69(ExpandedTracksContext);
|
|
22415
22457
|
const [originalLocation, setOriginalLocation] = useState74(null);
|
|
@@ -22423,7 +22465,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
22423
22465
|
console.error("Could not get original location of Sequence", err);
|
|
22424
22466
|
});
|
|
22425
22467
|
}, [sequence.stack]);
|
|
22426
|
-
const isExpanded = expandedTracks[sequence.id] ?? false;
|
|
22468
|
+
const isExpanded = visualModeEnabled && (expandedTracks[sequence.id] ?? false);
|
|
22427
22469
|
const onToggleExpand = useCallback103(() => {
|
|
22428
22470
|
toggleTrack(sequence.id);
|
|
22429
22471
|
}, [sequence.id, toggleTrack]);
|
|
@@ -22515,7 +22557,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
22515
22557
|
};
|
|
22516
22558
|
|
|
22517
22559
|
// src/components/Timeline/TimelineTimeIndicators.tsx
|
|
22518
|
-
import { useContext as useContext70, useEffect as useEffect71, useMemo as useMemo107, useRef as
|
|
22560
|
+
import { useContext as useContext70, useEffect as useEffect71, useMemo as useMemo107, useRef as useRef39 } from "react";
|
|
22519
22561
|
import { Internals as Internals52 } from "remotion";
|
|
22520
22562
|
|
|
22521
22563
|
// src/components/TimeValue.tsx
|
|
@@ -22524,7 +22566,7 @@ import {
|
|
|
22524
22566
|
useCallback as useCallback104,
|
|
22525
22567
|
useEffect as useEffect70,
|
|
22526
22568
|
useImperativeHandle as useImperativeHandle14,
|
|
22527
|
-
useRef as
|
|
22569
|
+
useRef as useRef38
|
|
22528
22570
|
} from "react";
|
|
22529
22571
|
import { Internals as Internals51, useCurrentFrame } from "remotion";
|
|
22530
22572
|
import { jsx as jsx200, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
@@ -22557,7 +22599,7 @@ var TimeValue = () => {
|
|
|
22557
22599
|
const isStill = useIsStill();
|
|
22558
22600
|
const { seek, play, pause, toggle } = PlayerInternals17.usePlayer();
|
|
22559
22601
|
const keybindings = useKeybinding();
|
|
22560
|
-
const ref =
|
|
22602
|
+
const ref = useRef38(null);
|
|
22561
22603
|
const onTextChange = useCallback104((newVal) => {
|
|
22562
22604
|
seek(parseInt(newVal, 10));
|
|
22563
22605
|
}, [seek]);
|
|
@@ -22685,7 +22727,7 @@ var TimelineTimeIndicators = () => {
|
|
|
22685
22727
|
});
|
|
22686
22728
|
};
|
|
22687
22729
|
var Inner3 = ({ windowWidth, durationInFrames, fps }) => {
|
|
22688
|
-
const ref =
|
|
22730
|
+
const ref = useRef39(null);
|
|
22689
22731
|
useEffect71(() => {
|
|
22690
22732
|
const currentRef = ref.current;
|
|
22691
22733
|
if (!currentRef) {
|
|
@@ -22768,7 +22810,7 @@ var container43 = {
|
|
|
22768
22810
|
background: BACKGROUND
|
|
22769
22811
|
};
|
|
22770
22812
|
var TimelineList = ({ timeline }) => {
|
|
22771
|
-
const ref =
|
|
22813
|
+
const ref = useRef40(null);
|
|
22772
22814
|
const size4 = PlayerInternals18.useElementSize(ref, {
|
|
22773
22815
|
shouldApplyCssTransforms: false,
|
|
22774
22816
|
triggerOnWindowResize: false
|
|
@@ -22917,21 +22959,10 @@ var getTimelineSequenceLayout = ({
|
|
|
22917
22959
|
postmountDisplay
|
|
22918
22960
|
}) => {
|
|
22919
22961
|
const maxMediaSequenceDuration = (maxMediaDuration ?? Infinity) - startFromMedia;
|
|
22920
|
-
const lastFrame =
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
const
|
|
22924
|
-
const shouldAddHalfAFrameAtStart = startFrom > 0;
|
|
22925
|
-
if (shouldAddHalfAFrameAtEnd) {
|
|
22926
|
-
spatialDuration += 0.5;
|
|
22927
|
-
naturalSpatialDuration += 0.5;
|
|
22928
|
-
}
|
|
22929
|
-
if (shouldAddHalfAFrameAtStart) {
|
|
22930
|
-
spatialDuration += 0.5;
|
|
22931
|
-
naturalSpatialDuration += 0.5;
|
|
22932
|
-
}
|
|
22933
|
-
const startFromWithOffset = shouldAddHalfAFrameAtStart ? startFrom - 0.5 : startFrom;
|
|
22934
|
-
const marginLeft = lastFrame === 0 ? 0 : startFromWithOffset / lastFrame * (windowWidth - TIMELINE_PADDING * 2);
|
|
22962
|
+
const lastFrame = video.durationInFrames ?? 1;
|
|
22963
|
+
const spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames, lastFrame - startFrom);
|
|
22964
|
+
const naturalSpatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames);
|
|
22965
|
+
const marginLeft = lastFrame === 0 ? 0 : startFrom / lastFrame * (windowWidth - TIMELINE_PADDING * 2);
|
|
22935
22966
|
const nonNegativeMarginLeft = Math.min(marginLeft, 0);
|
|
22936
22967
|
const width = getWidthOfTrack({
|
|
22937
22968
|
durationInFrames,
|
|
@@ -23020,7 +23051,7 @@ var useMaxMediaDuration = (s, fps) => {
|
|
|
23020
23051
|
|
|
23021
23052
|
// src/components/AudioWaveform.tsx
|
|
23022
23053
|
import { getAudioData, getWaveformPortion } from "@remotion/media-utils";
|
|
23023
|
-
import { useEffect as useEffect74, useMemo as useMemo110, useRef as
|
|
23054
|
+
import { useEffect as useEffect74, useMemo as useMemo110, useRef as useRef41, useState as useState76 } from "react";
|
|
23024
23055
|
import { Internals as Internals54 } from "remotion";
|
|
23025
23056
|
|
|
23026
23057
|
// src/components/AudioWaveformBar.tsx
|
|
@@ -23079,12 +23110,12 @@ var AudioWaveform = ({
|
|
|
23079
23110
|
}) => {
|
|
23080
23111
|
const [metadata, setMetadata] = useState76(null);
|
|
23081
23112
|
const [error, setError] = useState76(null);
|
|
23082
|
-
const mountState =
|
|
23113
|
+
const mountState = useRef41({ isMounted: true });
|
|
23083
23114
|
const vidConf = Internals54.useUnsafeVideoConfig();
|
|
23084
23115
|
if (vidConf === null) {
|
|
23085
23116
|
throw new Error("Expected video config");
|
|
23086
23117
|
}
|
|
23087
|
-
const canvas =
|
|
23118
|
+
const canvas = useRef41(null);
|
|
23088
23119
|
useEffect74(() => {
|
|
23089
23120
|
const { current } = mountState;
|
|
23090
23121
|
current.isMounted = true;
|
|
@@ -23284,7 +23315,8 @@ var relativeFrameStyle = {
|
|
|
23284
23315
|
fontSize: 11,
|
|
23285
23316
|
fontFamily: "Arial, Helvetica, sans-serif",
|
|
23286
23317
|
color: "white",
|
|
23287
|
-
opacity: 0.5
|
|
23318
|
+
opacity: 0.5,
|
|
23319
|
+
whiteSpace: "nowrap"
|
|
23288
23320
|
};
|
|
23289
23321
|
var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
23290
23322
|
return /* @__PURE__ */ jsx208("div", {
|
|
@@ -23294,7 +23326,7 @@ var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
|
23294
23326
|
};
|
|
23295
23327
|
|
|
23296
23328
|
// src/components/Timeline/TimelineVideoInfo.tsx
|
|
23297
|
-
import { useEffect as useEffect75, useRef as
|
|
23329
|
+
import { useEffect as useEffect75, useRef as useRef42, useState as useState77 } from "react";
|
|
23298
23330
|
import { useVideoConfig as useVideoConfig5 } from "remotion";
|
|
23299
23331
|
|
|
23300
23332
|
// src/helpers/extract-frames.ts
|
|
@@ -23342,15 +23374,22 @@ async function extractFrames({
|
|
|
23342
23374
|
return;
|
|
23343
23375
|
}
|
|
23344
23376
|
const sink = new VideoSampleSink(videoTrack);
|
|
23345
|
-
|
|
23346
|
-
|
|
23347
|
-
|
|
23348
|
-
|
|
23349
|
-
|
|
23350
|
-
|
|
23351
|
-
|
|
23377
|
+
const sampleIterator = sink.samplesAtTimestamps(timestamps);
|
|
23378
|
+
try {
|
|
23379
|
+
for await (const videoSample of sampleIterator) {
|
|
23380
|
+
if (signal?.aborted) {
|
|
23381
|
+
videoSample?.close();
|
|
23382
|
+
break;
|
|
23383
|
+
}
|
|
23384
|
+
if (!videoSample) {
|
|
23385
|
+
continue;
|
|
23386
|
+
}
|
|
23387
|
+
onVideoSample(videoSample);
|
|
23352
23388
|
}
|
|
23353
|
-
|
|
23389
|
+
} finally {
|
|
23390
|
+
try {
|
|
23391
|
+
await sampleIterator.return?.();
|
|
23392
|
+
} catch {}
|
|
23354
23393
|
}
|
|
23355
23394
|
} catch (error) {
|
|
23356
23395
|
if (error instanceof InputDisposedError2) {
|
|
@@ -23623,9 +23662,9 @@ var TimelineVideoInfo = ({
|
|
|
23623
23662
|
playbackRate
|
|
23624
23663
|
}) => {
|
|
23625
23664
|
const { fps } = useVideoConfig5();
|
|
23626
|
-
const ref =
|
|
23665
|
+
const ref = useRef42(null);
|
|
23627
23666
|
const [error, setError] = useState77(null);
|
|
23628
|
-
const aspectRatio =
|
|
23667
|
+
const aspectRatio = useRef42(getAspectRatioFromCache(src));
|
|
23629
23668
|
useEffect75(() => {
|
|
23630
23669
|
return () => {
|
|
23631
23670
|
clearFramesForSrc(src);
|
|
@@ -23693,46 +23732,59 @@ var TimelineVideoInfo = ({
|
|
|
23693
23732
|
},
|
|
23694
23733
|
src,
|
|
23695
23734
|
onVideoSample: (sample) => {
|
|
23696
|
-
|
|
23697
|
-
|
|
23698
|
-
|
|
23699
|
-
|
|
23700
|
-
|
|
23701
|
-
|
|
23702
|
-
|
|
23703
|
-
|
|
23704
|
-
|
|
23705
|
-
|
|
23706
|
-
|
|
23707
|
-
|
|
23708
|
-
|
|
23709
|
-
|
|
23710
|
-
|
|
23711
|
-
|
|
23712
|
-
|
|
23713
|
-
|
|
23714
|
-
|
|
23715
|
-
|
|
23735
|
+
let frame2;
|
|
23736
|
+
try {
|
|
23737
|
+
frame2 = sample.toVideoFrame();
|
|
23738
|
+
const scale = HEIGHT / frame2.displayHeight * window.devicePixelRatio;
|
|
23739
|
+
const transformed = resizeVideoFrame({
|
|
23740
|
+
frame: frame2,
|
|
23741
|
+
scale
|
|
23742
|
+
});
|
|
23743
|
+
if (transformed !== frame2) {
|
|
23744
|
+
frame2.close();
|
|
23745
|
+
}
|
|
23746
|
+
frame2 = undefined;
|
|
23747
|
+
const databaseKey = makeFrameDatabaseKey(src, transformed.timestamp);
|
|
23748
|
+
const existingFrame = frameDatabase.get(databaseKey);
|
|
23749
|
+
if (existingFrame) {
|
|
23750
|
+
existingFrame.frame.close();
|
|
23751
|
+
}
|
|
23752
|
+
frameDatabase.set(databaseKey, {
|
|
23753
|
+
frame: transformed,
|
|
23754
|
+
lastUsed: Date.now()
|
|
23755
|
+
});
|
|
23756
|
+
if (aspectRatio.current === null) {
|
|
23757
|
+
throw new Error("Aspect ratio is not set");
|
|
23758
|
+
}
|
|
23759
|
+
ensureSlots({
|
|
23760
|
+
filledSlots,
|
|
23761
|
+
fromSeconds,
|
|
23762
|
+
toSeconds,
|
|
23763
|
+
naturalWidth,
|
|
23764
|
+
aspectRatio: aspectRatio.current
|
|
23765
|
+
});
|
|
23766
|
+
fillFrameWhereItFits({
|
|
23767
|
+
ctx,
|
|
23768
|
+
filledSlots,
|
|
23769
|
+
visualizationWidth: naturalWidth,
|
|
23770
|
+
frame: transformed,
|
|
23771
|
+
segmentDuration: toSeconds - fromSeconds,
|
|
23772
|
+
fromSeconds
|
|
23773
|
+
});
|
|
23774
|
+
} catch (e) {
|
|
23775
|
+
if (frame2) {
|
|
23776
|
+
frame2.close();
|
|
23777
|
+
}
|
|
23778
|
+
throw e;
|
|
23779
|
+
} finally {
|
|
23780
|
+
sample.close();
|
|
23716
23781
|
}
|
|
23717
|
-
ensureSlots({
|
|
23718
|
-
filledSlots,
|
|
23719
|
-
fromSeconds,
|
|
23720
|
-
toSeconds,
|
|
23721
|
-
naturalWidth,
|
|
23722
|
-
aspectRatio: aspectRatio.current
|
|
23723
|
-
});
|
|
23724
|
-
fillFrameWhereItFits({
|
|
23725
|
-
ctx,
|
|
23726
|
-
filledSlots,
|
|
23727
|
-
visualizationWidth: naturalWidth,
|
|
23728
|
-
frame: transformed,
|
|
23729
|
-
segmentDuration: toSeconds - fromSeconds,
|
|
23730
|
-
fromSeconds
|
|
23731
|
-
});
|
|
23732
|
-
sample.close();
|
|
23733
23782
|
},
|
|
23734
23783
|
signal: controller.signal
|
|
23735
23784
|
}).then(() => {
|
|
23785
|
+
if (controller.signal.aborted) {
|
|
23786
|
+
return;
|
|
23787
|
+
}
|
|
23736
23788
|
fillWithCachedFrames({
|
|
23737
23789
|
ctx,
|
|
23738
23790
|
naturalWidth,
|
|
@@ -23908,7 +23960,8 @@ var getExpandedPlaceholderStyle = (controls) => ({
|
|
|
23908
23960
|
});
|
|
23909
23961
|
var TimelineTracks = ({ timeline, hasBeenCut }) => {
|
|
23910
23962
|
const { expandedTracks } = useContext73(ExpandedTracksContext);
|
|
23911
|
-
const
|
|
23963
|
+
const { previewServerState } = useContext73(StudioServerConnectionCtx);
|
|
23964
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
23912
23965
|
const timelineStyle = useMemo112(() => {
|
|
23913
23966
|
return {
|
|
23914
23967
|
...timelineContent,
|
|
@@ -25549,7 +25602,7 @@ import {
|
|
|
25549
25602
|
useContext as useContext85,
|
|
25550
25603
|
useEffect as useEffect81,
|
|
25551
25604
|
useMemo as useMemo121,
|
|
25552
|
-
useRef as
|
|
25605
|
+
useRef as useRef44,
|
|
25553
25606
|
useState as useState83
|
|
25554
25607
|
} from "react";
|
|
25555
25608
|
import { Internals as Internals63 } from "remotion";
|
|
@@ -26422,7 +26475,7 @@ var QuickSwitcherNoResults = ({ query, mode }) => {
|
|
|
26422
26475
|
};
|
|
26423
26476
|
|
|
26424
26477
|
// src/components/QuickSwitcher/QuickSwitcherResult.tsx
|
|
26425
|
-
import { useEffect as useEffect80, useMemo as useMemo120, useRef as
|
|
26478
|
+
import { useEffect as useEffect80, useMemo as useMemo120, useRef as useRef43, useState as useState82 } from "react";
|
|
26426
26479
|
import { jsx as jsx230, jsxs as jsxs117, Fragment as Fragment36 } from "react/jsx-runtime";
|
|
26427
26480
|
var container51 = {
|
|
26428
26481
|
paddingLeft: 16,
|
|
@@ -26452,7 +26505,7 @@ var labelContainer = {
|
|
|
26452
26505
|
};
|
|
26453
26506
|
var QuickSwitcherResult = ({ result, selected }) => {
|
|
26454
26507
|
const [hovered, setIsHovered] = useState82(false);
|
|
26455
|
-
const ref =
|
|
26508
|
+
const ref = useRef43(null);
|
|
26456
26509
|
const keybindings = useKeybinding();
|
|
26457
26510
|
useEffect80(() => {
|
|
26458
26511
|
const { current } = ref;
|
|
@@ -26630,7 +26683,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
|
|
|
26630
26683
|
selectedIndex: 0
|
|
26631
26684
|
});
|
|
26632
26685
|
}, [initialMode, invocationTimestamp]);
|
|
26633
|
-
const inputRef =
|
|
26686
|
+
const inputRef = useRef44(null);
|
|
26634
26687
|
const selectComposition = useSelectComposition();
|
|
26635
26688
|
const closeMenu = useCallback113(() => {
|
|
26636
26689
|
return;
|
|
@@ -27390,7 +27443,7 @@ import {
|
|
|
27390
27443
|
useEffect as useEffect84,
|
|
27391
27444
|
useMemo as useMemo132,
|
|
27392
27445
|
useReducer as useReducer2,
|
|
27393
|
-
useRef as
|
|
27446
|
+
useRef as useRef46,
|
|
27394
27447
|
useState as useState89
|
|
27395
27448
|
} from "react";
|
|
27396
27449
|
|
|
@@ -29133,12 +29186,12 @@ import { BrowserSafeApis as BrowserSafeApis6 } from "@remotion/renderer/client";
|
|
|
29133
29186
|
import { useCallback as useCallback125, useMemo as useMemo127 } from "react";
|
|
29134
29187
|
|
|
29135
29188
|
// src/helpers/use-file-existence.ts
|
|
29136
|
-
import { useContext as useContext87, useEffect as useEffect83, useRef as
|
|
29189
|
+
import { useContext as useContext87, useEffect as useEffect83, useRef as useRef45, useState as useState88 } from "react";
|
|
29137
29190
|
var useFileExistence = (outName) => {
|
|
29138
29191
|
const [exists, setExists] = useState88(false);
|
|
29139
29192
|
const { previewServerState: state, subscribeToEvent } = useContext87(StudioServerConnectionCtx);
|
|
29140
29193
|
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
29141
|
-
const currentOutName =
|
|
29194
|
+
const currentOutName = useRef45("");
|
|
29142
29195
|
currentOutName.current = outName;
|
|
29143
29196
|
useEffect83(() => {
|
|
29144
29197
|
if (!clientId) {
|
|
@@ -30526,7 +30579,7 @@ var RenderModal = ({
|
|
|
30526
30579
|
resolved: { result: resolvedComposition },
|
|
30527
30580
|
unresolved: unresolvedComposition
|
|
30528
30581
|
} = context;
|
|
30529
|
-
const isMounted =
|
|
30582
|
+
const isMounted = useRef46(true);
|
|
30530
30583
|
const [isVideo] = useState89(() => {
|
|
30531
30584
|
return typeof resolvedComposition.durationInFrames === "undefined" ? true : resolvedComposition.durationInFrames > 1;
|
|
30532
30585
|
});
|
|
@@ -31521,9 +31574,9 @@ import {
|
|
|
31521
31574
|
getEncodableAudioCodecs,
|
|
31522
31575
|
getSupportedAudioCodecsForContainer
|
|
31523
31576
|
} from "@remotion/web-renderer";
|
|
31524
|
-
import { useEffect as useEffect85, useRef as
|
|
31577
|
+
import { useEffect as useEffect85, useRef as useRef47, useState as useState90 } from "react";
|
|
31525
31578
|
var useEncodableAudioCodecs = (container62) => {
|
|
31526
|
-
const cacheRef =
|
|
31579
|
+
const cacheRef = useRef47({});
|
|
31527
31580
|
const [codecsByContainer, setCodecsByContainer] = useState90(() => {
|
|
31528
31581
|
return {
|
|
31529
31582
|
[container62]: getSupportedAudioCodecsForContainer(container62)
|
|
@@ -31563,9 +31616,9 @@ import {
|
|
|
31563
31616
|
getEncodableVideoCodecs,
|
|
31564
31617
|
getSupportedVideoCodecsForContainer
|
|
31565
31618
|
} from "@remotion/web-renderer";
|
|
31566
|
-
import { useEffect as useEffect86, useRef as
|
|
31619
|
+
import { useEffect as useEffect86, useRef as useRef48, useState as useState91 } from "react";
|
|
31567
31620
|
var useEncodableVideoCodecs = (container62) => {
|
|
31568
|
-
const cacheRef =
|
|
31621
|
+
const cacheRef = useRef48({});
|
|
31569
31622
|
const [codecsByContainer, setCodecsByContainer] = useState91(() => {
|
|
31570
31623
|
return {
|
|
31571
31624
|
[container62]: getSupportedVideoCodecsForContainer(container62)
|
|
@@ -33904,15 +33957,15 @@ var SetTimelineInOutProvider = ({ children }) => {
|
|
|
33904
33957
|
};
|
|
33905
33958
|
|
|
33906
33959
|
// src/components/ShowGuidesProvider.tsx
|
|
33907
|
-
import { useCallback as useCallback144, useMemo as useMemo146, useRef as
|
|
33960
|
+
import { useCallback as useCallback144, useMemo as useMemo146, useRef as useRef49, useState as useState101 } from "react";
|
|
33908
33961
|
import { jsx as jsx289 } from "react/jsx-runtime";
|
|
33909
33962
|
var ShowGuidesProvider = ({ children }) => {
|
|
33910
33963
|
const [guidesList, setGuidesList] = useState101(() => loadGuidesList());
|
|
33911
33964
|
const [selectedGuideId, setSelectedGuideId] = useState101(null);
|
|
33912
33965
|
const [hoveredGuideId, setHoveredGuideId] = useState101(null);
|
|
33913
33966
|
const [editorShowGuides, setEditorShowGuidesState] = useState101(() => loadEditorShowGuidesOption());
|
|
33914
|
-
const shouldCreateGuideRef =
|
|
33915
|
-
const shouldDeleteGuideRef =
|
|
33967
|
+
const shouldCreateGuideRef = useRef49(false);
|
|
33968
|
+
const shouldDeleteGuideRef = useRef49(false);
|
|
33916
33969
|
const setEditorShowGuides = useCallback144((newValue) => {
|
|
33917
33970
|
setEditorShowGuidesState((prevState) => {
|
|
33918
33971
|
const newVal = newValue(prevState);
|
|
@@ -34644,7 +34697,6 @@ var renderToDOM = (content7) => {
|
|
|
34644
34697
|
};
|
|
34645
34698
|
renderToDOM(/* @__PURE__ */ jsx297(NoRegisterRoot, {}));
|
|
34646
34699
|
Internals70.waitForRoot((NewRoot) => {
|
|
34647
|
-
Internals70.enableSequenceStackTraces();
|
|
34648
34700
|
renderToDOM(/* @__PURE__ */ jsx297(Studio, {
|
|
34649
34701
|
readOnly: false,
|
|
34650
34702
|
rootComponent: NewRoot
|