remotion
Version:
Make videos programmatically
397 lines (396 loc) • 9.93 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sequenceSchemaDefaultLayoutNone = exports.sequenceSchemaWithoutFrom = exports.baseSchemaWithoutFrom = exports.sequenceSchema = exports.baseSchema = exports.freezeField = exports.trimBeforeField = exports.fromField = exports.durationInFramesField = exports.extendSchemaWithSequenceName = exports.sequenceNameField = exports.hiddenField = exports.sequenceStyleSchema = exports.sequenceCropSchema = exports.cropSchema = exports.sequencePremountSchema = exports.premountSchema = exports.textContentSchema = exports.svgPaintSchema = exports.svgStrokeSchema = exports.backgroundSchema = exports.borderRadiusSchema = exports.borderSchema = exports.textSchema = exports.sequenceVisualStyleSchema = exports.transformSchema = exports.captionsSchema = void 0;
exports.captionsSchema = {
captions: {
type: 'remotion-captions',
default: undefined,
description: 'Captions',
keyframable: false,
},
};
exports.transformSchema = {
'style.transformOrigin': {
type: 'transform-origin',
step: 1,
default: '50% 50%',
description: 'Transform origin',
},
'style.translate': {
type: 'translate',
step: 1,
default: '0px 0px',
description: 'Offset',
},
'style.scale': {
type: 'scale',
max: 100,
step: 0.01,
default: 1,
description: 'Scale',
defaultKeyframeOutput: 'perceptual-scale',
},
'style.rotate': {
type: 'rotation-css',
step: 1,
default: '0deg',
description: 'Rotation',
},
'style.opacity': {
type: 'number',
min: 0,
max: 1,
step: 0.01,
default: 1,
description: 'Opacity',
hiddenFromList: false,
},
};
exports.sequenceVisualStyleSchema = exports.transformSchema;
exports.textSchema = {
'style.color': {
type: 'color',
default: undefined,
description: 'Color',
},
'style.fontFamily': {
type: 'font-family',
default: undefined,
description: 'Font family',
keyframable: false,
},
'style.fontSize': {
type: 'number',
default: undefined,
min: 0,
step: 1,
description: 'Font size',
hiddenFromList: false,
},
'style.lineHeight': {
type: 'number',
default: undefined,
min: 0,
step: 0.05,
description: 'Line height',
hiddenFromList: false,
},
'style.fontWeight': {
type: 'font-weight',
default: 400,
description: 'Font weight',
keyframable: false,
},
'style.fontStyle': {
type: 'enum',
default: 'normal',
description: 'Font style',
variants: {
normal: {},
italic: {},
oblique: {},
},
},
'style.textAlign': {
type: 'enum',
default: 'left',
description: 'Text align',
variants: {
left: {},
center: {},
right: {},
justify: {},
start: {},
end: {},
},
},
'style.letterSpacing': {
type: 'number',
default: undefined,
step: 0.1,
description: 'Letter spacing',
hiddenFromList: false,
},
};
exports.borderSchema = {
'style.borderWidth': {
type: 'number',
default: undefined,
min: 0,
step: 1,
description: 'Border width',
hiddenFromList: false,
},
'style.borderStyle': {
type: 'enum',
// `none` is the CSS initial value of border-style.
default: 'none',
description: 'Border style',
variants: {
none: {},
hidden: {},
solid: {},
dashed: {},
dotted: {},
double: {},
groove: {},
ridge: {},
inset: {},
outset: {},
},
},
'style.borderColor': {
type: 'color',
default: undefined,
description: 'Border color',
},
};
exports.borderRadiusSchema = {
'style.borderRadius': {
type: 'number',
default: 0,
min: 0,
step: 1,
description: 'Border radius',
hiddenFromList: false,
keyframable: true,
},
'style.borderTopLeftRadius': {
type: 'number',
default: 0,
min: 0,
step: 1,
description: 'Top left radius',
hiddenFromList: false,
},
'style.borderTopRightRadius': {
type: 'number',
default: 0,
min: 0,
step: 1,
description: 'Top right radius',
hiddenFromList: false,
},
'style.borderBottomRightRadius': {
type: 'number',
default: 0,
min: 0,
step: 1,
description: 'Bottom right radius',
hiddenFromList: false,
},
'style.borderBottomLeftRadius': {
type: 'number',
default: 0,
min: 0,
step: 1,
description: 'Bottom left radius',
hiddenFromList: false,
},
};
exports.backgroundSchema = {
'style.backgroundColor': {
type: 'color',
// `transparent` is the CSS initial value of background-color.
default: 'transparent',
description: 'Color',
},
};
const svgColorSchema = {
color: {
type: 'color',
default: undefined,
description: 'Current color',
},
};
exports.svgStrokeSchema = {
...svgColorSchema,
stroke: {
type: 'color',
// `none` is the SVG initial value of stroke.
default: 'none',
description: 'Stroke',
},
strokeWidth: {
type: 'number',
// `1` is the SVG initial value of stroke-width.
default: 1,
description: 'Stroke width',
min: 0,
step: 1,
hiddenFromList: false,
},
};
exports.svgPaintSchema = {
fill: {
type: 'color',
default: undefined,
description: 'Fill',
},
...exports.svgStrokeSchema,
};
exports.textContentSchema = {
children: {
type: 'text-content',
default: '',
description: 'Text',
keyframable: false,
},
};
exports.premountSchema = {
premountFor: {
type: 'number',
default: 0,
description: 'Premount For',
min: 0,
step: 1,
hiddenFromList: false,
keyframable: false,
},
postmountFor: {
type: 'number',
default: 0,
min: 0,
step: 1,
hiddenFromList: true,
keyframable: false,
},
};
exports.sequencePremountSchema = {
...exports.premountSchema,
};
exports.cropSchema = {
cropLeft: {
type: 'number',
default: 0,
description: 'Crop left',
min: 0,
max: 1,
step: 0.01,
hiddenFromList: false,
keyframable: true,
},
cropRight: {
type: 'number',
default: 0,
description: 'Crop right',
min: 0,
max: 1,
step: 0.01,
hiddenFromList: false,
keyframable: true,
},
cropTop: {
type: 'number',
default: 0,
description: 'Crop top',
min: 0,
max: 1,
step: 0.01,
hiddenFromList: false,
keyframable: true,
},
cropBottom: {
type: 'number',
default: 0,
description: 'Crop bottom',
min: 0,
max: 1,
step: 0.01,
hiddenFromList: false,
keyframable: true,
},
};
exports.sequenceCropSchema = exports.cropSchema;
exports.sequenceStyleSchema = {
...exports.sequenceCropSchema,
...exports.transformSchema,
...exports.backgroundSchema,
...exports.borderSchema,
...exports.borderRadiusSchema,
...exports.sequencePremountSchema,
};
exports.hiddenField = {
type: 'boolean',
default: false,
description: 'Hidden',
};
const showInTimelineField = {
type: 'hidden',
};
exports.sequenceNameField = {
type: 'hidden',
};
const extendSchemaWithSequenceName = (schema) => {
return {
name: exports.sequenceNameField,
...schema,
};
};
exports.extendSchemaWithSequenceName = extendSchemaWithSequenceName;
exports.durationInFramesField = {
type: 'number',
default: undefined,
min: 1,
step: 1,
hiddenFromList: true,
};
exports.fromField = {
type: 'number',
default: 0,
step: 1,
hiddenFromList: true,
};
exports.trimBeforeField = {
type: 'number',
default: 0,
min: 0,
step: 1,
hiddenFromList: true,
};
exports.freezeField = {
type: 'number',
default: null,
step: 1,
hiddenFromList: true,
};
exports.baseSchema = {
durationInFrames: exports.durationInFramesField,
from: exports.fromField,
trimBefore: exports.trimBeforeField,
freeze: exports.freezeField,
hidden: exports.hiddenField,
name: exports.sequenceNameField,
showInTimeline: showInTimelineField,
};
exports.sequenceSchema = {
...exports.baseSchema,
layout: {
type: 'enum',
default: 'absolute-fill',
description: 'Layout',
variants: {
'absolute-fill': exports.sequenceStyleSchema,
none: {},
},
},
};
exports.baseSchemaWithoutFrom = {
durationInFrames: exports.durationInFramesField,
trimBefore: exports.trimBeforeField,
freeze: exports.freezeField,
hidden: exports.hiddenField,
name: exports.sequenceNameField,
showInTimeline: showInTimelineField,
};
exports.sequenceSchemaWithoutFrom = {
...exports.baseSchemaWithoutFrom,
layout: exports.sequenceSchema.layout,
};
exports.sequenceSchemaDefaultLayoutNone = {
...exports.sequenceSchema,
layout: {
...exports.sequenceSchema.layout,
default: 'none',
},
};