@remotion/studio 4.0.429 → 4.0.430
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-59m8tgkh.js} +409 -357
- package/dist/esm/chunk-m17t3vjq.js +9 -0
- package/dist/esm/index.mjs +0 -16
- package/dist/esm/internals.mjs +407 -370
- package/dist/esm/previewEntry.mjs +407 -371
- package/dist/esm/renderEntry.mjs +3 -5
- 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 +4 -3
- package/dist/esm/chunk-6jf1natv.js +0 -25
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
7
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
8
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
-
for (let key of __getOwnPropNames(mod))
|
|
10
|
-
if (!__hasOwnProp.call(to, key))
|
|
11
|
-
__defProp(to, key, {
|
|
12
|
-
get: () => mod[key],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
1
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
18
2
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
19
3
|
}) : x)(function(x) {
|
|
@@ -2916,184 +2900,6 @@ var setCurrentFps = (d) => {
|
|
|
2916
2900
|
// src/components/Timeline/timeline-scroll-logic.ts
|
|
2917
2901
|
import { interpolate } from "remotion";
|
|
2918
2902
|
|
|
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
2903
|
// src/helpers/timeline-layout.ts
|
|
3098
2904
|
var TIMELINE_PADDING = 16;
|
|
3099
2905
|
var TIMELINE_BORDER = 1;
|
|
@@ -3101,28 +2907,17 @@ var TIMELINE_ITEM_BORDER_BOTTOM = 1;
|
|
|
3101
2907
|
var TIMELINE_TRACK_EXPANDED_HEIGHT = 100;
|
|
3102
2908
|
var SCHEMA_FIELD_ROW_HEIGHT = 26;
|
|
3103
2909
|
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
|
-
]);
|
|
2910
|
+
var SUPPORTED_SCHEMA_TYPES = new Set(["number", "boolean"]);
|
|
3116
2911
|
var getSchemaFields = (controls) => {
|
|
3117
2912
|
if (!controls) {
|
|
3118
2913
|
return null;
|
|
3119
2914
|
}
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
const typeName = getZodSchemaType(fieldSchema);
|
|
2915
|
+
return Object.entries(controls.schema).map(([key, fieldSchema]) => {
|
|
2916
|
+
const typeName = fieldSchema.type;
|
|
3123
2917
|
const supported = SUPPORTED_SCHEMA_TYPES.has(typeName);
|
|
3124
2918
|
return {
|
|
3125
2919
|
key,
|
|
2920
|
+
description: fieldSchema.description,
|
|
3126
2921
|
typeName,
|
|
3127
2922
|
supported,
|
|
3128
2923
|
rowHeight: supported ? SCHEMA_FIELD_ROW_HEIGHT : UNSUPPORTED_FIELD_ROW_HEIGHT,
|
|
@@ -11935,6 +11730,184 @@ import { Internals as Internals30 } from "remotion";
|
|
|
11935
11730
|
// src/api/save-default-props.ts
|
|
11936
11731
|
import { getRemotionEnvironment as getRemotionEnvironment4 } from "remotion";
|
|
11937
11732
|
|
|
11733
|
+
// src/components/RenderModal/SchemaEditor/zod-schema-type.ts
|
|
11734
|
+
var zodSafeParse = (schema, data) => {
|
|
11735
|
+
return schema.safeParse(data);
|
|
11736
|
+
};
|
|
11737
|
+
var getZodDef = (schema) => {
|
|
11738
|
+
if (schema._def)
|
|
11739
|
+
return schema._def;
|
|
11740
|
+
if (schema._zod)
|
|
11741
|
+
return schema._zod.def;
|
|
11742
|
+
throw new Error("Invalid zod schema: missing _def and _zod");
|
|
11743
|
+
};
|
|
11744
|
+
var v3TypeNameMap = {
|
|
11745
|
+
ZodString: "string",
|
|
11746
|
+
ZodNumber: "number",
|
|
11747
|
+
ZodBoolean: "boolean",
|
|
11748
|
+
ZodObject: "object",
|
|
11749
|
+
ZodArray: "array",
|
|
11750
|
+
ZodEnum: "enum",
|
|
11751
|
+
ZodUnion: "union",
|
|
11752
|
+
ZodDiscriminatedUnion: "discriminatedUnion",
|
|
11753
|
+
ZodOptional: "optional",
|
|
11754
|
+
ZodNullable: "nullable",
|
|
11755
|
+
ZodDefault: "default",
|
|
11756
|
+
ZodTuple: "tuple",
|
|
11757
|
+
ZodDate: "date",
|
|
11758
|
+
ZodAny: "any",
|
|
11759
|
+
ZodUnknown: "unknown",
|
|
11760
|
+
ZodBigInt: "bigint",
|
|
11761
|
+
ZodNull: "null",
|
|
11762
|
+
ZodUndefined: "undefined",
|
|
11763
|
+
ZodEffects: "effects",
|
|
11764
|
+
ZodLiteral: "literal",
|
|
11765
|
+
ZodRecord: "record",
|
|
11766
|
+
ZodNever: "never",
|
|
11767
|
+
ZodVoid: "void",
|
|
11768
|
+
ZodNaN: "nan",
|
|
11769
|
+
ZodSymbol: "symbol",
|
|
11770
|
+
ZodIntersection: "intersection",
|
|
11771
|
+
ZodMap: "map",
|
|
11772
|
+
ZodSet: "set",
|
|
11773
|
+
ZodLazy: "lazy",
|
|
11774
|
+
ZodFunction: "function",
|
|
11775
|
+
ZodNativeEnum: "nativeEnum",
|
|
11776
|
+
ZodCatch: "catch",
|
|
11777
|
+
ZodPromise: "promise",
|
|
11778
|
+
ZodBranded: "branded",
|
|
11779
|
+
ZodPipeline: "pipeline"
|
|
11780
|
+
};
|
|
11781
|
+
var isZodV3Schema = (schema) => {
|
|
11782
|
+
const def = getZodDef(schema);
|
|
11783
|
+
return "typeName" in def;
|
|
11784
|
+
};
|
|
11785
|
+
var getZodSchemaType = (schema) => {
|
|
11786
|
+
const def = getZodDef(schema);
|
|
11787
|
+
if ("typeName" in def) {
|
|
11788
|
+
const { typeName } = def;
|
|
11789
|
+
return v3TypeNameMap[typeName] ?? typeName;
|
|
11790
|
+
}
|
|
11791
|
+
const { type } = def;
|
|
11792
|
+
if (type === "union" && def.discriminator !== undefined) {
|
|
11793
|
+
return "discriminatedUnion";
|
|
11794
|
+
}
|
|
11795
|
+
return type;
|
|
11796
|
+
};
|
|
11797
|
+
var getZodSchemaDescription = (schema) => {
|
|
11798
|
+
if (isZodV3Schema(schema)) {
|
|
11799
|
+
return getZodDef(schema).description;
|
|
11800
|
+
}
|
|
11801
|
+
return schema.description;
|
|
11802
|
+
};
|
|
11803
|
+
var getObjectShape = (schema) => {
|
|
11804
|
+
const { shape } = getZodDef(schema);
|
|
11805
|
+
return typeof shape === "function" ? shape() : shape;
|
|
11806
|
+
};
|
|
11807
|
+
var getArrayElement = (schema) => {
|
|
11808
|
+
const def = getZodDef(schema);
|
|
11809
|
+
return isZodV3Schema(schema) ? def.type : def.element;
|
|
11810
|
+
};
|
|
11811
|
+
var getInnerType = (schema) => {
|
|
11812
|
+
return getZodDef(schema).innerType;
|
|
11813
|
+
};
|
|
11814
|
+
var getEffectsInner = (schema) => {
|
|
11815
|
+
return getZodDef(schema).schema;
|
|
11816
|
+
};
|
|
11817
|
+
var getLiteralValue = (schema) => {
|
|
11818
|
+
const def = getZodDef(schema);
|
|
11819
|
+
if (isZodV3Schema(schema)) {
|
|
11820
|
+
return def.value;
|
|
11821
|
+
}
|
|
11822
|
+
return def.values?.[0];
|
|
11823
|
+
};
|
|
11824
|
+
var getEnumValues = (schema) => {
|
|
11825
|
+
const def = getZodDef(schema);
|
|
11826
|
+
if (isZodV3Schema(schema)) {
|
|
11827
|
+
return def.values;
|
|
11828
|
+
}
|
|
11829
|
+
const { entries } = def;
|
|
11830
|
+
return Object.values(entries);
|
|
11831
|
+
};
|
|
11832
|
+
var getFirstEnumValue = (schema) => {
|
|
11833
|
+
const def = getZodDef(schema);
|
|
11834
|
+
if (isZodV3Schema(schema)) {
|
|
11835
|
+
if (def.typeName === "ZodNativeEnum") {
|
|
11836
|
+
const vals = Object.values(def.values);
|
|
11837
|
+
return vals[0];
|
|
11838
|
+
}
|
|
11839
|
+
return def.values[0];
|
|
11840
|
+
}
|
|
11841
|
+
const { entries } = def;
|
|
11842
|
+
const pairs = Object.entries(entries);
|
|
11843
|
+
const hasReverseMapping = pairs.some(([key, value]) => key !== String(value));
|
|
11844
|
+
if (hasReverseMapping) {
|
|
11845
|
+
const forwardPairs = pairs.filter(([key]) => Number.isNaN(Number(key)));
|
|
11846
|
+
if (forwardPairs.length > 0) {
|
|
11847
|
+
return forwardPairs[0][1];
|
|
11848
|
+
}
|
|
11849
|
+
}
|
|
11850
|
+
return Object.values(entries)[0];
|
|
11851
|
+
};
|
|
11852
|
+
var getUnionOptions = (schema) => {
|
|
11853
|
+
return getZodDef(schema).options;
|
|
11854
|
+
};
|
|
11855
|
+
var getDefaultValue = (schema) => {
|
|
11856
|
+
const dv = getZodDef(schema).defaultValue;
|
|
11857
|
+
return typeof dv === "function" ? dv() : dv;
|
|
11858
|
+
};
|
|
11859
|
+
var getDiscriminator = (schema) => {
|
|
11860
|
+
return getZodDef(schema).discriminator;
|
|
11861
|
+
};
|
|
11862
|
+
var getDiscriminatedOptionKeys = (schema) => {
|
|
11863
|
+
const def = getZodDef(schema);
|
|
11864
|
+
const discriminator = getDiscriminator(schema);
|
|
11865
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
11866
|
+
return [...def.optionsMap.keys()];
|
|
11867
|
+
}
|
|
11868
|
+
const options = getUnionOptions(schema);
|
|
11869
|
+
return options.map((option) => {
|
|
11870
|
+
const shape = getObjectShape(option);
|
|
11871
|
+
const discriminatorSchema = shape[discriminator];
|
|
11872
|
+
return getLiteralValue(discriminatorSchema);
|
|
11873
|
+
});
|
|
11874
|
+
};
|
|
11875
|
+
var getDiscriminatedOption = (schema, discriminatorValue) => {
|
|
11876
|
+
const def = getZodDef(schema);
|
|
11877
|
+
const discriminator = getDiscriminator(schema);
|
|
11878
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
11879
|
+
return def.optionsMap.get(discriminatorValue);
|
|
11880
|
+
}
|
|
11881
|
+
const options = getUnionOptions(schema);
|
|
11882
|
+
return options.find((option) => {
|
|
11883
|
+
const shape = getObjectShape(option);
|
|
11884
|
+
const discriminatorSchema = shape[discriminator];
|
|
11885
|
+
return getLiteralValue(discriminatorSchema) === discriminatorValue;
|
|
11886
|
+
});
|
|
11887
|
+
};
|
|
11888
|
+
var getIntersectionSchemas = (schema) => {
|
|
11889
|
+
const def = getZodDef(schema);
|
|
11890
|
+
return { left: def.left, right: def.right };
|
|
11891
|
+
};
|
|
11892
|
+
var getTupleItems = (schema) => {
|
|
11893
|
+
return getZodDef(schema).items;
|
|
11894
|
+
};
|
|
11895
|
+
var getRecordValueType = (schema) => {
|
|
11896
|
+
return getZodDef(schema).valueType;
|
|
11897
|
+
};
|
|
11898
|
+
var getRecordKeyType = (schema) => {
|
|
11899
|
+
return getZodDef(schema).keyType;
|
|
11900
|
+
};
|
|
11901
|
+
var getPipelineOutput = (schema) => {
|
|
11902
|
+
return getZodDef(schema).out;
|
|
11903
|
+
};
|
|
11904
|
+
var getPipelineInput = (schema) => {
|
|
11905
|
+
return getZodDef(schema).in;
|
|
11906
|
+
};
|
|
11907
|
+
var getBrandedInner = (schema) => {
|
|
11908
|
+
return isZodV3Schema(schema) ? getZodDef(schema).type : schema;
|
|
11909
|
+
};
|
|
11910
|
+
|
|
11938
11911
|
// src/components/RenderModal/SchemaEditor/extract-enum-json-paths.ts
|
|
11939
11912
|
var extractEnumJsonPaths = ({
|
|
11940
11913
|
schema,
|
|
@@ -14286,7 +14259,8 @@ var InputDraggerForwardRefFn = ({
|
|
|
14286
14259
|
return {
|
|
14287
14260
|
...inputBaseStyle,
|
|
14288
14261
|
backgroundColor: "transparent",
|
|
14289
|
-
borderColor: "transparent"
|
|
14262
|
+
borderColor: "transparent",
|
|
14263
|
+
padding: "4px 6px"
|
|
14290
14264
|
};
|
|
14291
14265
|
}, []);
|
|
14292
14266
|
const span = useMemo69(() => ({
|
|
@@ -21832,7 +21806,7 @@ var Inner2 = () => {
|
|
|
21832
21806
|
|
|
21833
21807
|
// src/components/Timeline/TimelineList.tsx
|
|
21834
21808
|
import { PlayerInternals as PlayerInternals18 } from "@remotion/player";
|
|
21835
|
-
import { useRef as
|
|
21809
|
+
import { useRef as useRef40 } from "react";
|
|
21836
21810
|
|
|
21837
21811
|
// src/components/Timeline/TimelineListItem.tsx
|
|
21838
21812
|
import {
|
|
@@ -21877,6 +21851,7 @@ import {
|
|
|
21877
21851
|
useContext as useContext67,
|
|
21878
21852
|
useEffect as useEffect68,
|
|
21879
21853
|
useMemo as useMemo104,
|
|
21854
|
+
useRef as useRef37,
|
|
21880
21855
|
useState as useState72
|
|
21881
21856
|
} from "react";
|
|
21882
21857
|
import { Internals as Internals49 } from "remotion";
|
|
@@ -21894,19 +21869,15 @@ var draggerStyle = {
|
|
|
21894
21869
|
width: 80,
|
|
21895
21870
|
marginLeft: "auto"
|
|
21896
21871
|
};
|
|
21872
|
+
var checkboxContainer = {
|
|
21873
|
+
marginLeft: "auto"
|
|
21874
|
+
};
|
|
21897
21875
|
var notEditableBackground = {
|
|
21898
21876
|
backgroundColor: "rgba(255, 0, 0, 0.2)",
|
|
21899
21877
|
borderRadius: 3,
|
|
21900
21878
|
padding: "0 4px"
|
|
21901
21879
|
};
|
|
21902
|
-
var TimelineNumberField = ({
|
|
21903
|
-
field,
|
|
21904
|
-
canUpdate,
|
|
21905
|
-
onSave,
|
|
21906
|
-
onSavingChange,
|
|
21907
|
-
onDragValueChange,
|
|
21908
|
-
onDragEnd
|
|
21909
|
-
}) => {
|
|
21880
|
+
var TimelineNumberField = ({ field, codeValue, canUpdate, onSave, onDragValueChange, onDragEnd }) => {
|
|
21910
21881
|
const [dragValue, setDragValue] = useState71(null);
|
|
21911
21882
|
const dragging = useRef36(false);
|
|
21912
21883
|
const onValueChange = useCallback99((newVal) => {
|
|
@@ -21916,56 +21887,60 @@ var TimelineNumberField = ({
|
|
|
21916
21887
|
}, [onDragValueChange, field.key]);
|
|
21917
21888
|
useEffect67(() => {
|
|
21918
21889
|
setDragValue(null);
|
|
21919
|
-
onSavingChange(false);
|
|
21920
21890
|
onDragEnd();
|
|
21921
|
-
}, [field.currentValue,
|
|
21891
|
+
}, [field.currentValue, onDragEnd]);
|
|
21922
21892
|
const onValueChangeEnd = useCallback99((newVal) => {
|
|
21923
|
-
if (canUpdate && newVal !==
|
|
21924
|
-
onSavingChange(true);
|
|
21893
|
+
if (canUpdate && newVal !== codeValue) {
|
|
21925
21894
|
onSave(field.key, newVal).catch(() => {
|
|
21926
|
-
onSavingChange(false);
|
|
21927
21895
|
setDragValue(null);
|
|
21928
21896
|
});
|
|
21929
21897
|
} else {
|
|
21930
21898
|
setDragValue(null);
|
|
21931
21899
|
}
|
|
21932
|
-
}, [canUpdate, onSave,
|
|
21900
|
+
}, [canUpdate, onSave, field.key, codeValue]);
|
|
21933
21901
|
const onTextChange = useCallback99((newVal) => {
|
|
21934
21902
|
if (canUpdate) {
|
|
21935
21903
|
const parsed = Number(newVal);
|
|
21936
|
-
if (!Number.isNaN(parsed) && parsed !==
|
|
21904
|
+
if (!Number.isNaN(parsed) && parsed !== codeValue) {
|
|
21937
21905
|
setDragValue(parsed);
|
|
21938
|
-
onSavingChange(true);
|
|
21939
21906
|
onSave(field.key, parsed).catch(() => {
|
|
21940
|
-
onSavingChange(false);
|
|
21941
21907
|
setDragValue(null);
|
|
21942
21908
|
});
|
|
21943
21909
|
}
|
|
21944
21910
|
}
|
|
21945
|
-
}, [canUpdate, onSave,
|
|
21911
|
+
}, [canUpdate, onSave, field.key, codeValue]);
|
|
21946
21912
|
return /* @__PURE__ */ jsx195(InputDragger, {
|
|
21947
21913
|
type: "number",
|
|
21948
|
-
value: dragValue ??
|
|
21914
|
+
value: dragValue ?? codeValue,
|
|
21949
21915
|
style: draggerStyle,
|
|
21950
21916
|
status: "ok",
|
|
21951
21917
|
onValueChange,
|
|
21952
21918
|
onValueChangeEnd,
|
|
21953
21919
|
onTextChange,
|
|
21954
|
-
min:
|
|
21955
|
-
max:
|
|
21956
|
-
step:
|
|
21920
|
+
min: field.fieldSchema.type === "number" ? field.fieldSchema.min ?? -Infinity : -Infinity,
|
|
21921
|
+
max: field.fieldSchema.type === "number" ? field.fieldSchema.max ?? Infinity : Infinity,
|
|
21922
|
+
step: field.fieldSchema.type === "number" ? field.fieldSchema.step ?? 1 : 1,
|
|
21957
21923
|
rightAlign: true
|
|
21958
21924
|
});
|
|
21959
21925
|
};
|
|
21960
|
-
var
|
|
21961
|
-
|
|
21962
|
-
|
|
21963
|
-
|
|
21964
|
-
|
|
21965
|
-
|
|
21966
|
-
|
|
21967
|
-
|
|
21968
|
-
|
|
21926
|
+
var TimelineBooleanField = ({ field, codeValue, canUpdate, onSave }) => {
|
|
21927
|
+
const checked = Boolean(codeValue);
|
|
21928
|
+
const onChange = useCallback99(() => {
|
|
21929
|
+
if (canUpdate) {
|
|
21930
|
+
onSave(field.key, !checked);
|
|
21931
|
+
}
|
|
21932
|
+
}, [canUpdate, onSave, field.key, checked]);
|
|
21933
|
+
return /* @__PURE__ */ jsx195("div", {
|
|
21934
|
+
style: checkboxContainer,
|
|
21935
|
+
children: /* @__PURE__ */ jsx195(Checkbox, {
|
|
21936
|
+
checked,
|
|
21937
|
+
onChange,
|
|
21938
|
+
name: field.key,
|
|
21939
|
+
disabled: !canUpdate
|
|
21940
|
+
})
|
|
21941
|
+
});
|
|
21942
|
+
};
|
|
21943
|
+
var TimelineFieldValue = ({ field, onSave, onDragValueChange, onDragEnd, propStatus, canUpdate }) => {
|
|
21969
21944
|
const wrapperStyle = canUpdate === null || canUpdate === false ? notEditableBackground : undefined;
|
|
21970
21945
|
if (!field.supported) {
|
|
21971
21946
|
return /* @__PURE__ */ jsx195("span", {
|
|
@@ -21988,31 +21963,34 @@ var TimelineFieldValue = ({
|
|
|
21988
21963
|
})
|
|
21989
21964
|
});
|
|
21990
21965
|
}
|
|
21966
|
+
const effectiveCodeValue = propStatus.codeValue ?? field.currentValue ?? field.fieldSchema.default;
|
|
21991
21967
|
if (field.typeName === "number") {
|
|
21992
21968
|
return /* @__PURE__ */ jsx195("span", {
|
|
21993
21969
|
style: wrapperStyle,
|
|
21994
21970
|
children: /* @__PURE__ */ jsx195(TimelineNumberField, {
|
|
21995
21971
|
field,
|
|
21972
|
+
codeValue: effectiveCodeValue,
|
|
21996
21973
|
canUpdate,
|
|
21997
21974
|
onSave,
|
|
21998
|
-
onSavingChange,
|
|
21999
21975
|
onDragValueChange,
|
|
22000
21976
|
onDragEnd
|
|
22001
21977
|
})
|
|
22002
21978
|
});
|
|
22003
21979
|
}
|
|
21980
|
+
if (field.typeName === "boolean") {
|
|
21981
|
+
return /* @__PURE__ */ jsx195("span", {
|
|
21982
|
+
style: wrapperStyle,
|
|
21983
|
+
children: /* @__PURE__ */ jsx195(TimelineBooleanField, {
|
|
21984
|
+
field,
|
|
21985
|
+
codeValue: effectiveCodeValue,
|
|
21986
|
+
canUpdate,
|
|
21987
|
+
onSave
|
|
21988
|
+
})
|
|
21989
|
+
});
|
|
21990
|
+
}
|
|
22004
21991
|
return /* @__PURE__ */ jsx195("span", {
|
|
22005
21992
|
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
|
|
21993
|
+
children: String(effectiveCodeValue)
|
|
22016
21994
|
});
|
|
22017
21995
|
};
|
|
22018
21996
|
|
|
@@ -22044,30 +22022,20 @@ var fieldLabelRow = {
|
|
|
22044
22022
|
gap: 6
|
|
22045
22023
|
};
|
|
22046
22024
|
var TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatus }) => {
|
|
22047
|
-
const [saving, setSaving] = useState72(false);
|
|
22048
|
-
const onSavingChange = useCallback100((s) => {
|
|
22049
|
-
setSaving(s);
|
|
22050
|
-
}, []);
|
|
22051
22025
|
return /* @__PURE__ */ jsxs93("div", {
|
|
22052
22026
|
style: { ...fieldRow, height: field.rowHeight },
|
|
22053
22027
|
children: [
|
|
22054
|
-
/* @__PURE__ */
|
|
22028
|
+
/* @__PURE__ */ jsx196("div", {
|
|
22055
22029
|
style: fieldLabelRow,
|
|
22056
|
-
children:
|
|
22057
|
-
|
|
22058
|
-
|
|
22059
|
-
|
|
22060
|
-
}),
|
|
22061
|
-
/* @__PURE__ */ jsx196(TimelineFieldSavingSpinner, {
|
|
22062
|
-
saving
|
|
22063
|
-
})
|
|
22064
|
-
]
|
|
22030
|
+
children: /* @__PURE__ */ jsx196("span", {
|
|
22031
|
+
style: fieldName,
|
|
22032
|
+
children: field.description ?? field.key
|
|
22033
|
+
})
|
|
22065
22034
|
}),
|
|
22066
22035
|
/* @__PURE__ */ jsx196(TimelineFieldValue, {
|
|
22067
22036
|
field,
|
|
22068
22037
|
propStatus,
|
|
22069
22038
|
onSave,
|
|
22070
|
-
onSavingChange,
|
|
22071
22039
|
onDragValueChange,
|
|
22072
22040
|
onDragEnd,
|
|
22073
22041
|
canUpdate: propStatus?.canUpdate ?? false
|
|
@@ -22077,6 +22045,8 @@ var TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatu
|
|
|
22077
22045
|
};
|
|
22078
22046
|
var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
22079
22047
|
const [propStatuses, setPropStatuses] = useState72(null);
|
|
22048
|
+
const { previewServerState: state, subscribeToEvent } = useContext67(StudioServerConnectionCtx);
|
|
22049
|
+
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
22080
22050
|
const schemaFields = useMemo104(() => getSchemaFields(sequence.controls), [sequence.controls]);
|
|
22081
22051
|
const validatedLocation = useMemo104(() => {
|
|
22082
22052
|
if (!originalLocation || !originalLocation.source || !originalLocation.line) {
|
|
@@ -22088,17 +22058,32 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
22088
22058
|
column: originalLocation.column ?? 0
|
|
22089
22059
|
};
|
|
22090
22060
|
}, [originalLocation]);
|
|
22061
|
+
const locationSource = validatedLocation?.source ?? null;
|
|
22062
|
+
const locationLine = validatedLocation?.line ?? null;
|
|
22063
|
+
const locationColumn = validatedLocation?.column ?? null;
|
|
22064
|
+
const schemaKeysString = useMemo104(() => schemaFields ? schemaFields.map((f) => f.key).join(",") : null, [schemaFields]);
|
|
22065
|
+
const currentLocationSource = useRef37(locationSource);
|
|
22066
|
+
currentLocationSource.current = locationSource;
|
|
22067
|
+
const currentLocationLine = useRef37(locationLine);
|
|
22068
|
+
currentLocationLine.current = locationLine;
|
|
22069
|
+
const currentLocationColumn = useRef37(locationColumn);
|
|
22070
|
+
currentLocationColumn.current = locationColumn;
|
|
22091
22071
|
useEffect68(() => {
|
|
22092
|
-
if (!
|
|
22072
|
+
if (!clientId || !locationSource || !locationLine || locationColumn === null || !schemaKeysString) {
|
|
22093
22073
|
setPropStatuses(null);
|
|
22094
22074
|
return;
|
|
22095
22075
|
}
|
|
22096
|
-
|
|
22097
|
-
|
|
22098
|
-
|
|
22099
|
-
|
|
22100
|
-
|
|
22076
|
+
const keys = schemaKeysString.split(",");
|
|
22077
|
+
callApi("/api/subscribe-to-sequence-props", {
|
|
22078
|
+
fileName: locationSource,
|
|
22079
|
+
line: locationLine,
|
|
22080
|
+
column: locationColumn,
|
|
22081
|
+
keys,
|
|
22082
|
+
clientId
|
|
22101
22083
|
}).then((result) => {
|
|
22084
|
+
if (currentLocationSource.current !== locationSource || currentLocationLine.current !== locationLine || currentLocationColumn.current !== locationColumn) {
|
|
22085
|
+
return;
|
|
22086
|
+
}
|
|
22102
22087
|
if (result.canUpdate) {
|
|
22103
22088
|
setPropStatuses(result.props);
|
|
22104
22089
|
} else {
|
|
@@ -22107,7 +22092,43 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
22107
22092
|
}).catch(() => {
|
|
22108
22093
|
setPropStatuses(null);
|
|
22109
22094
|
});
|
|
22110
|
-
|
|
22095
|
+
return () => {
|
|
22096
|
+
callApi("/api/unsubscribe-from-sequence-props", {
|
|
22097
|
+
fileName: locationSource,
|
|
22098
|
+
line: locationLine,
|
|
22099
|
+
column: locationColumn,
|
|
22100
|
+
clientId
|
|
22101
|
+
}).catch(() => {});
|
|
22102
|
+
};
|
|
22103
|
+
}, [
|
|
22104
|
+
clientId,
|
|
22105
|
+
locationSource,
|
|
22106
|
+
locationLine,
|
|
22107
|
+
locationColumn,
|
|
22108
|
+
schemaKeysString
|
|
22109
|
+
]);
|
|
22110
|
+
useEffect68(() => {
|
|
22111
|
+
if (!locationSource || !locationLine || locationColumn === null) {
|
|
22112
|
+
return;
|
|
22113
|
+
}
|
|
22114
|
+
const listener = (event) => {
|
|
22115
|
+
if (event.type !== "sequence-props-updated") {
|
|
22116
|
+
return;
|
|
22117
|
+
}
|
|
22118
|
+
if (event.fileName !== currentLocationSource.current || event.line !== currentLocationLine.current || event.column !== currentLocationColumn.current) {
|
|
22119
|
+
return;
|
|
22120
|
+
}
|
|
22121
|
+
if (event.result.canUpdate) {
|
|
22122
|
+
setPropStatuses(event.result.props);
|
|
22123
|
+
} else {
|
|
22124
|
+
setPropStatuses(null);
|
|
22125
|
+
}
|
|
22126
|
+
};
|
|
22127
|
+
const unsub = subscribeToEvent("sequence-props-updated", listener);
|
|
22128
|
+
return () => {
|
|
22129
|
+
unsub();
|
|
22130
|
+
};
|
|
22131
|
+
}, [locationSource, locationLine, locationColumn, subscribeToEvent]);
|
|
22111
22132
|
const expandedHeight = useMemo104(() => getExpandedTrackHeight(sequence.controls), [sequence.controls]);
|
|
22112
22133
|
const { setOverride, clearOverrides } = useContext67(Internals49.SequenceControlOverrideContext);
|
|
22113
22134
|
const onSave = useCallback100((key4, value) => {
|
|
@@ -22118,23 +22139,27 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
22118
22139
|
if (!status || !status.canUpdate) {
|
|
22119
22140
|
return Promise.reject(new Error("Cannot save"));
|
|
22120
22141
|
}
|
|
22142
|
+
const field = schemaFields?.find((f) => f.key === key4);
|
|
22143
|
+
const defaultValue = field && field.fieldSchema.default !== undefined ? JSON.stringify(field.fieldSchema.default) : null;
|
|
22121
22144
|
return callApi("/api/save-sequence-props", {
|
|
22122
22145
|
fileName: validatedLocation.source,
|
|
22123
22146
|
line: validatedLocation.line,
|
|
22124
22147
|
column: validatedLocation.column,
|
|
22125
22148
|
key: key4,
|
|
22126
22149
|
value: JSON.stringify(value),
|
|
22127
|
-
enumPaths: []
|
|
22150
|
+
enumPaths: [],
|
|
22151
|
+
defaultValue
|
|
22128
22152
|
}).then(() => {
|
|
22129
22153
|
return;
|
|
22130
22154
|
});
|
|
22131
|
-
}, [propStatuses, validatedLocation]);
|
|
22155
|
+
}, [propStatuses, validatedLocation, schemaFields]);
|
|
22156
|
+
const overrideId = sequence.controls?.overrideId ?? sequence.id;
|
|
22132
22157
|
const onDragValueChange = useCallback100((key4, value) => {
|
|
22133
|
-
setOverride(
|
|
22134
|
-
}, [setOverride,
|
|
22158
|
+
setOverride(overrideId, key4, value);
|
|
22159
|
+
}, [setOverride, overrideId]);
|
|
22135
22160
|
const onDragEnd = useCallback100(() => {
|
|
22136
|
-
clearOverrides(
|
|
22137
|
-
}, [clearOverrides,
|
|
22161
|
+
clearOverrides(overrideId);
|
|
22162
|
+
}, [clearOverrides, overrideId]);
|
|
22138
22163
|
return /* @__PURE__ */ jsx196("div", {
|
|
22139
22164
|
style: { ...expandedSectionBase, height: expandedHeight },
|
|
22140
22165
|
children: schemaFields ? schemaFields.map((field) => /* @__PURE__ */ jsx196(TimelineFieldRow, {
|
|
@@ -22409,7 +22434,8 @@ var arrowButton = {
|
|
|
22409
22434
|
lineHeight: 1
|
|
22410
22435
|
};
|
|
22411
22436
|
var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
22412
|
-
const
|
|
22437
|
+
const { previewServerState } = useContext69(StudioServerConnectionCtx);
|
|
22438
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
22413
22439
|
const { hidden, setHidden } = useContext69(Internals50.SequenceVisibilityToggleContext);
|
|
22414
22440
|
const { expandedTracks, toggleTrack } = useContext69(ExpandedTracksContext);
|
|
22415
22441
|
const [originalLocation, setOriginalLocation] = useState74(null);
|
|
@@ -22423,7 +22449,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
22423
22449
|
console.error("Could not get original location of Sequence", err);
|
|
22424
22450
|
});
|
|
22425
22451
|
}, [sequence.stack]);
|
|
22426
|
-
const isExpanded = expandedTracks[sequence.id] ?? false;
|
|
22452
|
+
const isExpanded = visualModeEnabled && (expandedTracks[sequence.id] ?? false);
|
|
22427
22453
|
const onToggleExpand = useCallback103(() => {
|
|
22428
22454
|
toggleTrack(sequence.id);
|
|
22429
22455
|
}, [sequence.id, toggleTrack]);
|
|
@@ -22515,7 +22541,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
22515
22541
|
};
|
|
22516
22542
|
|
|
22517
22543
|
// src/components/Timeline/TimelineTimeIndicators.tsx
|
|
22518
|
-
import { useContext as useContext70, useEffect as useEffect71, useMemo as useMemo107, useRef as
|
|
22544
|
+
import { useContext as useContext70, useEffect as useEffect71, useMemo as useMemo107, useRef as useRef39 } from "react";
|
|
22519
22545
|
import { Internals as Internals52 } from "remotion";
|
|
22520
22546
|
|
|
22521
22547
|
// src/components/TimeValue.tsx
|
|
@@ -22524,7 +22550,7 @@ import {
|
|
|
22524
22550
|
useCallback as useCallback104,
|
|
22525
22551
|
useEffect as useEffect70,
|
|
22526
22552
|
useImperativeHandle as useImperativeHandle14,
|
|
22527
|
-
useRef as
|
|
22553
|
+
useRef as useRef38
|
|
22528
22554
|
} from "react";
|
|
22529
22555
|
import { Internals as Internals51, useCurrentFrame } from "remotion";
|
|
22530
22556
|
import { jsx as jsx200, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
@@ -22557,7 +22583,7 @@ var TimeValue = () => {
|
|
|
22557
22583
|
const isStill = useIsStill();
|
|
22558
22584
|
const { seek, play, pause, toggle } = PlayerInternals17.usePlayer();
|
|
22559
22585
|
const keybindings = useKeybinding();
|
|
22560
|
-
const ref =
|
|
22586
|
+
const ref = useRef38(null);
|
|
22561
22587
|
const onTextChange = useCallback104((newVal) => {
|
|
22562
22588
|
seek(parseInt(newVal, 10));
|
|
22563
22589
|
}, [seek]);
|
|
@@ -22685,7 +22711,7 @@ var TimelineTimeIndicators = () => {
|
|
|
22685
22711
|
});
|
|
22686
22712
|
};
|
|
22687
22713
|
var Inner3 = ({ windowWidth, durationInFrames, fps }) => {
|
|
22688
|
-
const ref =
|
|
22714
|
+
const ref = useRef39(null);
|
|
22689
22715
|
useEffect71(() => {
|
|
22690
22716
|
const currentRef = ref.current;
|
|
22691
22717
|
if (!currentRef) {
|
|
@@ -22768,7 +22794,7 @@ var container43 = {
|
|
|
22768
22794
|
background: BACKGROUND
|
|
22769
22795
|
};
|
|
22770
22796
|
var TimelineList = ({ timeline }) => {
|
|
22771
|
-
const ref =
|
|
22797
|
+
const ref = useRef40(null);
|
|
22772
22798
|
const size4 = PlayerInternals18.useElementSize(ref, {
|
|
22773
22799
|
shouldApplyCssTransforms: false,
|
|
22774
22800
|
triggerOnWindowResize: false
|
|
@@ -22917,21 +22943,10 @@ var getTimelineSequenceLayout = ({
|
|
|
22917
22943
|
postmountDisplay
|
|
22918
22944
|
}) => {
|
|
22919
22945
|
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);
|
|
22946
|
+
const lastFrame = video.durationInFrames ?? 1;
|
|
22947
|
+
const spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames, lastFrame - startFrom);
|
|
22948
|
+
const naturalSpatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames);
|
|
22949
|
+
const marginLeft = lastFrame === 0 ? 0 : startFrom / lastFrame * (windowWidth - TIMELINE_PADDING * 2);
|
|
22935
22950
|
const nonNegativeMarginLeft = Math.min(marginLeft, 0);
|
|
22936
22951
|
const width = getWidthOfTrack({
|
|
22937
22952
|
durationInFrames,
|
|
@@ -23020,7 +23035,7 @@ var useMaxMediaDuration = (s, fps) => {
|
|
|
23020
23035
|
|
|
23021
23036
|
// src/components/AudioWaveform.tsx
|
|
23022
23037
|
import { getAudioData, getWaveformPortion } from "@remotion/media-utils";
|
|
23023
|
-
import { useEffect as useEffect74, useMemo as useMemo110, useRef as
|
|
23038
|
+
import { useEffect as useEffect74, useMemo as useMemo110, useRef as useRef41, useState as useState76 } from "react";
|
|
23024
23039
|
import { Internals as Internals54 } from "remotion";
|
|
23025
23040
|
|
|
23026
23041
|
// src/components/AudioWaveformBar.tsx
|
|
@@ -23079,12 +23094,12 @@ var AudioWaveform = ({
|
|
|
23079
23094
|
}) => {
|
|
23080
23095
|
const [metadata, setMetadata] = useState76(null);
|
|
23081
23096
|
const [error, setError] = useState76(null);
|
|
23082
|
-
const mountState =
|
|
23097
|
+
const mountState = useRef41({ isMounted: true });
|
|
23083
23098
|
const vidConf = Internals54.useUnsafeVideoConfig();
|
|
23084
23099
|
if (vidConf === null) {
|
|
23085
23100
|
throw new Error("Expected video config");
|
|
23086
23101
|
}
|
|
23087
|
-
const canvas =
|
|
23102
|
+
const canvas = useRef41(null);
|
|
23088
23103
|
useEffect74(() => {
|
|
23089
23104
|
const { current } = mountState;
|
|
23090
23105
|
current.isMounted = true;
|
|
@@ -23284,7 +23299,8 @@ var relativeFrameStyle = {
|
|
|
23284
23299
|
fontSize: 11,
|
|
23285
23300
|
fontFamily: "Arial, Helvetica, sans-serif",
|
|
23286
23301
|
color: "white",
|
|
23287
|
-
opacity: 0.5
|
|
23302
|
+
opacity: 0.5,
|
|
23303
|
+
whiteSpace: "nowrap"
|
|
23288
23304
|
};
|
|
23289
23305
|
var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
23290
23306
|
return /* @__PURE__ */ jsx208("div", {
|
|
@@ -23294,7 +23310,7 @@ var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
|
23294
23310
|
};
|
|
23295
23311
|
|
|
23296
23312
|
// src/components/Timeline/TimelineVideoInfo.tsx
|
|
23297
|
-
import { useEffect as useEffect75, useRef as
|
|
23313
|
+
import { useEffect as useEffect75, useRef as useRef42, useState as useState77 } from "react";
|
|
23298
23314
|
import { useVideoConfig as useVideoConfig5 } from "remotion";
|
|
23299
23315
|
|
|
23300
23316
|
// src/helpers/extract-frames.ts
|
|
@@ -23342,15 +23358,22 @@ async function extractFrames({
|
|
|
23342
23358
|
return;
|
|
23343
23359
|
}
|
|
23344
23360
|
const sink = new VideoSampleSink(videoTrack);
|
|
23345
|
-
|
|
23346
|
-
|
|
23347
|
-
|
|
23348
|
-
|
|
23349
|
-
|
|
23350
|
-
|
|
23351
|
-
|
|
23361
|
+
const sampleIterator = sink.samplesAtTimestamps(timestamps);
|
|
23362
|
+
try {
|
|
23363
|
+
for await (const videoSample of sampleIterator) {
|
|
23364
|
+
if (signal?.aborted) {
|
|
23365
|
+
videoSample?.close();
|
|
23366
|
+
break;
|
|
23367
|
+
}
|
|
23368
|
+
if (!videoSample) {
|
|
23369
|
+
continue;
|
|
23370
|
+
}
|
|
23371
|
+
onVideoSample(videoSample);
|
|
23352
23372
|
}
|
|
23353
|
-
|
|
23373
|
+
} finally {
|
|
23374
|
+
try {
|
|
23375
|
+
await sampleIterator.return?.();
|
|
23376
|
+
} catch {}
|
|
23354
23377
|
}
|
|
23355
23378
|
} catch (error) {
|
|
23356
23379
|
if (error instanceof InputDisposedError2) {
|
|
@@ -23623,9 +23646,9 @@ var TimelineVideoInfo = ({
|
|
|
23623
23646
|
playbackRate
|
|
23624
23647
|
}) => {
|
|
23625
23648
|
const { fps } = useVideoConfig5();
|
|
23626
|
-
const ref =
|
|
23649
|
+
const ref = useRef42(null);
|
|
23627
23650
|
const [error, setError] = useState77(null);
|
|
23628
|
-
const aspectRatio =
|
|
23651
|
+
const aspectRatio = useRef42(getAspectRatioFromCache(src));
|
|
23629
23652
|
useEffect75(() => {
|
|
23630
23653
|
return () => {
|
|
23631
23654
|
clearFramesForSrc(src);
|
|
@@ -23693,46 +23716,59 @@ var TimelineVideoInfo = ({
|
|
|
23693
23716
|
},
|
|
23694
23717
|
src,
|
|
23695
23718
|
onVideoSample: (sample) => {
|
|
23696
|
-
|
|
23697
|
-
|
|
23698
|
-
|
|
23699
|
-
|
|
23700
|
-
|
|
23701
|
-
|
|
23702
|
-
|
|
23703
|
-
|
|
23704
|
-
|
|
23705
|
-
|
|
23706
|
-
|
|
23707
|
-
|
|
23708
|
-
|
|
23709
|
-
|
|
23710
|
-
|
|
23711
|
-
|
|
23712
|
-
|
|
23713
|
-
|
|
23714
|
-
|
|
23715
|
-
|
|
23719
|
+
let frame2;
|
|
23720
|
+
try {
|
|
23721
|
+
frame2 = sample.toVideoFrame();
|
|
23722
|
+
const scale = HEIGHT / frame2.displayHeight * window.devicePixelRatio;
|
|
23723
|
+
const transformed = resizeVideoFrame({
|
|
23724
|
+
frame: frame2,
|
|
23725
|
+
scale
|
|
23726
|
+
});
|
|
23727
|
+
if (transformed !== frame2) {
|
|
23728
|
+
frame2.close();
|
|
23729
|
+
}
|
|
23730
|
+
frame2 = undefined;
|
|
23731
|
+
const databaseKey = makeFrameDatabaseKey(src, transformed.timestamp);
|
|
23732
|
+
const existingFrame = frameDatabase.get(databaseKey);
|
|
23733
|
+
if (existingFrame) {
|
|
23734
|
+
existingFrame.frame.close();
|
|
23735
|
+
}
|
|
23736
|
+
frameDatabase.set(databaseKey, {
|
|
23737
|
+
frame: transformed,
|
|
23738
|
+
lastUsed: Date.now()
|
|
23739
|
+
});
|
|
23740
|
+
if (aspectRatio.current === null) {
|
|
23741
|
+
throw new Error("Aspect ratio is not set");
|
|
23742
|
+
}
|
|
23743
|
+
ensureSlots({
|
|
23744
|
+
filledSlots,
|
|
23745
|
+
fromSeconds,
|
|
23746
|
+
toSeconds,
|
|
23747
|
+
naturalWidth,
|
|
23748
|
+
aspectRatio: aspectRatio.current
|
|
23749
|
+
});
|
|
23750
|
+
fillFrameWhereItFits({
|
|
23751
|
+
ctx,
|
|
23752
|
+
filledSlots,
|
|
23753
|
+
visualizationWidth: naturalWidth,
|
|
23754
|
+
frame: transformed,
|
|
23755
|
+
segmentDuration: toSeconds - fromSeconds,
|
|
23756
|
+
fromSeconds
|
|
23757
|
+
});
|
|
23758
|
+
} catch (e) {
|
|
23759
|
+
if (frame2) {
|
|
23760
|
+
frame2.close();
|
|
23761
|
+
}
|
|
23762
|
+
throw e;
|
|
23763
|
+
} finally {
|
|
23764
|
+
sample.close();
|
|
23716
23765
|
}
|
|
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
23766
|
},
|
|
23734
23767
|
signal: controller.signal
|
|
23735
23768
|
}).then(() => {
|
|
23769
|
+
if (controller.signal.aborted) {
|
|
23770
|
+
return;
|
|
23771
|
+
}
|
|
23736
23772
|
fillWithCachedFrames({
|
|
23737
23773
|
ctx,
|
|
23738
23774
|
naturalWidth,
|
|
@@ -23908,7 +23944,8 @@ var getExpandedPlaceholderStyle = (controls) => ({
|
|
|
23908
23944
|
});
|
|
23909
23945
|
var TimelineTracks = ({ timeline, hasBeenCut }) => {
|
|
23910
23946
|
const { expandedTracks } = useContext73(ExpandedTracksContext);
|
|
23911
|
-
const
|
|
23947
|
+
const { previewServerState } = useContext73(StudioServerConnectionCtx);
|
|
23948
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
23912
23949
|
const timelineStyle = useMemo112(() => {
|
|
23913
23950
|
return {
|
|
23914
23951
|
...timelineContent,
|
|
@@ -25549,7 +25586,7 @@ import {
|
|
|
25549
25586
|
useContext as useContext85,
|
|
25550
25587
|
useEffect as useEffect81,
|
|
25551
25588
|
useMemo as useMemo121,
|
|
25552
|
-
useRef as
|
|
25589
|
+
useRef as useRef44,
|
|
25553
25590
|
useState as useState83
|
|
25554
25591
|
} from "react";
|
|
25555
25592
|
import { Internals as Internals63 } from "remotion";
|
|
@@ -26422,7 +26459,7 @@ var QuickSwitcherNoResults = ({ query, mode }) => {
|
|
|
26422
26459
|
};
|
|
26423
26460
|
|
|
26424
26461
|
// src/components/QuickSwitcher/QuickSwitcherResult.tsx
|
|
26425
|
-
import { useEffect as useEffect80, useMemo as useMemo120, useRef as
|
|
26462
|
+
import { useEffect as useEffect80, useMemo as useMemo120, useRef as useRef43, useState as useState82 } from "react";
|
|
26426
26463
|
import { jsx as jsx230, jsxs as jsxs117, Fragment as Fragment36 } from "react/jsx-runtime";
|
|
26427
26464
|
var container51 = {
|
|
26428
26465
|
paddingLeft: 16,
|
|
@@ -26452,7 +26489,7 @@ var labelContainer = {
|
|
|
26452
26489
|
};
|
|
26453
26490
|
var QuickSwitcherResult = ({ result, selected }) => {
|
|
26454
26491
|
const [hovered, setIsHovered] = useState82(false);
|
|
26455
|
-
const ref =
|
|
26492
|
+
const ref = useRef43(null);
|
|
26456
26493
|
const keybindings = useKeybinding();
|
|
26457
26494
|
useEffect80(() => {
|
|
26458
26495
|
const { current } = ref;
|
|
@@ -26630,7 +26667,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
|
|
|
26630
26667
|
selectedIndex: 0
|
|
26631
26668
|
});
|
|
26632
26669
|
}, [initialMode, invocationTimestamp]);
|
|
26633
|
-
const inputRef =
|
|
26670
|
+
const inputRef = useRef44(null);
|
|
26634
26671
|
const selectComposition = useSelectComposition();
|
|
26635
26672
|
const closeMenu = useCallback113(() => {
|
|
26636
26673
|
return;
|
|
@@ -27390,7 +27427,7 @@ import {
|
|
|
27390
27427
|
useEffect as useEffect84,
|
|
27391
27428
|
useMemo as useMemo132,
|
|
27392
27429
|
useReducer as useReducer2,
|
|
27393
|
-
useRef as
|
|
27430
|
+
useRef as useRef46,
|
|
27394
27431
|
useState as useState89
|
|
27395
27432
|
} from "react";
|
|
27396
27433
|
|
|
@@ -29133,12 +29170,12 @@ import { BrowserSafeApis as BrowserSafeApis6 } from "@remotion/renderer/client";
|
|
|
29133
29170
|
import { useCallback as useCallback125, useMemo as useMemo127 } from "react";
|
|
29134
29171
|
|
|
29135
29172
|
// src/helpers/use-file-existence.ts
|
|
29136
|
-
import { useContext as useContext87, useEffect as useEffect83, useRef as
|
|
29173
|
+
import { useContext as useContext87, useEffect as useEffect83, useRef as useRef45, useState as useState88 } from "react";
|
|
29137
29174
|
var useFileExistence = (outName) => {
|
|
29138
29175
|
const [exists, setExists] = useState88(false);
|
|
29139
29176
|
const { previewServerState: state, subscribeToEvent } = useContext87(StudioServerConnectionCtx);
|
|
29140
29177
|
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
29141
|
-
const currentOutName =
|
|
29178
|
+
const currentOutName = useRef45("");
|
|
29142
29179
|
currentOutName.current = outName;
|
|
29143
29180
|
useEffect83(() => {
|
|
29144
29181
|
if (!clientId) {
|
|
@@ -30526,7 +30563,7 @@ var RenderModal = ({
|
|
|
30526
30563
|
resolved: { result: resolvedComposition },
|
|
30527
30564
|
unresolved: unresolvedComposition
|
|
30528
30565
|
} = context;
|
|
30529
|
-
const isMounted =
|
|
30566
|
+
const isMounted = useRef46(true);
|
|
30530
30567
|
const [isVideo] = useState89(() => {
|
|
30531
30568
|
return typeof resolvedComposition.durationInFrames === "undefined" ? true : resolvedComposition.durationInFrames > 1;
|
|
30532
30569
|
});
|
|
@@ -31521,9 +31558,9 @@ import {
|
|
|
31521
31558
|
getEncodableAudioCodecs,
|
|
31522
31559
|
getSupportedAudioCodecsForContainer
|
|
31523
31560
|
} from "@remotion/web-renderer";
|
|
31524
|
-
import { useEffect as useEffect85, useRef as
|
|
31561
|
+
import { useEffect as useEffect85, useRef as useRef47, useState as useState90 } from "react";
|
|
31525
31562
|
var useEncodableAudioCodecs = (container62) => {
|
|
31526
|
-
const cacheRef =
|
|
31563
|
+
const cacheRef = useRef47({});
|
|
31527
31564
|
const [codecsByContainer, setCodecsByContainer] = useState90(() => {
|
|
31528
31565
|
return {
|
|
31529
31566
|
[container62]: getSupportedAudioCodecsForContainer(container62)
|
|
@@ -31563,9 +31600,9 @@ import {
|
|
|
31563
31600
|
getEncodableVideoCodecs,
|
|
31564
31601
|
getSupportedVideoCodecsForContainer
|
|
31565
31602
|
} from "@remotion/web-renderer";
|
|
31566
|
-
import { useEffect as useEffect86, useRef as
|
|
31603
|
+
import { useEffect as useEffect86, useRef as useRef48, useState as useState91 } from "react";
|
|
31567
31604
|
var useEncodableVideoCodecs = (container62) => {
|
|
31568
|
-
const cacheRef =
|
|
31605
|
+
const cacheRef = useRef48({});
|
|
31569
31606
|
const [codecsByContainer, setCodecsByContainer] = useState91(() => {
|
|
31570
31607
|
return {
|
|
31571
31608
|
[container62]: getSupportedVideoCodecsForContainer(container62)
|
|
@@ -33904,15 +33941,15 @@ var SetTimelineInOutProvider = ({ children }) => {
|
|
|
33904
33941
|
};
|
|
33905
33942
|
|
|
33906
33943
|
// src/components/ShowGuidesProvider.tsx
|
|
33907
|
-
import { useCallback as useCallback144, useMemo as useMemo146, useRef as
|
|
33944
|
+
import { useCallback as useCallback144, useMemo as useMemo146, useRef as useRef49, useState as useState101 } from "react";
|
|
33908
33945
|
import { jsx as jsx289 } from "react/jsx-runtime";
|
|
33909
33946
|
var ShowGuidesProvider = ({ children }) => {
|
|
33910
33947
|
const [guidesList, setGuidesList] = useState101(() => loadGuidesList());
|
|
33911
33948
|
const [selectedGuideId, setSelectedGuideId] = useState101(null);
|
|
33912
33949
|
const [hoveredGuideId, setHoveredGuideId] = useState101(null);
|
|
33913
33950
|
const [editorShowGuides, setEditorShowGuidesState] = useState101(() => loadEditorShowGuidesOption());
|
|
33914
|
-
const shouldCreateGuideRef =
|
|
33915
|
-
const shouldDeleteGuideRef =
|
|
33951
|
+
const shouldCreateGuideRef = useRef49(false);
|
|
33952
|
+
const shouldDeleteGuideRef = useRef49(false);
|
|
33916
33953
|
const setEditorShowGuides = useCallback144((newValue) => {
|
|
33917
33954
|
setEditorShowGuidesState((prevState) => {
|
|
33918
33955
|
const newVal = newValue(prevState);
|
|
@@ -34644,7 +34681,6 @@ var renderToDOM = (content7) => {
|
|
|
34644
34681
|
};
|
|
34645
34682
|
renderToDOM(/* @__PURE__ */ jsx297(NoRegisterRoot, {}));
|
|
34646
34683
|
Internals70.waitForRoot((NewRoot) => {
|
|
34647
|
-
Internals70.enableSequenceStackTraces();
|
|
34648
34684
|
renderToDOM(/* @__PURE__ */ jsx297(Studio, {
|
|
34649
34685
|
readOnly: false,
|
|
34650
34686
|
rootComponent: NewRoot
|