UNPKG

remotion

Version:

Make videos programmatically

134 lines (133 loc) 3.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sequenceSchemaDefaultLayoutNone = exports.sequenceSchemaWithoutFrom = exports.sequenceSchema = exports.freezeField = exports.fromField = exports.durationInFramesField = exports.extendSchemaWithSequenceName = exports.sequenceNameField = exports.hiddenField = exports.sequenceStyleSchema = exports.sequencePremountSchema = exports.sequenceVisualStyleSchema = void 0; exports.sequenceVisualStyleSchema = { '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', }, '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.sequencePremountSchema = { premountFor: { type: 'number', default: 0, description: 'Premount For', min: 0, step: 1, hiddenFromList: false, }, postmountFor: { type: 'number', default: 0, min: 0, step: 1, hiddenFromList: true, }, styleWhilePremounted: { type: 'hidden', }, styleWhilePostmounted: { type: 'hidden', }, }; exports.sequenceStyleSchema = { ...exports.sequenceVisualStyleSchema, ...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.freezeField = { type: 'number', default: null, step: 1, hiddenFromList: true, }; exports.sequenceSchema = (0, exports.extendSchemaWithSequenceName)({ hidden: exports.hiddenField, showInTimeline: showInTimelineField, from: exports.fromField, freeze: exports.freezeField, durationInFrames: exports.durationInFramesField, layout: { type: 'enum', default: 'absolute-fill', description: 'Layout', variants: { 'absolute-fill': exports.sequenceStyleSchema, none: {}, }, }, }); exports.sequenceSchemaWithoutFrom = (0, exports.extendSchemaWithSequenceName)({ hidden: exports.hiddenField, showInTimeline: showInTimelineField, freeze: exports.freezeField, durationInFrames: exports.durationInFramesField, layout: exports.sequenceSchema.layout, }); exports.sequenceSchemaDefaultLayoutNone = { ...exports.sequenceSchema, layout: { ...exports.sequenceSchema.layout, default: 'none', }, };