ugcinc-render 1.5.26 → 1.5.28

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/index.d.mts CHANGED
@@ -80,6 +80,74 @@ type Hyphenation = 'none' | 'auto';
80
80
  * Text overflow behavior
81
81
  */
82
82
  type TextOverflow = 'clip' | 'ellipsis';
83
+ /**
84
+ * Shared text styling properties used by both render and UI text segments.
85
+ * This ensures feature parity between image editor and video editor text elements.
86
+ */
87
+ interface TextStyleProperties {
88
+ /** Horizontal alignment (default: 'left') */
89
+ alignment?: TextAlignment;
90
+ /** Vertical alignment within bounds (default: 'top') */
91
+ verticalAlign?: VerticalAlignment;
92
+ /** Text direction (default: 'ltr') */
93
+ direction?: TextDirection;
94
+ /** Inner padding in pixels - uniform for all sides (default: 0) */
95
+ padding?: number;
96
+ /** Top padding in pixels */
97
+ paddingTop?: number;
98
+ /** Right padding in pixels */
99
+ paddingRight?: number;
100
+ /** Bottom padding in pixels */
101
+ paddingBottom?: number;
102
+ /** Left padding in pixels */
103
+ paddingLeft?: number;
104
+ /** Extra top padding added when text has 2+ lines */
105
+ multiLineExtraPaddingTop?: number;
106
+ /** Extra right padding added when text has 2+ lines */
107
+ multiLineExtraPaddingRight?: number;
108
+ /** Extra bottom padding added when text has 2+ lines */
109
+ multiLineExtraPaddingBottom?: number;
110
+ /** Extra left padding added when text has 2+ lines */
111
+ multiLineExtraPaddingLeft?: number;
112
+ /** Font family (default: 'arial') */
113
+ fontType?: FontType;
114
+ /** Font size in pixels (default: 40) */
115
+ fontSize?: number;
116
+ /** Font weight (default: 'normal') */
117
+ fontWeight?: FontWeight;
118
+ /** Line height multiplier (default: 1.2) */
119
+ lineHeight?: number;
120
+ /** Letter spacing in pixels (default: 0) */
121
+ letterSpacing?: number;
122
+ /** How text wraps to new lines (default: 'word') */
123
+ textWrap?: TextWrap;
124
+ /** How words break across lines (default: 'normal') */
125
+ wordBreak?: WordBreak;
126
+ /** Automatic hyphenation (default: 'none') */
127
+ hyphenation?: Hyphenation;
128
+ /** Maximum lines (0 = unlimited) (default: 0) */
129
+ maxLines?: number;
130
+ /** How overflow is handled (default: 'clip') */
131
+ textOverflow?: TextOverflow;
132
+ /** Ellipsis string for overflow (default: '...') */
133
+ ellipsis?: string;
134
+ /** Text color (default: '#000000') */
135
+ color?: string;
136
+ /** Background color in hex format #RRGGBB (default: transparent) */
137
+ backgroundColor?: string;
138
+ /** Background opacity 0-100 (default: 100) */
139
+ backgroundOpacity?: number;
140
+ /** Border radius for background box - individual corners (default: 0) */
141
+ backgroundBorderRadius?: BorderRadiusConfig;
142
+ /** Text outline color (default: none) */
143
+ strokeColor?: string;
144
+ /** Outline width in pixels (default: 0) */
145
+ strokeWidth?: number;
146
+ /** When true, box shrinks to fit content (width becomes max width) */
147
+ autoWidth?: boolean;
148
+ /** Which side the box anchors to when autoWidth is true (default: 'left') */
149
+ boxAlign?: 'left' | 'center' | 'right';
150
+ }
83
151
 
84
152
  /**
85
153
  * Position and anchor types for relative element positioning
@@ -437,32 +505,16 @@ interface VideoEditorImageSegment extends VideoEditorVisualSegment {
437
505
  }
438
506
  /**
439
507
  * Text segment (UI)
508
+ *
509
+ * Extends TextStyleProperties which contains all shared text styling options.
510
+ * This ensures feature parity between image editor and video editor text elements.
440
511
  */
441
- interface VideoEditorTextSegment extends VideoEditorVisualSegment {
512
+ interface VideoEditorTextSegment extends VideoEditorVisualSegment, TextStyleProperties {
442
513
  type: 'text';
443
514
  /** UI-only: reference to text input - resolved to text before rendering */
444
515
  textInputRef?: string;
445
516
  /** Actual text content (set after textInputRef is resolved) */
446
517
  text?: string;
447
- alignment?: 'left' | 'center' | 'right' | 'justify';
448
- verticalAlign?: 'top' | 'middle' | 'bottom';
449
- direction?: 'ltr' | 'rtl';
450
- padding?: number;
451
- fontType?: 'tiktok' | 'apple' | 'arial';
452
- fontSize?: number;
453
- fontWeight?: 'normal' | 'bold';
454
- lineHeight?: number;
455
- letterSpacing?: number;
456
- textWrap?: 'word' | 'char' | 'none';
457
- wordBreak?: 'normal' | 'break-all' | 'break-word';
458
- hyphenation?: 'none' | 'auto';
459
- maxLines?: number;
460
- textOverflow?: 'clip' | 'ellipsis';
461
- ellipsis?: string;
462
- color?: string;
463
- backgroundColor?: string;
464
- strokeColor?: string;
465
- strokeWidth?: number;
466
518
  }
467
519
  /**
468
520
  * Union of all video editor segment types
@@ -600,74 +652,15 @@ interface ImageSegment extends PictureSegment {
600
652
  }
601
653
  /**
602
654
  * Text segment - rich text overlays with full typography control
655
+ *
656
+ * Extends TextStyleProperties which contains all shared text styling options.
657
+ * This ensures feature parity between image editor and video editor text elements.
603
658
  */
604
- interface TextSegment extends VisualSegment {
659
+ interface TextSegment extends VisualSegment, TextStyleProperties {
605
660
  type: 'text';
606
661
  source: '';
607
662
  /** The text content (supports emojis) */
608
663
  text: string;
609
- /** Horizontal alignment (default: 'left') */
610
- alignment?: TextAlignment;
611
- /** Vertical alignment within bounds (default: 'top') */
612
- verticalAlign?: VerticalAlignment;
613
- /** Text direction (default: 'ltr') */
614
- direction?: TextDirection;
615
- /** Inner padding in pixels - uniform for all sides (default: 0). Overridden by individual padding values if set. */
616
- padding?: number;
617
- /** Top padding in pixels (overrides uniform padding) */
618
- paddingTop?: number;
619
- /** Right padding in pixels (overrides uniform padding) */
620
- paddingRight?: number;
621
- /** Bottom padding in pixels (overrides uniform padding) */
622
- paddingBottom?: number;
623
- /** Left padding in pixels (overrides uniform padding) */
624
- paddingLeft?: number;
625
- /** Extra top padding added when text has 2+ lines */
626
- multiLineExtraPaddingTop?: number;
627
- /** Extra right padding added when text has 2+ lines */
628
- multiLineExtraPaddingRight?: number;
629
- /** Extra bottom padding added when text has 2+ lines */
630
- multiLineExtraPaddingBottom?: number;
631
- /** Extra left padding added when text has 2+ lines */
632
- multiLineExtraPaddingLeft?: number;
633
- /** Font family (default: 'arial') */
634
- fontType?: FontType;
635
- /** Font size in pixels (default: 40) */
636
- fontSize?: number;
637
- /** Font weight (default: 'normal') */
638
- fontWeight?: FontWeight;
639
- /** Line height multiplier (default: 1.2) */
640
- lineHeight?: number;
641
- /** Letter spacing in pixels (default: 0) */
642
- letterSpacing?: number;
643
- /** How text wraps to new lines (default: 'word') */
644
- textWrap?: TextWrap;
645
- /** How words break across lines (default: 'normal') */
646
- wordBreak?: WordBreak;
647
- /** Automatic hyphenation (default: 'none') */
648
- hyphenation?: Hyphenation;
649
- /** Maximum lines (0 = unlimited) (default: 0) */
650
- maxLines?: number;
651
- /** How overflow is handled (default: 'clip') */
652
- textOverflow?: TextOverflow;
653
- /** Ellipsis string for overflow (default: '...') */
654
- ellipsis?: string;
655
- /** Text color (default: '#000000') */
656
- color?: string;
657
- /** Background color in hex format #RRGGBB (default: transparent) */
658
- backgroundColor?: string;
659
- /** Background opacity 0-100 (default: 100) */
660
- backgroundOpacity?: number;
661
- /** Border radius for background box - individual corners (default: 0) */
662
- backgroundBorderRadius?: BorderRadiusConfig;
663
- /** Text outline color (default: none) */
664
- strokeColor?: string;
665
- /** Outline width in pixels (default: 0) */
666
- strokeWidth?: number;
667
- /** When true, box shrinks to fit content (width becomes max width) */
668
- autoWidth?: boolean;
669
- /** Which side the box anchors to when autoWidth is true (default: 'left') */
670
- boxAlign?: 'left' | 'center' | 'right';
671
664
  }
672
665
  /**
673
666
  * Audio segment - background audio or music
@@ -1372,4 +1365,4 @@ declare function useResolvedPositions(elements: ImageEditorElement[], textValues
1372
1365
 
1373
1366
  declare const RenderRoot: React.FC;
1374
1367
 
1375
- export { APPLE_EMOJI_FONT, type AudioSegment, type BaseEditorConfig, type BaseSegment, type BorderRadiusConfig, type Channel, type CropAxisConfig, type CropBoundary, type CropBounds, DIMENSION_PRESETS, type DimensionPreset, type DimensionPresetKey, type DynamicCropConfig, type EditorConfig, type EditorSegment, FONT_FAMILIES, FONT_URLS, type FitDimensions, type FitMode, type FontType, type FontWeight, type HorizontalAnchor, type HorizontalSelfAnchor, type Hyphenation, IMAGE_DEFAULTS, ImageEditorComposition, type ImageEditorCompositionProps, type ImageEditorConfig, type ImageEditorElement, type ImageEditorNodeConfig, ImageElement, type ImageElementProps, type ImageSegment, type PictureSegment, type PositionResolutionError, type PositionResolutionResult, type RelativePositionConfigX, type RelativePositionConfigY, RenderRoot, type Segment, type SegmentTimelinePosition, type SegmentType, type StaticSegment, TEXT_DEFAULTS, type TextAlignment, type TextDirection, TextElement, type TextElementProps, type TextOverflow, type TextSegment, type TextWrap, type TimeMode, type TimeValue, VIDEO_DEFAULTS, VISUAL_DEFAULTS, type VerticalAlignment, type VerticalAnchor, type VerticalSelfAnchor, type VideoEditorAudioSegment, type VideoEditorBaseSegment, type VideoEditorChannel, VideoEditorComposition, type VideoEditorCompositionProps, type VideoEditorConfig, type VideoEditorImageSegment, type VideoEditorNodeConfig, type VideoEditorSegment, type VideoEditorTextSegment, type VideoEditorVideoSegment, type VideoEditorVisualSegment, VideoElement, type VideoElementProps, type VideoSegment, type VisualSegment, type VisualSegmentUnion, type WordBreak, applyImageDefaults, applyTextDefaults, applyVideoDefaults, areFontsLoaded, buildFontString, calculateAutoWidthDimensions, calculateCropBounds, calculateEstimatedDuration, calculateFitDimensions, calculateLineWidth, calculateTimelineContentEnd, canSetAsReference, debugFontStatus, defaultOffset, formatTime, generateOverlayId, generateSegmentId, getBaseSegments, getBorderRadii, getDependentElements, getFontFamily, getOverlays, getReferenceElementX, getReferenceElementY, getSegmentTimelinePosition, hexToRgba, isDynamicCropEnabled, isSegmentVisibleAtTime, parseHexColor, parseTime, preloadFonts, resolveElementPositions, useFontsLoaded, useImageLoader, useImagePreloader, useResolvedPositions, wrapText };
1368
+ export { APPLE_EMOJI_FONT, type AudioSegment, type BaseEditorConfig, type BaseSegment, type BorderRadiusConfig, type Channel, type CropAxisConfig, type CropBoundary, type CropBounds, DIMENSION_PRESETS, type DimensionPreset, type DimensionPresetKey, type DynamicCropConfig, type EditorConfig, type EditorSegment, FONT_FAMILIES, FONT_URLS, type FitDimensions, type FitMode, type FontType, type FontWeight, type HorizontalAnchor, type HorizontalSelfAnchor, type Hyphenation, IMAGE_DEFAULTS, ImageEditorComposition, type ImageEditorCompositionProps, type ImageEditorConfig, type ImageEditorElement, type ImageEditorNodeConfig, ImageElement, type ImageElementProps, type ImageSegment, type PictureSegment, type PositionResolutionError, type PositionResolutionResult, type RelativePositionConfigX, type RelativePositionConfigY, RenderRoot, type Segment, type SegmentTimelinePosition, type SegmentType, type StaticSegment, TEXT_DEFAULTS, type TextAlignment, type TextDirection, TextElement, type TextElementProps, type TextOverflow, type TextSegment, type TextStyleProperties, type TextWrap, type TimeMode, type TimeValue, VIDEO_DEFAULTS, VISUAL_DEFAULTS, type VerticalAlignment, type VerticalAnchor, type VerticalSelfAnchor, type VideoEditorAudioSegment, type VideoEditorBaseSegment, type VideoEditorChannel, VideoEditorComposition, type VideoEditorCompositionProps, type VideoEditorConfig, type VideoEditorImageSegment, type VideoEditorNodeConfig, type VideoEditorSegment, type VideoEditorTextSegment, type VideoEditorVideoSegment, type VideoEditorVisualSegment, VideoElement, type VideoElementProps, type VideoSegment, type VisualSegment, type VisualSegmentUnion, type WordBreak, applyImageDefaults, applyTextDefaults, applyVideoDefaults, areFontsLoaded, buildFontString, calculateAutoWidthDimensions, calculateCropBounds, calculateEstimatedDuration, calculateFitDimensions, calculateLineWidth, calculateTimelineContentEnd, canSetAsReference, debugFontStatus, defaultOffset, formatTime, generateOverlayId, generateSegmentId, getBaseSegments, getBorderRadii, getDependentElements, getFontFamily, getOverlays, getReferenceElementX, getReferenceElementY, getSegmentTimelinePosition, hexToRgba, isDynamicCropEnabled, isSegmentVisibleAtTime, parseHexColor, parseTime, preloadFonts, resolveElementPositions, useFontsLoaded, useImageLoader, useImagePreloader, useResolvedPositions, wrapText };
package/dist/index.d.ts CHANGED
@@ -80,6 +80,74 @@ type Hyphenation = 'none' | 'auto';
80
80
  * Text overflow behavior
81
81
  */
82
82
  type TextOverflow = 'clip' | 'ellipsis';
83
+ /**
84
+ * Shared text styling properties used by both render and UI text segments.
85
+ * This ensures feature parity between image editor and video editor text elements.
86
+ */
87
+ interface TextStyleProperties {
88
+ /** Horizontal alignment (default: 'left') */
89
+ alignment?: TextAlignment;
90
+ /** Vertical alignment within bounds (default: 'top') */
91
+ verticalAlign?: VerticalAlignment;
92
+ /** Text direction (default: 'ltr') */
93
+ direction?: TextDirection;
94
+ /** Inner padding in pixels - uniform for all sides (default: 0) */
95
+ padding?: number;
96
+ /** Top padding in pixels */
97
+ paddingTop?: number;
98
+ /** Right padding in pixels */
99
+ paddingRight?: number;
100
+ /** Bottom padding in pixels */
101
+ paddingBottom?: number;
102
+ /** Left padding in pixels */
103
+ paddingLeft?: number;
104
+ /** Extra top padding added when text has 2+ lines */
105
+ multiLineExtraPaddingTop?: number;
106
+ /** Extra right padding added when text has 2+ lines */
107
+ multiLineExtraPaddingRight?: number;
108
+ /** Extra bottom padding added when text has 2+ lines */
109
+ multiLineExtraPaddingBottom?: number;
110
+ /** Extra left padding added when text has 2+ lines */
111
+ multiLineExtraPaddingLeft?: number;
112
+ /** Font family (default: 'arial') */
113
+ fontType?: FontType;
114
+ /** Font size in pixels (default: 40) */
115
+ fontSize?: number;
116
+ /** Font weight (default: 'normal') */
117
+ fontWeight?: FontWeight;
118
+ /** Line height multiplier (default: 1.2) */
119
+ lineHeight?: number;
120
+ /** Letter spacing in pixels (default: 0) */
121
+ letterSpacing?: number;
122
+ /** How text wraps to new lines (default: 'word') */
123
+ textWrap?: TextWrap;
124
+ /** How words break across lines (default: 'normal') */
125
+ wordBreak?: WordBreak;
126
+ /** Automatic hyphenation (default: 'none') */
127
+ hyphenation?: Hyphenation;
128
+ /** Maximum lines (0 = unlimited) (default: 0) */
129
+ maxLines?: number;
130
+ /** How overflow is handled (default: 'clip') */
131
+ textOverflow?: TextOverflow;
132
+ /** Ellipsis string for overflow (default: '...') */
133
+ ellipsis?: string;
134
+ /** Text color (default: '#000000') */
135
+ color?: string;
136
+ /** Background color in hex format #RRGGBB (default: transparent) */
137
+ backgroundColor?: string;
138
+ /** Background opacity 0-100 (default: 100) */
139
+ backgroundOpacity?: number;
140
+ /** Border radius for background box - individual corners (default: 0) */
141
+ backgroundBorderRadius?: BorderRadiusConfig;
142
+ /** Text outline color (default: none) */
143
+ strokeColor?: string;
144
+ /** Outline width in pixels (default: 0) */
145
+ strokeWidth?: number;
146
+ /** When true, box shrinks to fit content (width becomes max width) */
147
+ autoWidth?: boolean;
148
+ /** Which side the box anchors to when autoWidth is true (default: 'left') */
149
+ boxAlign?: 'left' | 'center' | 'right';
150
+ }
83
151
 
84
152
  /**
85
153
  * Position and anchor types for relative element positioning
@@ -437,32 +505,16 @@ interface VideoEditorImageSegment extends VideoEditorVisualSegment {
437
505
  }
438
506
  /**
439
507
  * Text segment (UI)
508
+ *
509
+ * Extends TextStyleProperties which contains all shared text styling options.
510
+ * This ensures feature parity between image editor and video editor text elements.
440
511
  */
441
- interface VideoEditorTextSegment extends VideoEditorVisualSegment {
512
+ interface VideoEditorTextSegment extends VideoEditorVisualSegment, TextStyleProperties {
442
513
  type: 'text';
443
514
  /** UI-only: reference to text input - resolved to text before rendering */
444
515
  textInputRef?: string;
445
516
  /** Actual text content (set after textInputRef is resolved) */
446
517
  text?: string;
447
- alignment?: 'left' | 'center' | 'right' | 'justify';
448
- verticalAlign?: 'top' | 'middle' | 'bottom';
449
- direction?: 'ltr' | 'rtl';
450
- padding?: number;
451
- fontType?: 'tiktok' | 'apple' | 'arial';
452
- fontSize?: number;
453
- fontWeight?: 'normal' | 'bold';
454
- lineHeight?: number;
455
- letterSpacing?: number;
456
- textWrap?: 'word' | 'char' | 'none';
457
- wordBreak?: 'normal' | 'break-all' | 'break-word';
458
- hyphenation?: 'none' | 'auto';
459
- maxLines?: number;
460
- textOverflow?: 'clip' | 'ellipsis';
461
- ellipsis?: string;
462
- color?: string;
463
- backgroundColor?: string;
464
- strokeColor?: string;
465
- strokeWidth?: number;
466
518
  }
467
519
  /**
468
520
  * Union of all video editor segment types
@@ -600,74 +652,15 @@ interface ImageSegment extends PictureSegment {
600
652
  }
601
653
  /**
602
654
  * Text segment - rich text overlays with full typography control
655
+ *
656
+ * Extends TextStyleProperties which contains all shared text styling options.
657
+ * This ensures feature parity between image editor and video editor text elements.
603
658
  */
604
- interface TextSegment extends VisualSegment {
659
+ interface TextSegment extends VisualSegment, TextStyleProperties {
605
660
  type: 'text';
606
661
  source: '';
607
662
  /** The text content (supports emojis) */
608
663
  text: string;
609
- /** Horizontal alignment (default: 'left') */
610
- alignment?: TextAlignment;
611
- /** Vertical alignment within bounds (default: 'top') */
612
- verticalAlign?: VerticalAlignment;
613
- /** Text direction (default: 'ltr') */
614
- direction?: TextDirection;
615
- /** Inner padding in pixels - uniform for all sides (default: 0). Overridden by individual padding values if set. */
616
- padding?: number;
617
- /** Top padding in pixels (overrides uniform padding) */
618
- paddingTop?: number;
619
- /** Right padding in pixels (overrides uniform padding) */
620
- paddingRight?: number;
621
- /** Bottom padding in pixels (overrides uniform padding) */
622
- paddingBottom?: number;
623
- /** Left padding in pixels (overrides uniform padding) */
624
- paddingLeft?: number;
625
- /** Extra top padding added when text has 2+ lines */
626
- multiLineExtraPaddingTop?: number;
627
- /** Extra right padding added when text has 2+ lines */
628
- multiLineExtraPaddingRight?: number;
629
- /** Extra bottom padding added when text has 2+ lines */
630
- multiLineExtraPaddingBottom?: number;
631
- /** Extra left padding added when text has 2+ lines */
632
- multiLineExtraPaddingLeft?: number;
633
- /** Font family (default: 'arial') */
634
- fontType?: FontType;
635
- /** Font size in pixels (default: 40) */
636
- fontSize?: number;
637
- /** Font weight (default: 'normal') */
638
- fontWeight?: FontWeight;
639
- /** Line height multiplier (default: 1.2) */
640
- lineHeight?: number;
641
- /** Letter spacing in pixels (default: 0) */
642
- letterSpacing?: number;
643
- /** How text wraps to new lines (default: 'word') */
644
- textWrap?: TextWrap;
645
- /** How words break across lines (default: 'normal') */
646
- wordBreak?: WordBreak;
647
- /** Automatic hyphenation (default: 'none') */
648
- hyphenation?: Hyphenation;
649
- /** Maximum lines (0 = unlimited) (default: 0) */
650
- maxLines?: number;
651
- /** How overflow is handled (default: 'clip') */
652
- textOverflow?: TextOverflow;
653
- /** Ellipsis string for overflow (default: '...') */
654
- ellipsis?: string;
655
- /** Text color (default: '#000000') */
656
- color?: string;
657
- /** Background color in hex format #RRGGBB (default: transparent) */
658
- backgroundColor?: string;
659
- /** Background opacity 0-100 (default: 100) */
660
- backgroundOpacity?: number;
661
- /** Border radius for background box - individual corners (default: 0) */
662
- backgroundBorderRadius?: BorderRadiusConfig;
663
- /** Text outline color (default: none) */
664
- strokeColor?: string;
665
- /** Outline width in pixels (default: 0) */
666
- strokeWidth?: number;
667
- /** When true, box shrinks to fit content (width becomes max width) */
668
- autoWidth?: boolean;
669
- /** Which side the box anchors to when autoWidth is true (default: 'left') */
670
- boxAlign?: 'left' | 'center' | 'right';
671
664
  }
672
665
  /**
673
666
  * Audio segment - background audio or music
@@ -1372,4 +1365,4 @@ declare function useResolvedPositions(elements: ImageEditorElement[], textValues
1372
1365
 
1373
1366
  declare const RenderRoot: React.FC;
1374
1367
 
1375
- export { APPLE_EMOJI_FONT, type AudioSegment, type BaseEditorConfig, type BaseSegment, type BorderRadiusConfig, type Channel, type CropAxisConfig, type CropBoundary, type CropBounds, DIMENSION_PRESETS, type DimensionPreset, type DimensionPresetKey, type DynamicCropConfig, type EditorConfig, type EditorSegment, FONT_FAMILIES, FONT_URLS, type FitDimensions, type FitMode, type FontType, type FontWeight, type HorizontalAnchor, type HorizontalSelfAnchor, type Hyphenation, IMAGE_DEFAULTS, ImageEditorComposition, type ImageEditorCompositionProps, type ImageEditorConfig, type ImageEditorElement, type ImageEditorNodeConfig, ImageElement, type ImageElementProps, type ImageSegment, type PictureSegment, type PositionResolutionError, type PositionResolutionResult, type RelativePositionConfigX, type RelativePositionConfigY, RenderRoot, type Segment, type SegmentTimelinePosition, type SegmentType, type StaticSegment, TEXT_DEFAULTS, type TextAlignment, type TextDirection, TextElement, type TextElementProps, type TextOverflow, type TextSegment, type TextWrap, type TimeMode, type TimeValue, VIDEO_DEFAULTS, VISUAL_DEFAULTS, type VerticalAlignment, type VerticalAnchor, type VerticalSelfAnchor, type VideoEditorAudioSegment, type VideoEditorBaseSegment, type VideoEditorChannel, VideoEditorComposition, type VideoEditorCompositionProps, type VideoEditorConfig, type VideoEditorImageSegment, type VideoEditorNodeConfig, type VideoEditorSegment, type VideoEditorTextSegment, type VideoEditorVideoSegment, type VideoEditorVisualSegment, VideoElement, type VideoElementProps, type VideoSegment, type VisualSegment, type VisualSegmentUnion, type WordBreak, applyImageDefaults, applyTextDefaults, applyVideoDefaults, areFontsLoaded, buildFontString, calculateAutoWidthDimensions, calculateCropBounds, calculateEstimatedDuration, calculateFitDimensions, calculateLineWidth, calculateTimelineContentEnd, canSetAsReference, debugFontStatus, defaultOffset, formatTime, generateOverlayId, generateSegmentId, getBaseSegments, getBorderRadii, getDependentElements, getFontFamily, getOverlays, getReferenceElementX, getReferenceElementY, getSegmentTimelinePosition, hexToRgba, isDynamicCropEnabled, isSegmentVisibleAtTime, parseHexColor, parseTime, preloadFonts, resolveElementPositions, useFontsLoaded, useImageLoader, useImagePreloader, useResolvedPositions, wrapText };
1368
+ export { APPLE_EMOJI_FONT, type AudioSegment, type BaseEditorConfig, type BaseSegment, type BorderRadiusConfig, type Channel, type CropAxisConfig, type CropBoundary, type CropBounds, DIMENSION_PRESETS, type DimensionPreset, type DimensionPresetKey, type DynamicCropConfig, type EditorConfig, type EditorSegment, FONT_FAMILIES, FONT_URLS, type FitDimensions, type FitMode, type FontType, type FontWeight, type HorizontalAnchor, type HorizontalSelfAnchor, type Hyphenation, IMAGE_DEFAULTS, ImageEditorComposition, type ImageEditorCompositionProps, type ImageEditorConfig, type ImageEditorElement, type ImageEditorNodeConfig, ImageElement, type ImageElementProps, type ImageSegment, type PictureSegment, type PositionResolutionError, type PositionResolutionResult, type RelativePositionConfigX, type RelativePositionConfigY, RenderRoot, type Segment, type SegmentTimelinePosition, type SegmentType, type StaticSegment, TEXT_DEFAULTS, type TextAlignment, type TextDirection, TextElement, type TextElementProps, type TextOverflow, type TextSegment, type TextStyleProperties, type TextWrap, type TimeMode, type TimeValue, VIDEO_DEFAULTS, VISUAL_DEFAULTS, type VerticalAlignment, type VerticalAnchor, type VerticalSelfAnchor, type VideoEditorAudioSegment, type VideoEditorBaseSegment, type VideoEditorChannel, VideoEditorComposition, type VideoEditorCompositionProps, type VideoEditorConfig, type VideoEditorImageSegment, type VideoEditorNodeConfig, type VideoEditorSegment, type VideoEditorTextSegment, type VideoEditorVideoSegment, type VideoEditorVisualSegment, VideoElement, type VideoElementProps, type VideoSegment, type VisualSegment, type VisualSegmentUnion, type WordBreak, applyImageDefaults, applyTextDefaults, applyVideoDefaults, areFontsLoaded, buildFontString, calculateAutoWidthDimensions, calculateCropBounds, calculateEstimatedDuration, calculateFitDimensions, calculateLineWidth, calculateTimelineContentEnd, canSetAsReference, debugFontStatus, defaultOffset, formatTime, generateOverlayId, generateSegmentId, getBaseSegments, getBorderRadii, getDependentElements, getFontFamily, getOverlays, getReferenceElementX, getReferenceElementY, getSegmentTimelinePosition, hexToRgba, isDynamicCropEnabled, isSegmentVisibleAtTime, parseHexColor, parseTime, preloadFonts, resolveElementPositions, useFontsLoaded, useImageLoader, useImagePreloader, useResolvedPositions, wrapText };
package/dist/index.js CHANGED
@@ -1634,7 +1634,8 @@ function VideoElement({
1634
1634
  const y = segment.yOffset * scale;
1635
1635
  const width = segment.width * scale;
1636
1636
  const height = segment.height * scale;
1637
- const startFrom = (segment.startTrim ?? 0) / 1e3;
1637
+ const startFromMs = segment.startTrim ?? 0;
1638
+ const startFromFrames = Math.round(startFromMs / 1e3 * fps);
1638
1639
  const fadeOpacity = (0, import_react4.useMemo)(() => {
1639
1640
  if (fadeIn <= 0) return 1;
1640
1641
  const framesFromStart = frame - startFrame;
@@ -1670,11 +1671,11 @@ function VideoElement({
1670
1671
  objectFit: fitModeToCss2(fit)
1671
1672
  }), [fit]);
1672
1673
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: containerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1673
- import_remotion3.Video,
1674
+ import_remotion3.OffthreadVideo,
1674
1675
  {
1675
1676
  src,
1676
1677
  style: videoStyle,
1677
- startFrom,
1678
+ startFrom: startFromFrames,
1678
1679
  playbackRate: speed,
1679
1680
  volume
1680
1681
  }
package/dist/index.mjs CHANGED
@@ -1523,7 +1523,7 @@ import { AbsoluteFill as AbsoluteFill2, useCurrentFrame as useCurrentFrame3, use
1523
1523
 
1524
1524
  // src/components/VideoElement.tsx
1525
1525
  import { useMemo as useMemo4 } from "react";
1526
- import { Video, useCurrentFrame as useCurrentFrame2, useVideoConfig as useVideoConfig2 } from "remotion";
1526
+ import { OffthreadVideo, useCurrentFrame as useCurrentFrame2, useVideoConfig as useVideoConfig2 } from "remotion";
1527
1527
  import { jsx as jsx4 } from "react/jsx-runtime";
1528
1528
  function fitModeToCss2(fit) {
1529
1529
  return fit;
@@ -1548,7 +1548,8 @@ function VideoElement({
1548
1548
  const y = segment.yOffset * scale;
1549
1549
  const width = segment.width * scale;
1550
1550
  const height = segment.height * scale;
1551
- const startFrom = (segment.startTrim ?? 0) / 1e3;
1551
+ const startFromMs = segment.startTrim ?? 0;
1552
+ const startFromFrames = Math.round(startFromMs / 1e3 * fps);
1552
1553
  const fadeOpacity = useMemo4(() => {
1553
1554
  if (fadeIn <= 0) return 1;
1554
1555
  const framesFromStart = frame - startFrame;
@@ -1584,11 +1585,11 @@ function VideoElement({
1584
1585
  objectFit: fitModeToCss2(fit)
1585
1586
  }), [fit]);
1586
1587
  return /* @__PURE__ */ jsx4("div", { style: containerStyle, children: /* @__PURE__ */ jsx4(
1587
- Video,
1588
+ OffthreadVideo,
1588
1589
  {
1589
1590
  src,
1590
1591
  style: videoStyle,
1591
- startFrom,
1592
+ startFrom: startFromFrames,
1592
1593
  playbackRate: speed,
1593
1594
  volume
1594
1595
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc-render",
3
- "version": "1.5.26",
3
+ "version": "1.5.28",
4
4
  "description": "Unified rendering package for UGC Inc - shared types, components, and compositions for pixel-perfect client/server rendering",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",