@shotstack/schemas 1.8.4 → 1.8.5
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/api.bundled.json +832 -6
- package/dist/json-schema/asset.json +853 -1
- package/dist/json-schema/clip.json +853 -1
- package/dist/json-schema/edit.json +854 -2
- package/dist/json-schema/schemas.json +950 -5
- package/dist/json-schema/svg-arrow-shape.json +49 -0
- package/dist/json-schema/svg-asset.json +857 -6
- package/dist/json-schema/svg-circle-shape.json +28 -0
- package/dist/json-schema/svg-cross-shape.json +42 -0
- package/dist/json-schema/svg-ellipse-shape.json +35 -0
- package/dist/json-schema/svg-fill.json +169 -0
- package/dist/json-schema/svg-gradient-stop.json +25 -0
- package/dist/json-schema/svg-heart-shape.json +28 -0
- package/dist/json-schema/svg-line-shape.json +35 -0
- package/dist/json-schema/svg-linear-gradient-fill.json +80 -0
- package/dist/json-schema/svg-path-shape.json +26 -0
- package/dist/json-schema/svg-polygon-shape.json +35 -0
- package/dist/json-schema/svg-radial-gradient-fill.json +66 -0
- package/dist/json-schema/svg-rectangle-shape.json +49 -0
- package/dist/json-schema/svg-ring-shape.json +35 -0
- package/dist/json-schema/svg-shadow.json +79 -0
- package/dist/json-schema/svg-shape.json +404 -0
- package/dist/json-schema/svg-solid-fill.json +40 -0
- package/dist/json-schema/svg-star-shape.json +42 -0
- package/dist/json-schema/svg-stroke.json +115 -0
- package/dist/json-schema/svg-transform.json +93 -0
- package/dist/json-schema/timeline.json +854 -2
- package/dist/json-schema/track.json +854 -2
- package/dist/schema.d.ts +659 -7
- package/dist/zod/zod.gen.cjs +598 -8
- package/dist/zod/zod.gen.d.ts +8230 -156
- package/dist/zod/zod.gen.js +594 -5
- package/dist/zod/zod.gen.ts +369 -5
- package/package.json +1 -1
package/dist/zod/zod.gen.cjs
CHANGED
|
@@ -5,9 +5,10 @@ exports.openAiGeneratedAssetSchema = exports.openaiGeneratedAssetOpenAiGenerated
|
|
|
5
5
|
exports.s3DestinationOptionsSchema = exports.s3DestinationOptionsS3DestinationOptionsSchema = exports.muxDestinationSchema = exports.muxDestinationMuxDestinationSchema = exports.muxDestinationOptionsSchema = exports.muxDestinationOptionsMuxDestinationOptionsSchema = exports.googleDriveDestinationSchema = exports.googleDriveDestinationGoogleDriveDestinationSchema = exports.googleDriveDestinationOptionsSchema = exports.googleDriveDestinationOptionsGoogleDriveDestinationOptionsSchema = exports.googleCloudStorageDestinationSchema = exports.googleCloudStorageDestinationGoogleCloudStorageDestinationSchema = exports.googleCloudStorageDestinationOptionsSchema = exports.googleCloudStorageDestinationOptionsGoogleCloudStorageDestinationOptionsSchema = exports.azureBlobStorageDestinationAzureBlobStorageDestinationSchema = exports.azureBlobStorageDestinationOptionsAzureBlobStorageDestinationOptionsSchema = exports.akamaiNetStorageDestinationAkamaiNetStorageDestinationSchema = exports.akamaiNetStorageDestinationOptionsAkamaiNetStorageDestinationOptionsSchema = exports.cropSchema = exports.cropCropSchema = exports.generatedAssetSchema = exports.generatedAssetGeneratedAssetSchema = exports.stabilityAiGeneratedAssetSchema = exports.stabilityAiGeneratedAssetStabilityAiGeneratedAssetSchema = exports.stabilityAiGeneratedAssetOptionsSchema = exports.stabilityAiGeneratedAssetOptionsStabilityAiGeneratedAssetOptionsSchema = exports.stabilityAiTextToImageOptionsSchema = exports.stabilityAiTextToImageOptionsStabilityAiTextToImageOptionsSchema = exports.shotstackGeneratedAssetSchema = exports.shotstackGeneratedAssetShotstackGeneratedAssetSchema = exports.shotstackGeneratedAssetOptionsSchema = exports.shotstackGeneratedAssetOptionsShotstackGeneratedAssetOptionsSchema = exports.shotstackTextToSpeechOptionsSchema = exports.shotstackTextToSpeechOptionsShotstackTextToSpeechOptionsSchema = exports.shotstackTextToImageOptionsSchema = exports.shotstackTextToImageOptionsShotstackTextToImageOptionsSchema = exports.shotstackTextGeneratorOptionsSchema = exports.shotstackTextGeneratorOptionsShotstackTextGeneratorOptionsSchema = exports.shotstackImageToVideoOptionsSchema = exports.shotstackImageToVideoOptionsShotstackImageToVideoOptionsSchema = exports.generatedAssetResponseSchema = exports.generatedAssetResponseGeneratedAssetResponseSchema = exports.generatedAssetResponseDataSchema = exports.generatedAssetResponseDataGeneratedAssetResponseDataSchema = exports.generatedAssetResponseAttributesSchema = exports.generatedAssetResponseAttributesGeneratedAssetResponseAttributesSchema = exports.generatedAssetErrorResponseSchema = exports.generatedAssetErrorResponseGeneratedAssetErrorResponseSchema = exports.generatedAssetErrorResponseDataSchema = exports.generatedAssetErrorResponseDataGeneratedAssetErrorResponseDataSchema = void 0;
|
|
6
6
|
exports.transcriptionSchema = exports.transcriptionTranscriptionSchema = exports.speedSchema = exports.speedSpeedSchema = exports.uploadResponseSchema = exports.uploadresponseUploadResponseSchema = exports.uploadResponseDataSchema = exports.uploadresponsedataUploadResponseDataSchema = exports.uploadResponseAttributesSchema = exports.uploadresponseattributesUploadResponseAttributesSchema = exports.queuedSourceResponseSchema = exports.queuedsourceresponseQueuedSourceResponseSchema = exports.queuedSourceResponseDataSchema = exports.queuedsourceresponsedataQueuedSourceResponseDataSchema = exports.ingestErrorResponseSchema = exports.ingesterrorresponseIngestErrorResponseSchema = exports.ingestErrorResponseDataSchema = exports.ingesterrorresponsedataIngestErrorResponseDataSchema = exports.enhancementsSchema = exports.enhancementsEnhancementsSchema = exports.audioEnhancementSchema = exports.audioEnhancementAudioEnhancementSchema = exports.dolbyEnhancementSchema = exports.dolbyEnhancementDolbyEnhancementSchema = exports.dolbyEnhancementOptionsSchema = exports.dolbyEnhancementOptionsDolbyEnhancementOptionsSchema = exports.imageToVideoAssetSchema = exports.imagetovideoassetImageToVideoAssetSchema = exports.imageAssetSchema = exports.imageassetImageAssetSchema = exports.htmlAssetSchema = exports.htmlassetHtmlAssetSchema = exports.fontSchema = exports.fontFontSchema = exports.flipTransformationSchema = exports.fliptransformationFlipTransformationSchema = exports.destinationsSchema = exports.destinationsDestinationsSchema = exports.vimeoDestinationSchema = exports.vimeoDestinationVimeoDestinationSchema = exports.vimeoDestinationOptionsSchema = exports.vimeoDestinationOptionsVimeoDestinationOptionsSchema = exports.vimeoDestinationPrivacyOptionsSchema = exports.vimeoDestinationPrivacyOptionsVimeoDestinationPrivacyOptionsSchema = exports.tiktokDestinationTiktokDestinationSchema = exports.tiktokDestinationOptionsTiktokDestinationOptionsSchema = exports.shotstackDestinationSchema = exports.shotstackDestinationShotstackDestinationSchema = exports.s3DestinationSchema = exports.s3DestinationS3DestinationSchema = void 0;
|
|
7
7
|
exports.richTextShadowSchema = exports.richtextpropertiesRichTextShadowSchema = exports.richtextpropertiesRichTextPaddingSchema = exports.richTextGradientSchema = exports.richtextpropertiesRichTextGradientSchema = exports.richtextpropertiesRichTextBorderSchema = exports.richTextBackgroundSchema = exports.richtextpropertiesRichTextBackgroundSchema = exports.richTextAnimationSchema = exports.richtextpropertiesRichTextAnimationSchema = exports.richTextAlignmentSchema = exports.richtextpropertiesRichTextAlignmentSchema = exports.wordTimingSchema = exports.richcaptionpropertiesWordTimingSchema = exports.richCaptionWordAnimationSchema = exports.richcaptionpropertiesRichCaptionWordAnimationSchema = exports.richCaptionActiveFontSchema = exports.richcaptionpropertiesRichCaptionActiveFontSchema = exports.templateResponseSchema = exports.templateresponseTemplateResponseSchema = exports.templateResponseDataSchema = exports.templateresponsedataTemplateResponseDataSchema = exports.templateListResponseSchema = exports.templatelistresponseTemplateListResponseSchema = exports.templateListResponseDataSchema = exports.templatelistresponsedataTemplateListResponseDataSchema = exports.templateListResponseItemSchema = exports.templatelistresponseitemTemplateListResponseItemSchema = exports.queuedResponseSchema = exports.queuedresponseQueuedResponseSchema = exports.queuedResponseDataSchema = exports.queuedresponsedataQueuedResponseDataSchema = exports.probeResponseSchema = exports.proberesponseProbeResponseSchema = exports.assetResponseSchema = exports.assetresponseAssetResponseSchema = exports.assetRenderResponseSchema = exports.assetrenderresponseAssetRenderResponseSchema = exports.assetResponseDataSchema = exports.assetresponsedataAssetResponseDataSchema = exports.assetResponseAttributesSchema = exports.assetresponseattributesAssetResponseAttributesSchema = exports.rangeSchema = exports.rangeRangeSchema = exports.posterSchema = exports.posterPosterSchema = exports.mergeFieldSchema = exports.mergefieldMergeFieldSchema = exports.lumaAssetSchema = exports.lumaassetLumaAssetSchema = void 0;
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
8
|
+
exports.svgRadialGradientFillSchema = exports.svgpropertiesSvgRadialGradientFillSchema = exports.svgLinearGradientFillSchema = exports.svgpropertiesSvgLinearGradientFillSchema = exports.svgGradientStopSchema = exports.svgpropertiesSvgGradientStopSchema = exports.soundtrackSchema = exports.soundtrackSoundtrackSchema = exports.sourceSchema = exports.sourceSourceSchema = exports.sourceResponseSchema = exports.sourceresponseSourceResponseSchema = exports.sourceListResponseSchema = exports.sourcelistresponseSourceListResponseSchema = exports.sourceResponseDataSchema = exports.sourceresponsedataSourceResponseDataSchema = exports.sourceResponseAttributesSchema = exports.sourceresponseattributesSourceResponseAttributesSchema = exports.outputsResponseSchema = exports.outputsresponseOutputsResponseSchema = exports.renditionResponseAttributesSchema = exports.renditionresponseattributesRenditionResponseAttributesSchema = exports.outputsSchema = exports.outputsOutputsSchema = exports.renditionSchema = exports.renditionRenditionSchema = exports.sizeSchema = exports.sizeSizeSchema = exports.shapeAssetSchema = exports.shapeassetShapeAssetSchema = exports.transferSchema = exports.transferTransferSchema = exports.transferResponseSchema = exports.transferresponseTransferResponseSchema = exports.transferResponseDataSchema = exports.transferresponsedataTransferResponseDataSchema = exports.transferResponseAttributesSchema = exports.transferresponseattributesTransferResponseAttributesSchema = exports.richTextAssetSchema = exports.richtextassetRichTextAssetSchema = exports.richCaptionAssetSchema = exports.richcaptionassetRichCaptionAssetSchema = exports.richTextStyleSchema = exports.richtextpropertiesRichTextStyleSchema = exports.richTextFontSchema = exports.richtextpropertiesRichTextFontSchema = exports.richCaptionActiveSchema = exports.richcaptionpropertiesRichCaptionActiveSchema = exports.richTextStrokeSchema = exports.richtextpropertiesRichTextStrokeSchema = void 0;
|
|
9
|
+
exports.textToImageAssetSchema = exports.texttoimageassetTextToImageAssetSchema = exports.textAssetSchema = exports.textassetTextAssetSchema = exports.textpropertiesTextStrokeSchema = exports.textFontSchema = exports.textpropertiesTextFontSchema = exports.textBackgroundSchema = exports.textpropertiesTextBackgroundSchema = exports.textpropertiesTextAnimationSchema = exports.textAlignmentSchema = exports.textpropertiesTextAlignmentSchema = exports.templateRenderSchema = exports.templaterenderTemplateRenderSchema = exports.svgAssetSchema = exports.svgassetSvgAssetSchema = exports.svgShapeSchema = exports.svgshapesSvgShapeSchema = exports.svgStarShapeSchema = exports.svgshapesSvgStarShapeSchema = exports.svgRingShapeSchema = exports.svgshapesSvgRingShapeSchema = exports.svgRectangleShapeSchema = exports.svgshapesSvgRectangleShapeSchema = exports.svgPolygonShapeSchema = exports.svgshapesSvgPolygonShapeSchema = exports.svgPathShapeSchema = exports.svgshapesSvgPathShapeSchema = exports.svgLineShapeSchema = exports.svgshapesSvgLineShapeSchema = exports.svgHeartShapeSchema = exports.svgshapesSvgHeartShapeSchema = exports.svgEllipseShapeSchema = exports.svgshapesSvgEllipseShapeSchema = exports.svgCrossShapeSchema = exports.svgshapesSvgCrossShapeSchema = exports.svgCircleShapeSchema = exports.svgshapesSvgCircleShapeSchema = exports.svgArrowShapeSchema = exports.svgshapesSvgArrowShapeSchema = exports.svgTransformSchema = exports.svgpropertiesSvgTransformSchema = exports.svgStrokeSchema = exports.svgpropertiesSvgStrokeSchema = exports.svgFillSchema = exports.svgpropertiesSvgFillSchema = exports.svgSolidFillSchema = exports.svgpropertiesSvgSolidFillSchema = exports.svgShadowSchema = exports.svgpropertiesSvgShadowSchema = void 0;
|
|
10
|
+
exports.getTemplatesResponse = exports.getTemplatesRequest = exports.getRenderResponse = exports.getRenderRequest = exports.postRenderResponse = exports.postRenderRequest = exports.templateSchema = exports.templateTemplateSchema = exports.templateDataResponseSchema = exports.templatedataresponseTemplateDataResponseSchema = exports.templateDataResponseDataSchema = exports.templatedataresponsedataTemplateDataResponseDataSchema = exports.renderResponseSchema = exports.renderresponseRenderResponseSchema = exports.renderResponseDataSchema = exports.renderresponsedataRenderResponseDataSchema = exports.editSchema = exports.editEditSchema = exports.timelineSchema = exports.timelineTimelineSchema = exports.trackSchema = exports.trackTrackSchema = exports.clipSchema = exports.clipClipSchema = exports.assetSchema = exports.assetAssetSchema = exports.videoAssetSchema = exports.videoassetVideoAssetSchema = exports.transformationSchema = exports.transformationTransformationSchema = exports.titleAssetSchema = exports.titleassetTitleAssetSchema = exports.textToSpeechAssetSchema = exports.texttospeechassetTextToSpeechAssetSchema = exports.skewTransformationSchema = exports.skewtransformationSkewTransformationSchema = exports.rotateTransformationSchema = exports.rotatetransformationRotateTransformationSchema = exports.offsetSchema = exports.offsetOffsetSchema = exports.audioAssetSchema = exports.audioassetAudioAssetSchema = exports.tweenSchema = exports.tweenTweenSchema = exports.transitionSchema = exports.transitionTransitionSchema = exports.outputSchema = exports.outputOutputSchema = exports.thumbnailSchema = exports.thumbnailThumbnailSchema = void 0;
|
|
11
|
+
exports.getGeneratedAssetResponse = exports.getGeneratedAssetRequest = exports.postGenerateAssetResponse = exports.postGenerateAssetRequest = exports.getUploadSignedUrlResponse = exports.getUploadSignedUrlRequest = exports.getSourceResponse = exports.getSourceRequest = exports.deleteSourceResponse = exports.deleteSourceRequest = exports.postSourceResponse = exports.postSourceRequest = exports.getSourcesResponse = exports.getSourcesRequest = exports.postServeAssetResponse = exports.postServeAssetRequest = exports.getAssetByRenderIdResponse = exports.getAssetByRenderIdRequest = exports.getAssetResponse = exports.getAssetRequest = exports.deleteAssetResponse = exports.deleteAssetRequest = exports.probeResponse = exports.probeRequest = exports.postTemplateRenderResponse = exports.postTemplateRenderRequest = exports.putTemplateResponse = exports.putTemplateRequest = exports.getTemplateResponse = exports.getTemplateRequest = exports.deleteTemplateResponse = exports.deleteTemplateRequest = exports.postTemplateResponse = exports.postTemplateRequest = void 0;
|
|
11
12
|
const zod_1 = require("zod");
|
|
12
13
|
exports.editRootSchema = zod_1.z.unknown();
|
|
13
14
|
exports.sourceRootSchema = zod_1.z.unknown();
|
|
@@ -2116,23 +2117,612 @@ exports.soundtrackSoundtrackSchema = zod_1.z.object({
|
|
|
2116
2117
|
}).strict();
|
|
2117
2118
|
exports.soundtrackSchema = exports.soundtrackSoundtrackSchema;
|
|
2118
2119
|
/**
|
|
2119
|
-
*
|
|
2120
|
-
*
|
|
2120
|
+
* A color stop in a gradient. Each stop defines a color at a specific position
|
|
2121
|
+
* along the gradient vector. Gradients require at least 2 stops.
|
|
2121
2122
|
*
|
|
2123
|
+
*/
|
|
2124
|
+
exports.svgpropertiesSvgGradientStopSchema = zod_1.z.object({
|
|
2125
|
+
offset: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2126
|
+
return undefined; if (Array.isArray(v))
|
|
2127
|
+
return v; if (typeof v === 'string') {
|
|
2128
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2129
|
+
return v;
|
|
2130
|
+
return Number(v);
|
|
2131
|
+
} return v; }), zod_1.z.number().gte(0).lte(1)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2132
|
+
color: zod_1.z.union([zod_1.z.string().regex(/^#[A-Fa-f0-9]{6}$/), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2133
|
+
}).strict();
|
|
2134
|
+
exports.svgGradientStopSchema = exports.svgpropertiesSvgGradientStopSchema;
|
|
2135
|
+
/**
|
|
2136
|
+
* A linear gradient fill that transitions colors along a straight line.
|
|
2137
|
+
* The gradient direction is controlled by the `angle` property.
|
|
2138
|
+
*
|
|
2139
|
+
*/
|
|
2140
|
+
exports.svgpropertiesSvgLinearGradientFillSchema = zod_1.z.object({
|
|
2141
|
+
type: zod_1.z.enum(["linear"]),
|
|
2142
|
+
angle: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2143
|
+
return undefined; if (Array.isArray(v))
|
|
2144
|
+
return v; if (typeof v === 'string') {
|
|
2145
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2146
|
+
return v;
|
|
2147
|
+
return Number(v);
|
|
2148
|
+
} return v; }), zod_1.z.number().gte(0).lte(360)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2149
|
+
stops: zod_1.z.array(exports.svgpropertiesSvgGradientStopSchema).min(2),
|
|
2150
|
+
opacity: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2151
|
+
return undefined; if (Array.isArray(v))
|
|
2152
|
+
return v; if (typeof v === 'string') {
|
|
2153
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2154
|
+
return v;
|
|
2155
|
+
return Number(v);
|
|
2156
|
+
} return v; }), zod_1.z.number().gte(0).lte(1)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2157
|
+
}).strict();
|
|
2158
|
+
exports.svgLinearGradientFillSchema = exports.svgpropertiesSvgLinearGradientFillSchema;
|
|
2159
|
+
/**
|
|
2160
|
+
* A radial gradient fill that transitions colors radiating outward from a center point.
|
|
2161
|
+
* The gradient creates a circular or elliptical color transition.
|
|
2162
|
+
*
|
|
2163
|
+
*/
|
|
2164
|
+
exports.svgpropertiesSvgRadialGradientFillSchema = zod_1.z.object({
|
|
2165
|
+
type: zod_1.z.enum(["radial"]),
|
|
2166
|
+
stops: zod_1.z.array(exports.svgpropertiesSvgGradientStopSchema).min(2),
|
|
2167
|
+
opacity: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2168
|
+
return undefined; if (Array.isArray(v))
|
|
2169
|
+
return v; if (typeof v === 'string') {
|
|
2170
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2171
|
+
return v;
|
|
2172
|
+
return Number(v);
|
|
2173
|
+
} return v; }), zod_1.z.number().gte(0).lte(1)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2174
|
+
}).strict();
|
|
2175
|
+
exports.svgRadialGradientFillSchema = exports.svgpropertiesSvgRadialGradientFillSchema;
|
|
2176
|
+
/**
|
|
2177
|
+
* Drop shadow properties for SVG shapes. Creates a shadow effect behind the shape.
|
|
2178
|
+
*
|
|
2179
|
+
*/
|
|
2180
|
+
exports.svgpropertiesSvgShadowSchema = zod_1.z.object({
|
|
2181
|
+
offsetX: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2182
|
+
return undefined; if (Array.isArray(v))
|
|
2183
|
+
return v; if (typeof v === 'string') {
|
|
2184
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2185
|
+
return v;
|
|
2186
|
+
return Number(v);
|
|
2187
|
+
} return v; }), zod_1.z.number()), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2188
|
+
offsetY: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2189
|
+
return undefined; if (Array.isArray(v))
|
|
2190
|
+
return v; if (typeof v === 'string') {
|
|
2191
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2192
|
+
return v;
|
|
2193
|
+
return Number(v);
|
|
2194
|
+
} return v; }), zod_1.z.number()), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2195
|
+
blur: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2196
|
+
return undefined; if (Array.isArray(v))
|
|
2197
|
+
return v; if (typeof v === 'string') {
|
|
2198
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2199
|
+
return v;
|
|
2200
|
+
return Number(v);
|
|
2201
|
+
} return v; }), zod_1.z.number().gte(0)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2202
|
+
color: zod_1.z.optional(zod_1.z.union([zod_1.z.string().regex(/^#[A-Fa-f0-9]{6}$/), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),
|
|
2203
|
+
opacity: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2204
|
+
return undefined; if (Array.isArray(v))
|
|
2205
|
+
return v; if (typeof v === 'string') {
|
|
2206
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2207
|
+
return v;
|
|
2208
|
+
return Number(v);
|
|
2209
|
+
} return v; }), zod_1.z.number().gte(0).lte(1)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5),
|
|
2210
|
+
}).strict();
|
|
2211
|
+
exports.svgShadowSchema = exports.svgpropertiesSvgShadowSchema;
|
|
2212
|
+
/**
|
|
2213
|
+
* A solid color fill for SVG shapes.
|
|
2214
|
+
*/
|
|
2215
|
+
exports.svgpropertiesSvgSolidFillSchema = zod_1.z.object({
|
|
2216
|
+
type: zod_1.z.enum(["solid"]),
|
|
2217
|
+
color: zod_1.z
|
|
2218
|
+
.string()
|
|
2219
|
+
.regex(/^#[A-Fa-f0-9]{6}$/)
|
|
2220
|
+
.default("#000000"),
|
|
2221
|
+
opacity: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2222
|
+
return undefined; if (Array.isArray(v))
|
|
2223
|
+
return v; if (typeof v === 'string') {
|
|
2224
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2225
|
+
return v;
|
|
2226
|
+
return Number(v);
|
|
2227
|
+
} return v; }), zod_1.z.number().gte(0).lte(1)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2228
|
+
}).strict();
|
|
2229
|
+
exports.svgSolidFillSchema = exports.svgpropertiesSvgSolidFillSchema;
|
|
2230
|
+
/**
|
|
2231
|
+
* Fill properties for SVG shapes. Supports solid colors and gradients.
|
|
2232
|
+
* The fill defines how the interior of a shape is painted.
|
|
2233
|
+
*
|
|
2234
|
+
*/
|
|
2235
|
+
exports.svgpropertiesSvgFillSchema = zod_1.z.discriminatedUnion("type", [
|
|
2236
|
+
exports.svgpropertiesSvgSolidFillSchema,
|
|
2237
|
+
exports.svgpropertiesSvgLinearGradientFillSchema,
|
|
2238
|
+
exports.svgpropertiesSvgRadialGradientFillSchema,
|
|
2239
|
+
]);
|
|
2240
|
+
exports.svgFillSchema = exports.svgpropertiesSvgFillSchema;
|
|
2241
|
+
/**
|
|
2242
|
+
* Stroke (outline) properties for SVG shapes. The stroke defines how the outline
|
|
2243
|
+
* of a shape is painted, including its color, width, and line style.
|
|
2244
|
+
*
|
|
2245
|
+
*/
|
|
2246
|
+
exports.svgpropertiesSvgStrokeSchema = zod_1.z.object({
|
|
2247
|
+
color: zod_1.z.optional(zod_1.z.union([zod_1.z.string().regex(/^#[A-Fa-f0-9]{6}$/), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),
|
|
2248
|
+
width: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2249
|
+
return undefined; if (Array.isArray(v))
|
|
2250
|
+
return v; if (typeof v === 'string') {
|
|
2251
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2252
|
+
return v;
|
|
2253
|
+
return Number(v);
|
|
2254
|
+
} return v; }), zod_1.z.number().gte(0).lte(100)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2255
|
+
opacity: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2256
|
+
return undefined; if (Array.isArray(v))
|
|
2257
|
+
return v; if (typeof v === 'string') {
|
|
2258
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2259
|
+
return v;
|
|
2260
|
+
return Number(v);
|
|
2261
|
+
} return v; }), zod_1.z.number().gte(0).lte(1)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2262
|
+
lineCap: zod_1.z.optional(zod_1.z.enum(["butt", "round", "square"])),
|
|
2263
|
+
lineJoin: zod_1.z.optional(zod_1.z.enum(["miter", "round", "bevel"])),
|
|
2264
|
+
dashArray: zod_1.z.optional(zod_1.z.array(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2265
|
+
return undefined; if (Array.isArray(v))
|
|
2266
|
+
return v; if (typeof v === 'string') {
|
|
2267
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2268
|
+
return v;
|
|
2269
|
+
return Number(v);
|
|
2270
|
+
} return v; }), zod_1.z.number().gte(0)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))),
|
|
2271
|
+
dashOffset: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2272
|
+
return undefined; if (Array.isArray(v))
|
|
2273
|
+
return v; if (typeof v === 'string') {
|
|
2274
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2275
|
+
return v;
|
|
2276
|
+
return Number(v);
|
|
2277
|
+
} return v; }), zod_1.z.number()), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2278
|
+
}).strict();
|
|
2279
|
+
exports.svgStrokeSchema = exports.svgpropertiesSvgStrokeSchema;
|
|
2280
|
+
/**
|
|
2281
|
+
* Transformation properties for positioning, rotating, and scaling SVG shapes.
|
|
2282
|
+
*
|
|
2283
|
+
*/
|
|
2284
|
+
exports.svgpropertiesSvgTransformSchema = zod_1.z.object({
|
|
2285
|
+
x: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2286
|
+
return undefined; if (Array.isArray(v))
|
|
2287
|
+
return v; if (typeof v === 'string') {
|
|
2288
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2289
|
+
return v;
|
|
2290
|
+
return Number(v);
|
|
2291
|
+
} return v; }), zod_1.z.number()), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2292
|
+
y: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2293
|
+
return undefined; if (Array.isArray(v))
|
|
2294
|
+
return v; if (typeof v === 'string') {
|
|
2295
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2296
|
+
return v;
|
|
2297
|
+
return Number(v);
|
|
2298
|
+
} return v; }), zod_1.z.number()), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2299
|
+
rotation: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2300
|
+
return undefined; if (Array.isArray(v))
|
|
2301
|
+
return v; if (typeof v === 'string') {
|
|
2302
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2303
|
+
return v;
|
|
2304
|
+
return Number(v);
|
|
2305
|
+
} return v; }), zod_1.z.number().gte(-360).lte(360)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2306
|
+
scale: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2307
|
+
return undefined; if (Array.isArray(v))
|
|
2308
|
+
return v; if (typeof v === 'string') {
|
|
2309
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2310
|
+
return v;
|
|
2311
|
+
return Number(v);
|
|
2312
|
+
} return v; }), zod_1.z.number().gte(0.01).lte(100)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2313
|
+
originX: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2314
|
+
return undefined; if (Array.isArray(v))
|
|
2315
|
+
return v; if (typeof v === 'string') {
|
|
2316
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2317
|
+
return v;
|
|
2318
|
+
return Number(v);
|
|
2319
|
+
} return v; }), zod_1.z.number().gte(0).lte(1)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5),
|
|
2320
|
+
originY: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2321
|
+
return undefined; if (Array.isArray(v))
|
|
2322
|
+
return v; if (typeof v === 'string') {
|
|
2323
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2324
|
+
return v;
|
|
2325
|
+
return Number(v);
|
|
2326
|
+
} return v; }), zod_1.z.number().gte(0).lte(1)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5),
|
|
2327
|
+
}).strict();
|
|
2328
|
+
exports.svgTransformSchema = exports.svgpropertiesSvgTransformSchema;
|
|
2329
|
+
/**
|
|
2330
|
+
* An arrow shape pointing to the right by default.
|
|
2331
|
+
* Use transform rotation to change direction.
|
|
2332
|
+
*
|
|
2333
|
+
*/
|
|
2334
|
+
exports.svgshapesSvgArrowShapeSchema = zod_1.z.object({
|
|
2335
|
+
type: zod_1.z.enum(["arrow"]),
|
|
2336
|
+
length: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2337
|
+
return undefined; if (Array.isArray(v))
|
|
2338
|
+
return v; if (typeof v === 'string') {
|
|
2339
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2340
|
+
return v;
|
|
2341
|
+
return Number(v);
|
|
2342
|
+
} return v; }), zod_1.z.number().gte(1).lte(4096)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2343
|
+
headWidth: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2344
|
+
return undefined; if (Array.isArray(v))
|
|
2345
|
+
return v; if (typeof v === 'string') {
|
|
2346
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2347
|
+
return v;
|
|
2348
|
+
return Number(v);
|
|
2349
|
+
} return v; }), zod_1.z.number().gte(1).lte(1000)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2350
|
+
headLength: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2351
|
+
return undefined; if (Array.isArray(v))
|
|
2352
|
+
return v; if (typeof v === 'string') {
|
|
2353
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2354
|
+
return v;
|
|
2355
|
+
return Number(v);
|
|
2356
|
+
} return v; }), zod_1.z.number().gte(1).lte(1000)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2357
|
+
shaftWidth: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2358
|
+
return undefined; if (Array.isArray(v))
|
|
2359
|
+
return v; if (typeof v === 'string') {
|
|
2360
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2361
|
+
return v;
|
|
2362
|
+
return Number(v);
|
|
2363
|
+
} return v; }), zod_1.z.number().gte(1).lte(1000)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2364
|
+
}).strict();
|
|
2365
|
+
exports.svgArrowShapeSchema = exports.svgshapesSvgArrowShapeSchema;
|
|
2366
|
+
/**
|
|
2367
|
+
* A perfect circle shape defined by its radius.
|
|
2368
|
+
* The circle is centered at the shape's position.
|
|
2369
|
+
*
|
|
2370
|
+
*/
|
|
2371
|
+
exports.svgshapesSvgCircleShapeSchema = zod_1.z.object({
|
|
2372
|
+
type: zod_1.z.enum(["circle"]),
|
|
2373
|
+
radius: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2374
|
+
return undefined; if (Array.isArray(v))
|
|
2375
|
+
return v; if (typeof v === 'string') {
|
|
2376
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2377
|
+
return v;
|
|
2378
|
+
return Number(v);
|
|
2379
|
+
} return v; }), zod_1.z.number().gte(1).lte(2048)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2380
|
+
}).strict();
|
|
2381
|
+
exports.svgCircleShapeSchema = exports.svgshapesSvgCircleShapeSchema;
|
|
2382
|
+
/**
|
|
2383
|
+
* A cross or plus shape with equal or different arm lengths.
|
|
2384
|
+
* Can be styled as a plus sign (+) or a cross (x with rotation).
|
|
2385
|
+
*
|
|
2386
|
+
*/
|
|
2387
|
+
exports.svgshapesSvgCrossShapeSchema = zod_1.z.object({
|
|
2388
|
+
type: zod_1.z.enum(["cross"]),
|
|
2389
|
+
width: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2390
|
+
return undefined; if (Array.isArray(v))
|
|
2391
|
+
return v; if (typeof v === 'string') {
|
|
2392
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2393
|
+
return v;
|
|
2394
|
+
return Number(v);
|
|
2395
|
+
} return v; }), zod_1.z.number().gte(1).lte(4096)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2396
|
+
height: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2397
|
+
return undefined; if (Array.isArray(v))
|
|
2398
|
+
return v; if (typeof v === 'string') {
|
|
2399
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2400
|
+
return v;
|
|
2401
|
+
return Number(v);
|
|
2402
|
+
} return v; }), zod_1.z.number().gte(1).lte(4096)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2403
|
+
thickness: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2404
|
+
return undefined; if (Array.isArray(v))
|
|
2405
|
+
return v; if (typeof v === 'string') {
|
|
2406
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2407
|
+
return v;
|
|
2408
|
+
return Number(v);
|
|
2409
|
+
} return v; }), zod_1.z.number().gte(1).lte(500)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2410
|
+
}).strict();
|
|
2411
|
+
exports.svgCrossShapeSchema = exports.svgshapesSvgCrossShapeSchema;
|
|
2412
|
+
/**
|
|
2413
|
+
* An ellipse (oval) shape with separate horizontal and vertical radii.
|
|
2414
|
+
* The ellipse is centered at the shape's position.
|
|
2415
|
+
*
|
|
2416
|
+
*/
|
|
2417
|
+
exports.svgshapesSvgEllipseShapeSchema = zod_1.z.object({
|
|
2418
|
+
type: zod_1.z.enum(["ellipse"]),
|
|
2419
|
+
radiusX: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2420
|
+
return undefined; if (Array.isArray(v))
|
|
2421
|
+
return v; if (typeof v === 'string') {
|
|
2422
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2423
|
+
return v;
|
|
2424
|
+
return Number(v);
|
|
2425
|
+
} return v; }), zod_1.z.number().gte(1).lte(2048)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2426
|
+
radiusY: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2427
|
+
return undefined; if (Array.isArray(v))
|
|
2428
|
+
return v; if (typeof v === 'string') {
|
|
2429
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2430
|
+
return v;
|
|
2431
|
+
return Number(v);
|
|
2432
|
+
} return v; }), zod_1.z.number().gte(1).lte(2048)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2433
|
+
}).strict();
|
|
2434
|
+
exports.svgEllipseShapeSchema = exports.svgshapesSvgEllipseShapeSchema;
|
|
2435
|
+
/**
|
|
2436
|
+
* A heart shape commonly used for love/like icons.
|
|
2437
|
+
* The heart is defined by a single size parameter.
|
|
2438
|
+
*
|
|
2439
|
+
*/
|
|
2440
|
+
exports.svgshapesSvgHeartShapeSchema = zod_1.z.object({
|
|
2441
|
+
type: zod_1.z.enum(["heart"]),
|
|
2442
|
+
size: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2443
|
+
return undefined; if (Array.isArray(v))
|
|
2444
|
+
return v; if (typeof v === 'string') {
|
|
2445
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2446
|
+
return v;
|
|
2447
|
+
return Number(v);
|
|
2448
|
+
} return v; }), zod_1.z.number().gte(1).lte(4096)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2449
|
+
}).strict();
|
|
2450
|
+
exports.svgHeartShapeSchema = exports.svgshapesSvgHeartShapeSchema;
|
|
2451
|
+
/**
|
|
2452
|
+
* A straight line shape with a specified length and thickness.
|
|
2453
|
+
* The line is drawn horizontally by default and can be rotated using transform.
|
|
2454
|
+
*
|
|
2455
|
+
*/
|
|
2456
|
+
exports.svgshapesSvgLineShapeSchema = zod_1.z.object({
|
|
2457
|
+
type: zod_1.z.enum(["line"]),
|
|
2458
|
+
length: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2459
|
+
return undefined; if (Array.isArray(v))
|
|
2460
|
+
return v; if (typeof v === 'string') {
|
|
2461
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2462
|
+
return v;
|
|
2463
|
+
return Number(v);
|
|
2464
|
+
} return v; }), zod_1.z.number().gte(1).lte(4096)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2465
|
+
thickness: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2466
|
+
return undefined; if (Array.isArray(v))
|
|
2467
|
+
return v; if (typeof v === 'string') {
|
|
2468
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2469
|
+
return v;
|
|
2470
|
+
return Number(v);
|
|
2471
|
+
} return v; }), zod_1.z.number().gte(1).lte(500)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2472
|
+
}).strict();
|
|
2473
|
+
exports.svgLineShapeSchema = exports.svgshapesSvgLineShapeSchema;
|
|
2474
|
+
/**
|
|
2475
|
+
* A custom shape defined by SVG path data.
|
|
2476
|
+
* Supports all standard SVG path commands for creating complex shapes.
|
|
2477
|
+
*
|
|
2478
|
+
* **Path Commands:**
|
|
2479
|
+
* - `M x y` / `m dx dy` - Move to (absolute/relative)
|
|
2480
|
+
* - `L x y` / `l dx dy` - Line to
|
|
2481
|
+
* - `H x` / `h dx` - Horizontal line to
|
|
2482
|
+
* - `V y` / `v dy` - Vertical line to
|
|
2483
|
+
* - `C x1 y1 x2 y2 x y` / `c` - Cubic Bezier curve
|
|
2484
|
+
* - `S x2 y2 x y` / `s` - Smooth cubic Bezier
|
|
2485
|
+
* - `Q x1 y1 x y` / `q` - Quadratic Bezier curve
|
|
2486
|
+
* - `T x y` / `t` - Smooth quadratic Bezier
|
|
2487
|
+
* - `A rx ry angle large-arc sweep x y` / `a` - Elliptical arc
|
|
2488
|
+
* - `Z` / `z` - Close path
|
|
2489
|
+
*
|
|
2490
|
+
*/
|
|
2491
|
+
exports.svgshapesSvgPathShapeSchema = zod_1.z.object({
|
|
2492
|
+
type: zod_1.z.enum(["path"]),
|
|
2493
|
+
d: zod_1.z.string().min(1).max(100000),
|
|
2494
|
+
}).strict();
|
|
2495
|
+
exports.svgPathShapeSchema = exports.svgshapesSvgPathShapeSchema;
|
|
2496
|
+
/**
|
|
2497
|
+
* A regular polygon shape with a specified number of sides.
|
|
2498
|
+
* Examples: triangle (3), square (4), pentagon (5), hexagon (6), etc.
|
|
2499
|
+
* The polygon is inscribed in a circle of the given radius.
|
|
2500
|
+
*
|
|
2501
|
+
*/
|
|
2502
|
+
exports.svgshapesSvgPolygonShapeSchema = zod_1.z.object({
|
|
2503
|
+
type: zod_1.z.enum(["polygon"]),
|
|
2504
|
+
sides: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2505
|
+
return undefined; if (Array.isArray(v))
|
|
2506
|
+
return v; if (typeof v === 'string') {
|
|
2507
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2508
|
+
return v;
|
|
2509
|
+
return Number(v);
|
|
2510
|
+
} return v; }), zod_1.z.number().int().gte(3).lte(100)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2511
|
+
radius: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2512
|
+
return undefined; if (Array.isArray(v))
|
|
2513
|
+
return v; if (typeof v === 'string') {
|
|
2514
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2515
|
+
return v;
|
|
2516
|
+
return Number(v);
|
|
2517
|
+
} return v; }), zod_1.z.number().gte(1).lte(2048)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2518
|
+
}).strict();
|
|
2519
|
+
exports.svgPolygonShapeSchema = exports.svgshapesSvgPolygonShapeSchema;
|
|
2520
|
+
/**
|
|
2521
|
+
* A rectangle shape with optional rounded corners.
|
|
2522
|
+
* The rectangle is defined by its width and height dimensions.
|
|
2523
|
+
*
|
|
2524
|
+
*/
|
|
2525
|
+
exports.svgshapesSvgRectangleShapeSchema = zod_1.z.object({
|
|
2526
|
+
type: zod_1.z.enum(["rectangle"]),
|
|
2527
|
+
width: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2528
|
+
return undefined; if (Array.isArray(v))
|
|
2529
|
+
return v; if (typeof v === 'string') {
|
|
2530
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2531
|
+
return v;
|
|
2532
|
+
return Number(v);
|
|
2533
|
+
} return v; }), zod_1.z.number().gte(1).lte(4096)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2534
|
+
height: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2535
|
+
return undefined; if (Array.isArray(v))
|
|
2536
|
+
return v; if (typeof v === 'string') {
|
|
2537
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2538
|
+
return v;
|
|
2539
|
+
return Number(v);
|
|
2540
|
+
} return v; }), zod_1.z.number().gte(1).lte(4096)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2541
|
+
cornerRadius: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2542
|
+
return undefined; if (Array.isArray(v))
|
|
2543
|
+
return v; if (typeof v === 'string') {
|
|
2544
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2545
|
+
return v;
|
|
2546
|
+
return Number(v);
|
|
2547
|
+
} return v; }), zod_1.z.number().gte(0).lte(2048)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2548
|
+
}).strict();
|
|
2549
|
+
exports.svgRectangleShapeSchema = exports.svgshapesSvgRectangleShapeSchema;
|
|
2550
|
+
/**
|
|
2551
|
+
* A ring (donut/annulus) shape - a circle with a circular hole in the center.
|
|
2552
|
+
* The ring is defined by outer and inner radii.
|
|
2553
|
+
*
|
|
2554
|
+
*/
|
|
2555
|
+
exports.svgshapesSvgRingShapeSchema = zod_1.z.object({
|
|
2556
|
+
type: zod_1.z.enum(["ring"]),
|
|
2557
|
+
outerRadius: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2558
|
+
return undefined; if (Array.isArray(v))
|
|
2559
|
+
return v; if (typeof v === 'string') {
|
|
2560
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2561
|
+
return v;
|
|
2562
|
+
return Number(v);
|
|
2563
|
+
} return v; }), zod_1.z.number().gte(1).lte(2048)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2564
|
+
innerRadius: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2565
|
+
return undefined; if (Array.isArray(v))
|
|
2566
|
+
return v; if (typeof v === 'string') {
|
|
2567
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2568
|
+
return v;
|
|
2569
|
+
return Number(v);
|
|
2570
|
+
} return v; }), zod_1.z.number().gte(0).lte(2048)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2571
|
+
}).strict();
|
|
2572
|
+
exports.svgRingShapeSchema = exports.svgshapesSvgRingShapeSchema;
|
|
2573
|
+
/**
|
|
2574
|
+
* A star shape with a specified number of points.
|
|
2575
|
+
* The star is defined by outer and inner radii, creating the characteristic
|
|
2576
|
+
* pointed appearance.
|
|
2577
|
+
*
|
|
2578
|
+
*/
|
|
2579
|
+
exports.svgshapesSvgStarShapeSchema = zod_1.z.object({
|
|
2580
|
+
type: zod_1.z.enum(["star"]),
|
|
2581
|
+
points: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2582
|
+
return undefined; if (Array.isArray(v))
|
|
2583
|
+
return v; if (typeof v === 'string') {
|
|
2584
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2585
|
+
return v;
|
|
2586
|
+
return Number(v);
|
|
2587
|
+
} return v; }), zod_1.z.number().int().gte(3).lte(100)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2588
|
+
outerRadius: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2589
|
+
return undefined; if (Array.isArray(v))
|
|
2590
|
+
return v; if (typeof v === 'string') {
|
|
2591
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2592
|
+
return v;
|
|
2593
|
+
return Number(v);
|
|
2594
|
+
} return v; }), zod_1.z.number().gte(1).lte(2048)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2595
|
+
innerRadius: zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2596
|
+
return undefined; if (Array.isArray(v))
|
|
2597
|
+
return v; if (typeof v === 'string') {
|
|
2598
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2599
|
+
return v;
|
|
2600
|
+
return Number(v);
|
|
2601
|
+
} return v; }), zod_1.z.number().gte(1).lte(2048)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2602
|
+
}).strict();
|
|
2603
|
+
exports.svgStarShapeSchema = exports.svgshapesSvgStarShapeSchema;
|
|
2604
|
+
/**
|
|
2605
|
+
* The shape definition for an SVG asset. Each shape type has its own specific
|
|
2606
|
+
* properties. The `type` field determines which shape is rendered.
|
|
2607
|
+
*
|
|
2608
|
+
*/
|
|
2609
|
+
exports.svgshapesSvgShapeSchema = zod_1.z.discriminatedUnion("type", [
|
|
2610
|
+
exports.svgshapesSvgRectangleShapeSchema,
|
|
2611
|
+
exports.svgshapesSvgCircleShapeSchema,
|
|
2612
|
+
exports.svgshapesSvgEllipseShapeSchema,
|
|
2613
|
+
exports.svgshapesSvgLineShapeSchema,
|
|
2614
|
+
exports.svgshapesSvgPolygonShapeSchema,
|
|
2615
|
+
exports.svgshapesSvgStarShapeSchema,
|
|
2616
|
+
exports.svgshapesSvgArrowShapeSchema,
|
|
2617
|
+
exports.svgshapesSvgHeartShapeSchema,
|
|
2618
|
+
exports.svgshapesSvgCrossShapeSchema,
|
|
2619
|
+
exports.svgshapesSvgRingShapeSchema,
|
|
2620
|
+
exports.svgshapesSvgPathShapeSchema,
|
|
2621
|
+
]);
|
|
2622
|
+
exports.svgShapeSchema = exports.svgshapesSvgShapeSchema;
|
|
2623
|
+
/**
|
|
2624
|
+
* The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.
|
|
2625
|
+
* It provides two mutually exclusive ways to define shapes:
|
|
2626
|
+
*
|
|
2627
|
+
* **Option 1: Import SVG markup using `src`**
|
|
2122
2628
|
* ```json
|
|
2123
2629
|
* {
|
|
2124
2630
|
* "type": "svg",
|
|
2125
2631
|
* "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
|
|
2126
2632
|
* }
|
|
2127
2633
|
* ```
|
|
2634
|
+
* When using `src`, no other properties are allowed. The fill, stroke, and dimensions
|
|
2635
|
+
* are automatically extracted from the SVG markup.
|
|
2636
|
+
*
|
|
2637
|
+
* **Option 2: Define shapes programmatically using `shape`**
|
|
2638
|
+
* ```json
|
|
2639
|
+
* {
|
|
2640
|
+
* "type": "svg",
|
|
2641
|
+
* "shape": { "type": "circle", "radius": 50 },
|
|
2642
|
+
* "fill": { "type": "solid", "color": "#FF0000" }
|
|
2643
|
+
* }
|
|
2644
|
+
* ```
|
|
2645
|
+
* When using `shape`, you can customize fill, stroke, shadow, transform, and other properties.
|
|
2646
|
+
* The `src` property is not allowed in this mode.
|
|
2647
|
+
*
|
|
2648
|
+
* **Important:** You must provide either `src` OR `shape`, but not both.
|
|
2649
|
+
* These two modes are mutually exclusive.
|
|
2650
|
+
*
|
|
2651
|
+
* **Available Shapes (Option 2 only):**
|
|
2652
|
+
* - `rectangle` - Rectangles with optional rounded corners
|
|
2653
|
+
* - `circle` - Perfect circles
|
|
2654
|
+
* - `ellipse` - Ellipses/ovals with separate x and y radii
|
|
2655
|
+
* - `line` - Straight lines with configurable thickness
|
|
2656
|
+
* - `polygon` - Regular polygons (triangle, pentagon, hexagon, etc.)
|
|
2657
|
+
* - `star` - Multi-pointed stars
|
|
2658
|
+
* - `arrow` - Directional arrows
|
|
2659
|
+
* - `heart` - Heart shapes
|
|
2660
|
+
* - `cross` - Plus/cross shapes
|
|
2661
|
+
* - `ring` - Donut/ring shapes
|
|
2662
|
+
* - `path` - Custom shapes using SVG path data
|
|
2128
2663
|
*
|
|
2129
|
-
* See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for
|
|
2664
|
+
* See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
|
|
2130
2665
|
*
|
|
2131
2666
|
*/
|
|
2132
2667
|
exports.svgassetSvgAssetSchema = zod_1.z.object({
|
|
2133
2668
|
type: zod_1.z.enum(["svg"]),
|
|
2134
|
-
src: zod_1.z.string().min(1).max(500000),
|
|
2135
|
-
|
|
2669
|
+
src: zod_1.z.optional(zod_1.z.string().min(1).max(500000)),
|
|
2670
|
+
shape: zod_1.z.optional(exports.svgshapesSvgShapeSchema),
|
|
2671
|
+
fill: zod_1.z.optional(exports.svgpropertiesSvgFillSchema),
|
|
2672
|
+
stroke: zod_1.z.optional(exports.svgpropertiesSvgStrokeSchema),
|
|
2673
|
+
shadow: zod_1.z.optional(exports.svgpropertiesSvgShadowSchema),
|
|
2674
|
+
transform: zod_1.z.optional(exports.svgpropertiesSvgTransformSchema),
|
|
2675
|
+
opacity: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2676
|
+
return undefined; if (Array.isArray(v))
|
|
2677
|
+
return v; if (typeof v === 'string') {
|
|
2678
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2679
|
+
return v;
|
|
2680
|
+
return Number(v);
|
|
2681
|
+
} return v; }), zod_1.z.number().gte(0).lte(1)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2682
|
+
width: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2683
|
+
return undefined; if (Array.isArray(v))
|
|
2684
|
+
return v; if (typeof v === 'string') {
|
|
2685
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2686
|
+
return v;
|
|
2687
|
+
return Number(v);
|
|
2688
|
+
} return v; }), zod_1.z.number().int().gte(1).lte(4096)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2689
|
+
height: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2690
|
+
return undefined; if (Array.isArray(v))
|
|
2691
|
+
return v; if (typeof v === 'string') {
|
|
2692
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2693
|
+
return v;
|
|
2694
|
+
return Number(v);
|
|
2695
|
+
} return v; }), zod_1.z.number().int().gte(1).lte(4096)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2696
|
+
}).strict().superRefine((data, ctx) => {
|
|
2697
|
+
const hasShape = data.shape !== undefined;
|
|
2698
|
+
const hasSrc = data.src !== undefined && data.src.trim() !== "";
|
|
2699
|
+
if (!hasShape && !hasSrc) {
|
|
2700
|
+
ctx.addIssue({
|
|
2701
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
2702
|
+
message: "Either 'src' or 'shape' must be provided",
|
|
2703
|
+
path: [],
|
|
2704
|
+
});
|
|
2705
|
+
}
|
|
2706
|
+
if (hasShape && hasSrc) {
|
|
2707
|
+
ctx.addIssue({
|
|
2708
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
2709
|
+
message: "Provide either 'src' or 'shape', not both",
|
|
2710
|
+
path: ["src"],
|
|
2711
|
+
});
|
|
2712
|
+
}
|
|
2713
|
+
if (hasSrc) {
|
|
2714
|
+
const disallowedProps = ["shape", "fill", "stroke", "shadow", "transform", "width", "height"];
|
|
2715
|
+
for (const prop of disallowedProps) {
|
|
2716
|
+
if (data[prop] !== undefined) {
|
|
2717
|
+
ctx.addIssue({
|
|
2718
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
2719
|
+
message: `'${prop}' is not allowed when using 'src'. Only 'type' and 'src' are allowed in import mode`,
|
|
2720
|
+
path: [prop],
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
});
|
|
2136
2726
|
exports.svgAssetSchema = exports.svgassetSvgAssetSchema;
|
|
2137
2727
|
/**
|
|
2138
2728
|
* Configure the id and optional merge fields to render a template by id.
|