@shotstack/shotstack-canvas 2.0.10 → 2.0.12
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/entry.node.cjs +2629 -2605
- package/dist/entry.node.d.cts +15 -3
- package/dist/entry.node.d.ts +15 -3
- package/dist/entry.node.js +2623 -2605
- package/dist/entry.web.d.ts +15 -2
- package/dist/entry.web.js +2849 -2824
- package/package.json +65 -65
package/dist/entry.web.d.ts
CHANGED
|
@@ -372,6 +372,7 @@ declare const richCaptionAssetSchema: z.ZodObject<{
|
|
|
372
372
|
down: "down";
|
|
373
373
|
}>>;
|
|
374
374
|
}, z.core.$strict>>;
|
|
375
|
+
pauseThreshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
375
376
|
customFonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
376
377
|
src: z.ZodString;
|
|
377
378
|
family: z.ZodString;
|
|
@@ -497,6 +498,7 @@ declare const CanvasRichCaptionAssetSchema: z.ZodObject<{
|
|
|
497
498
|
down: "down";
|
|
498
499
|
}>>;
|
|
499
500
|
}, z.core.$strict>>;
|
|
501
|
+
pauseThreshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
500
502
|
customFonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
501
503
|
src: z.ZodString;
|
|
502
504
|
family: z.ZodString;
|
|
@@ -1040,6 +1042,11 @@ declare function renderSvgAssetToPng(asset: CanvasSvgAsset, options?: {
|
|
|
1040
1042
|
background?: string;
|
|
1041
1043
|
}): Promise<ResvgRenderResult>;
|
|
1042
1044
|
|
|
1045
|
+
declare const ASCENT_RATIO = 0.8;
|
|
1046
|
+
declare const DESCENT_RATIO = 0.2;
|
|
1047
|
+
declare const WORD_BG_OPACITY = 1;
|
|
1048
|
+
declare const WORD_BG_BORDER_RADIUS = 4;
|
|
1049
|
+
declare const WORD_BG_PADDING_RATIO = 0.12;
|
|
1043
1050
|
interface RichCaptionGeneratorConfig {
|
|
1044
1051
|
frameWidth: number;
|
|
1045
1052
|
frameHeight: number;
|
|
@@ -1073,7 +1080,13 @@ interface BackgroundConfig {
|
|
|
1073
1080
|
borderRadius: number;
|
|
1074
1081
|
padding: number;
|
|
1075
1082
|
}
|
|
1076
|
-
declare function
|
|
1083
|
+
declare function extractCaptionPadding(asset: CanvasRichCaptionAsset): {
|
|
1084
|
+
top: number;
|
|
1085
|
+
right: number;
|
|
1086
|
+
bottom: number;
|
|
1087
|
+
left: number;
|
|
1088
|
+
};
|
|
1089
|
+
declare function generateRichCaptionDrawOps(asset: CanvasRichCaptionAsset, layout: CaptionLayout, frameTimeMs: number, layoutEngine: CaptionLayoutEngine, config: RichCaptionGeneratorConfig): DrawOp[];
|
|
1077
1090
|
declare function generateRichCaptionFrame(asset: CanvasRichCaptionAsset, layout: CaptionLayout, frameTimeMs: number, layoutEngine: CaptionLayoutEngine, config: RichCaptionGeneratorConfig): {
|
|
1078
1091
|
ops: DrawOp[];
|
|
1079
1092
|
visibleWordCount: number;
|
|
@@ -1261,4 +1274,4 @@ declare function createTextEngine(opts?: {
|
|
|
1261
1274
|
destroy(): void;
|
|
1262
1275
|
}>;
|
|
1263
1276
|
|
|
1264
|
-
export { type AnimationDirection, type AnimationStyle, type ArcCommand, type BackgroundConfig, type BoundingBox, type CanvasRichCaptionAsset, CanvasRichCaptionAssetSchema, type CanvasRichTextAsset, CanvasRichTextAssetSchema, type CanvasSvgAsset, CanvasSvgAssetSchema, type CaptionGroup, type CaptionLayout, type CaptionLayoutConfig, CaptionLayoutEngine, type CaptionLine, type ClosePathCommand, type CubicBezierCommand, type DrawOp, type EngineInit, type FastVideoOptions, type FastVideoResult, type FontConfig, FontRegistry, type FrameSchedule, type Glyph, type GradientSpec, type IVideoEncoder, type LineToCommand, MediaRecorderFallback, type MoveToCommand, type NormalizedPathCommand, type ParsedPathCommand, type PathCommandType, type Point2D, type PositionedWord, type QuadraticBezierCommand, type RGBA, type RenderFrame, type RenderStats, type Renderer, type ResvgRenderOptions, type ResvgRenderResult, type RichCaptionGeneratorConfig, type RichCaptionRendererOptions, type ShadowConfig, type ShapedLine, type ShapedWord, type ShapedWordGlyph, type ShotstackRichTextAsset, type ShotstackSvgAsset, type StrokeConfig, type StrokeSpec, type ValidAsset, type VideoEncoderCapabilities, type VideoEncoderConfig, type VideoEncoderProgress, WebCodecsEncoder, type WordAnimationConfig, type WordAnimationState, type WordTiming, WordTimingStore, arcToCubicBeziers, breakIntoLines, calculateAnimationStatesForGroup, commandsToPathString, computeSimplePathBounds, createDefaultGeneratorConfig, createFrameSchedule, createMediaRecorderFallback, createTextEngine, createVideoEncoder, createWebCodecsEncoder, createWebPainter, detectPlatform, detectSubtitleFormat, findWordAtTime, generateRichCaptionDrawOps, generateRichCaptionFrame, generateShapePathData, getDefaultAnimationConfig, getDrawCaptionWordOps, getEncoderCapabilities, getEncoderWarning, groupWordsByPause, initResvg, isDrawCaptionWordOp, isMediaRecorderSupported, isRTLText, isWebCodecsH264Supported, normalizePath, normalizePathString, parseSubtitleToWords, parseSvgPath, quadraticToCubic, renderSvgAssetToPng, renderSvgToPng, richCaptionAssetSchema, shapeToSvgString };
|
|
1277
|
+
export { ASCENT_RATIO, type AnimationDirection, type AnimationStyle, type ArcCommand, type BackgroundConfig, type BoundingBox, type CanvasRichCaptionAsset, CanvasRichCaptionAssetSchema, type CanvasRichTextAsset, CanvasRichTextAssetSchema, type CanvasSvgAsset, CanvasSvgAssetSchema, type CaptionGroup, type CaptionLayout, type CaptionLayoutConfig, CaptionLayoutEngine, type CaptionLine, type ClosePathCommand, type CubicBezierCommand, DESCENT_RATIO, type DrawOp, type EngineInit, type FastVideoOptions, type FastVideoResult, type FontConfig, FontRegistry, type FrameSchedule, type Glyph, type GradientSpec, type IVideoEncoder, type LineToCommand, MediaRecorderFallback, type MoveToCommand, type NormalizedPathCommand, type ParsedPathCommand, type PathCommandType, type Point2D, type PositionedWord, type QuadraticBezierCommand, type RGBA, type RenderFrame, type RenderStats, type Renderer, type ResvgRenderOptions, type ResvgRenderResult, type RichCaptionGeneratorConfig, type RichCaptionRendererOptions, type ShadowConfig, type ShapedLine, type ShapedWord, type ShapedWordGlyph, type ShotstackRichTextAsset, type ShotstackSvgAsset, type StrokeConfig, type StrokeSpec, type ValidAsset, type VideoEncoderCapabilities, type VideoEncoderConfig, type VideoEncoderProgress, WORD_BG_BORDER_RADIUS, WORD_BG_OPACITY, WORD_BG_PADDING_RATIO, WebCodecsEncoder, type WordAnimationConfig, type WordAnimationState, type WordTiming, WordTimingStore, arcToCubicBeziers, breakIntoLines, calculateAnimationStatesForGroup, commandsToPathString, computeSimplePathBounds, createDefaultGeneratorConfig, createFrameSchedule, createMediaRecorderFallback, createTextEngine, createVideoEncoder, createWebCodecsEncoder, createWebPainter, detectPlatform, detectSubtitleFormat, extractCaptionPadding, findWordAtTime, generateRichCaptionDrawOps, generateRichCaptionFrame, generateShapePathData, getDefaultAnimationConfig, getDrawCaptionWordOps, getEncoderCapabilities, getEncoderWarning, groupWordsByPause, initResvg, isDrawCaptionWordOp, isMediaRecorderSupported, isRTLText, isWebCodecsH264Supported, normalizePath, normalizePathString, parseSubtitleToWords, parseSvgPath, quadraticToCubic, renderSvgAssetToPng, renderSvgToPng, richCaptionAssetSchema, shapeToSvgString };
|