UNPKG

remotion

Version:

Make videos programmatically

232 lines (231 loc) • 5.82 kB
"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.sequencePremountSchema = exports.premountSchema = exports.textContentSchema = exports.textSchema = exports.sequenceVisualStyleSchema = exports.transformSchema = void 0; 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', }, '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.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: 'enum', default: '400', description: 'Font weight', variants: { '100': {}, '200': {}, '300': {}, '400': {}, '500': {}, '600': {}, '700': {}, '800': {}, '900': {}, normal: {}, bold: {}, }, }, '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.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, }, postmountFor: { type: 'number', default: 0, min: 0, step: 1, hiddenFromList: true, }, styleWhilePremounted: { type: 'hidden', }, styleWhilePostmounted: { type: 'hidden', }, }; exports.sequencePremountSchema = exports.premountSchema; exports.sequenceStyleSchema = { ...exports.transformSchema, ...exports.premountSchema, }; 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', }, };