@overlap.ai/react-video-subtitles 1.0.14 → 1.0.16
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/components/SubtitleText.d.ts +2 -0
- package/dist/components/Subtitles.d.ts +2 -0
- package/dist/hooks/fontLoader.d.ts +1 -0
- package/dist/hooks/useAdjustedPhrases.d.ts +10 -0
- package/dist/hooks/useAdjustedPosition.d.ts +4 -0
- package/dist/hooks/useProcessWords.d.ts +3 -0
- package/dist/hooks/useStyleConfig.d.ts +2 -0
- package/dist/hooks/useTextStyle.d.ts +42 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.esm.js +16623 -0
- package/dist/index.js +16631 -0
- package/dist/test/TestComponent.d.ts +1 -0
- package/dist/test/components/FullScreenPreset.d.ts +1 -0
- package/dist/test/components/GridView.d.ts +1 -0
- package/dist/test/components/NewPreset.d.ts +1 -0
- package/dist/test/components/PresetTest.d.ts +1 -0
- package/dist/test/components/SmallTest.d.ts +1 -0
- package/dist/test/components/SwitchableTest.d.ts +1 -0
- package/dist/test/components/controls/ColorPicker.d.ts +7 -0
- package/dist/test/components/controls/Select.d.ts +8 -0
- package/dist/test/components/controls/Slider.d.ts +10 -0
- package/dist/test/components/controls/Switch.d.ts +7 -0
- package/dist/test/constants/testWords.d.ts +5 -0
- package/dist/test/hooks/useAnimationFrame.d.ts +4 -0
- package/dist/test/main.d.ts +1 -0
- package/dist/test/styles/common.d.ts +7 -0
- package/dist/test/utils/loadSubtitlePresets.d.ts +1 -0
- package/dist/types/components.d.ts +19 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/subtitles.d.ts +88 -0
- package/dist/utils/findPhrasesInRange.d.ts +2 -0
- package/dist/utils/loadSubtitlePreset.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TestComponent: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FullScreenPreset: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GridView: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NewPreset: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PresetTest: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SmallTest: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SwitchableTest: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface SliderProps {
|
|
2
|
+
label: string;
|
|
3
|
+
value: number;
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
onChange: (value: number) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Slider: ({ label, value, min, max, step, onChange }: SliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadSubtitlePresets: () => Promise<any[]>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleConfig } from './subtitles';
|
|
3
|
+
export interface SubtitleTextProps {
|
|
4
|
+
text: string;
|
|
5
|
+
style: StyleConfig;
|
|
6
|
+
frame: number;
|
|
7
|
+
startFrame: number;
|
|
8
|
+
words?: Array<{
|
|
9
|
+
word: string;
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
}>;
|
|
13
|
+
fps: number;
|
|
14
|
+
animationStyle?: string;
|
|
15
|
+
randomColors?: StyleConfig['randomColors'];
|
|
16
|
+
highlightWords?: string[];
|
|
17
|
+
highlightWordsColor?: string;
|
|
18
|
+
}
|
|
19
|
+
export type SubtitleComponent = React.ComponentType<SubtitleTextProps> | React.MemoExoticComponent<React.ComponentType<SubtitleTextProps>>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export interface SegmentWord {
|
|
2
|
+
text: string;
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Phrase {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
text: string;
|
|
10
|
+
words: SegmentWord[];
|
|
11
|
+
startFrame?: number;
|
|
12
|
+
durationInFrames?: number;
|
|
13
|
+
subType?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface StyleConfig {
|
|
16
|
+
name: string;
|
|
17
|
+
captionPosition: "bottom" | "middle";
|
|
18
|
+
amplifiedColor: string;
|
|
19
|
+
amplifiedOpacity?: number;
|
|
20
|
+
amplifySpokenWords: boolean;
|
|
21
|
+
fontFamily: string;
|
|
22
|
+
fontWeight: string;
|
|
23
|
+
fontColor: string;
|
|
24
|
+
fontSize: string;
|
|
25
|
+
textCase: string;
|
|
26
|
+
outlineColor: string;
|
|
27
|
+
outlineWidth: string;
|
|
28
|
+
outlineStyle?: string;
|
|
29
|
+
shadowColor: string;
|
|
30
|
+
shadowBlur: string;
|
|
31
|
+
shadowOffsetX: string;
|
|
32
|
+
shadowOffsetY: string;
|
|
33
|
+
shadowEnabled?: boolean;
|
|
34
|
+
shadowIntensity?: number;
|
|
35
|
+
backgroundColor?: string;
|
|
36
|
+
backgroundOpacity?: number;
|
|
37
|
+
backgroundPadding?: string | number;
|
|
38
|
+
backgroundPaddingX?: string | number;
|
|
39
|
+
backgroundPaddingY?: string | number;
|
|
40
|
+
backgroundBorderRadius?: string | number;
|
|
41
|
+
backgroundFillStyle?: "wrap" | "none";
|
|
42
|
+
textSpacing?: string | number;
|
|
43
|
+
animationStyle?: string;
|
|
44
|
+
isItalic?: boolean;
|
|
45
|
+
shinyWordHighlight?: boolean;
|
|
46
|
+
shinySegmentHighlight?: boolean;
|
|
47
|
+
verticalStretch?: string | number;
|
|
48
|
+
opacity?: number;
|
|
49
|
+
textHighlightPersists?: boolean;
|
|
50
|
+
currentWordBlock?: boolean;
|
|
51
|
+
currentWordBlockBorderRadius?: string | number;
|
|
52
|
+
currentWordBlockBackgroundColor?: string;
|
|
53
|
+
currentWordBlockOpacity?: number;
|
|
54
|
+
currentWordBlockPadding?: string | number;
|
|
55
|
+
amplifyOpacityTransitionDuration?: number;
|
|
56
|
+
randomColors?: {
|
|
57
|
+
enabled?: boolean | string;
|
|
58
|
+
colors?: Array<{
|
|
59
|
+
type: string;
|
|
60
|
+
color: string;
|
|
61
|
+
}>;
|
|
62
|
+
avoidFillers?: boolean;
|
|
63
|
+
pctApplied?: number;
|
|
64
|
+
randomWordCountRange?: [number, number];
|
|
65
|
+
};
|
|
66
|
+
amplifiedColors?: Array<{
|
|
67
|
+
type: string;
|
|
68
|
+
colors: string[];
|
|
69
|
+
angle?: number;
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
export interface SubtitlesProps {
|
|
73
|
+
words: SegmentWord[];
|
|
74
|
+
maxCharsPerLine?: number;
|
|
75
|
+
styleConfig: StyleConfig;
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
currentFrame: number;
|
|
79
|
+
currentTime: number;
|
|
80
|
+
fps: number;
|
|
81
|
+
startTime?: number;
|
|
82
|
+
endTime?: number;
|
|
83
|
+
highlightWords?: string[];
|
|
84
|
+
highlightWordsColor?: string;
|
|
85
|
+
width: number;
|
|
86
|
+
height: number;
|
|
87
|
+
devMode?: boolean;
|
|
88
|
+
}
|