@shotstack/shotstack-canvas 2.0.13 → 2.0.15
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 +310 -70
- package/dist/entry.node.d.cts +12 -1
- package/dist/entry.node.d.ts +12 -1
- package/dist/entry.node.js +304 -70
- package/dist/entry.web.d.ts +12 -1
- package/dist/entry.web.js +1071 -70
- package/package.json +66 -65
package/dist/entry.web.d.ts
CHANGED
|
@@ -534,6 +534,7 @@ interface HBGlyphInfo {
|
|
|
534
534
|
interface HBBuffer {
|
|
535
535
|
addText(text: string): void;
|
|
536
536
|
guessSegmentProperties(): void;
|
|
537
|
+
setDirection(direction: "ltr" | "rtl" | "ttb" | "btt"): void;
|
|
537
538
|
json(): HBGlyphInfo[];
|
|
538
539
|
destroy(): void;
|
|
539
540
|
}
|
|
@@ -594,6 +595,14 @@ declare class FontRegistry {
|
|
|
594
595
|
destroy(): void;
|
|
595
596
|
}
|
|
596
597
|
|
|
598
|
+
declare function containsRTLCharacters(text: string): boolean;
|
|
599
|
+
type ParagraphDirection = "ltr" | "rtl";
|
|
600
|
+
declare function detectParagraphDirection(text: string): ParagraphDirection;
|
|
601
|
+
declare function detectParagraphDirectionFromWords(words: string[]): ParagraphDirection;
|
|
602
|
+
declare function reorderWordsForLine(wordTexts: string[], paragraphDirection: ParagraphDirection): number[];
|
|
603
|
+
declare function getVisibleText(text: string, visibleCharacters: number, isRTL: boolean): string;
|
|
604
|
+
declare function mirrorAnimationDirection(direction: "left" | "right" | "up" | "down", isRTL: boolean): "left" | "right" | "up" | "down";
|
|
605
|
+
|
|
597
606
|
interface WordTiming {
|
|
598
607
|
text: string;
|
|
599
608
|
start: number;
|
|
@@ -658,6 +667,7 @@ interface CaptionLayout {
|
|
|
658
667
|
store: WordTimingStore;
|
|
659
668
|
groups: CaptionGroup[];
|
|
660
669
|
shapedWords: ShapedWord[];
|
|
670
|
+
paragraphDirection: ParagraphDirection;
|
|
661
671
|
}
|
|
662
672
|
declare function isRTLText(text: string): boolean;
|
|
663
673
|
declare class WordTimingStore {
|
|
@@ -771,6 +781,7 @@ type ShapedLine = {
|
|
|
771
781
|
glyphs: Glyph[];
|
|
772
782
|
width: number;
|
|
773
783
|
y: number;
|
|
784
|
+
isRTL?: boolean;
|
|
774
785
|
};
|
|
775
786
|
type DrawOp = {
|
|
776
787
|
op: "BeginFrame";
|
|
@@ -1274,4 +1285,4 @@ declare function createTextEngine(opts?: {
|
|
|
1274
1285
|
destroy(): void;
|
|
1275
1286
|
}>;
|
|
1276
1287
|
|
|
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 };
|
|
1288
|
+
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 ParagraphDirection, 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, containsRTLCharacters, createDefaultGeneratorConfig, createFrameSchedule, createMediaRecorderFallback, createTextEngine, createVideoEncoder, createWebCodecsEncoder, createWebPainter, detectParagraphDirection, detectParagraphDirectionFromWords, detectPlatform, detectSubtitleFormat, extractCaptionPadding, findWordAtTime, generateRichCaptionDrawOps, generateRichCaptionFrame, generateShapePathData, getDefaultAnimationConfig, getDrawCaptionWordOps, getEncoderCapabilities, getEncoderWarning, getVisibleText, groupWordsByPause, initResvg, isDrawCaptionWordOp, isMediaRecorderSupported, isRTLText, isWebCodecsH264Supported, mirrorAnimationDirection, normalizePath, normalizePathString, parseSubtitleToWords, parseSvgPath, quadraticToCubic, renderSvgAssetToPng, renderSvgToPng, reorderWordsForLine, richCaptionAssetSchema, shapeToSvgString };
|