@twick/studio 0.14.11 → 0.14.13
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/container/properties-panel-container.d.ts +6 -2
- package/dist/components/properties/generate-subtitles.d.ts +13 -0
- package/dist/helpers/generate-subtitles.service.d.ts +21 -0
- package/dist/hooks/use-generate-subtitles.d.ts +9 -0
- package/dist/hooks/use-studio-operation.d.ts +5 -1
- package/dist/index.d.ts +22 -13
- package/dist/index.js +445 -86
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +445 -86
- package/dist/index.mjs.map +1 -1
- package/dist/studio.css +60 -0
- package/dist/types/index.d.ts +54 -1
- package/package.json +8 -8
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { TrackElement } from '@twick/timeline';
|
|
1
|
+
import { VideoElement, TrackElement } from '@twick/timeline';
|
|
2
|
+
import { ISubtitleGenerationPollingResponse, SubtitleEntry } from '../../types';
|
|
2
3
|
|
|
3
4
|
interface PropertiesPanelContainerProps {
|
|
4
5
|
selectedProp: string;
|
|
5
6
|
selectedElement: TrackElement | null;
|
|
6
7
|
updateElement: (element: TrackElement) => void;
|
|
8
|
+
addSubtitlesToTimeline: (subtitles: SubtitleEntry[]) => void;
|
|
9
|
+
onGenerateSubtitles: (videoElement: VideoElement) => Promise<string | null>;
|
|
10
|
+
getSubtitleStatus: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
|
|
7
11
|
}
|
|
8
|
-
export declare function PropertiesPanelContainer({ selectedProp, selectedElement, updateElement, }: PropertiesPanelContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function PropertiesPanelContainer({ selectedProp, selectedElement, updateElement, addSubtitlesToTimeline, onGenerateSubtitles, getSubtitleStatus, }: PropertiesPanelContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
13
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TrackElement, VideoElement } from '@twick/timeline';
|
|
2
|
+
import { ISubtitleGenerationPollingResponse } from '../../types';
|
|
3
|
+
|
|
4
|
+
export declare function GenerateSubtitlesPanel({ selectedElement, addSubtitlesToTimeline, onGenerateSubtitles, getSubtitleStatus, }: {
|
|
5
|
+
selectedElement: TrackElement;
|
|
6
|
+
addSubtitlesToTimeline: (subtitles: {
|
|
7
|
+
s: number;
|
|
8
|
+
e: number;
|
|
9
|
+
t: string;
|
|
10
|
+
}[]) => void;
|
|
11
|
+
onGenerateSubtitles: (videoElement: VideoElement) => Promise<string | null>;
|
|
12
|
+
getSubtitleStatus: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ProjectJSON, VideoElement } from '@twick/timeline';
|
|
2
|
+
import { ISubtitleGenerationPollingResponse, ISubtitleGenerationService, SubtitleEntry } from '../types';
|
|
3
|
+
|
|
4
|
+
declare class GenerateSubtitlesService implements ISubtitleGenerationService {
|
|
5
|
+
videoElement: VideoElement | null;
|
|
6
|
+
projectJSON: ProjectJSON | null;
|
|
7
|
+
generateSubtiltesApi: (videoUrl: string) => Promise<string>;
|
|
8
|
+
requestStatusApi: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
|
|
9
|
+
constructor({ generateSubtiltesApi, requestStatusApi, }: {
|
|
10
|
+
generateSubtiltesApi: (videoUrl: string) => Promise<string>;
|
|
11
|
+
requestStatusApi: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
|
|
12
|
+
});
|
|
13
|
+
generateSubtitles(videoElement: VideoElement, projectJSON: ProjectJSON): Promise<string>;
|
|
14
|
+
getRequestStatus(reqId: string): Promise<ISubtitleGenerationPollingResponse>;
|
|
15
|
+
updateProjectWithSubtitles(subtitles: SubtitleEntry[]): ProjectJSON;
|
|
16
|
+
generateSubtitleVideo(videoUrl: string, videoSize?: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}): Promise<string>;
|
|
20
|
+
}
|
|
21
|
+
export default GenerateSubtitlesService;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VideoElement } from '@twick/timeline';
|
|
2
|
+
import { ISubtitleGenerationPollingResponse, StudioConfig, SubtitleEntry } from '../types';
|
|
3
|
+
|
|
4
|
+
declare const useGenerateSubtitles: (studioConfig?: StudioConfig) => {
|
|
5
|
+
onGenerateSubtitles: (videoElement: VideoElement) => Promise<string | null>;
|
|
6
|
+
addSubtitlesToTimeline: (subtitles: SubtitleEntry[]) => void;
|
|
7
|
+
getSubtitleStatus: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
|
|
8
|
+
};
|
|
9
|
+
export default useGenerateSubtitles;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VideoElement } from '@twick/timeline';
|
|
2
|
+
import { ISubtitleGenerationPollingResponse, StudioConfig, SubtitleEntry } from '../types';
|
|
2
3
|
|
|
3
4
|
declare const useStudioOperation: (studioConfig?: StudioConfig) => {
|
|
4
5
|
onLoadProject: () => Promise<void>;
|
|
5
6
|
onSaveProject: () => Promise<void>;
|
|
6
7
|
onExportVideo: () => Promise<void>;
|
|
8
|
+
onGenerateSubtitles: (videoElement: VideoElement) => Promise<string | null>;
|
|
9
|
+
addSubtitlesToTimeline: (subtitles: SubtitleEntry[]) => void;
|
|
10
|
+
getSubtitleStatus: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
|
|
7
11
|
};
|
|
8
12
|
export default useStudioOperation;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TwickStudio } from './components/twick-studio';
|
|
2
2
|
import { Toolbar } from './components/toolbar';
|
|
3
3
|
import { useStudioManager } from './hooks/use-studio-manager';
|
|
4
|
+
import { default as useGenerateSubtitles } from './hooks/use-generate-subtitles';
|
|
4
5
|
import { default as StudioHeader } from './components/header';
|
|
5
6
|
import { AudioPanel } from './components/panel/audio-panel';
|
|
6
7
|
import { VideoPanel } from './components/panel/video-panel';
|
|
@@ -12,30 +13,38 @@ import { IconPanel } from './components/panel/icon-panel';
|
|
|
12
13
|
import { SubtitlesPanel } from './components/panel/subtitles-panel';
|
|
13
14
|
|
|
14
15
|
export {
|
|
15
|
-
/** Main studio
|
|
16
|
+
/** Main studio editing environment */
|
|
16
17
|
TwickStudio,
|
|
17
|
-
/**
|
|
18
|
+
/** Editing tool/mode selector */
|
|
18
19
|
Toolbar,
|
|
19
|
-
/** Studio
|
|
20
|
+
/** Studio top bar with controls */
|
|
20
21
|
StudioHeader, };
|
|
21
22
|
export {
|
|
22
|
-
/**
|
|
23
|
+
/** Panel for audio assets */
|
|
23
24
|
AudioPanel,
|
|
24
|
-
/**
|
|
25
|
+
/** Panel for video assets */
|
|
25
26
|
VideoPanel,
|
|
26
|
-
/**
|
|
27
|
+
/** Panel for image assets */
|
|
27
28
|
ImagePanel,
|
|
28
|
-
/**
|
|
29
|
+
/** Panel for editing/add text elements */
|
|
29
30
|
TextPanel,
|
|
30
|
-
/**
|
|
31
|
+
/** Panel for subtitle/caption management */
|
|
31
32
|
SubtitlesPanel,
|
|
32
|
-
/**
|
|
33
|
+
/** Panel for adding circles */
|
|
33
34
|
CirclePanel,
|
|
34
|
-
/**
|
|
35
|
+
/** Panel for adding rectangles */
|
|
35
36
|
RectPanel,
|
|
36
|
-
/**
|
|
37
|
+
/** Panel for icon assets */
|
|
37
38
|
IconPanel, };
|
|
38
39
|
export {
|
|
39
|
-
/**
|
|
40
|
-
useStudioManager,
|
|
40
|
+
/** Hook for managing studio state and selections */
|
|
41
|
+
useStudioManager,
|
|
42
|
+
/** Hook for polling-based subtitle generation */
|
|
43
|
+
useGenerateSubtitles, };
|
|
44
|
+
export * from './helpers/generate-subtitles.service';
|
|
45
|
+
export * from './helpers/constant';
|
|
46
|
+
export * from './types';
|
|
47
|
+
/**
|
|
48
|
+
* Default export: TwickStudio (full editor component)
|
|
49
|
+
*/
|
|
41
50
|
export default TwickStudio;
|