Feat: make notes on caption (#544)
* add segment model * add note model * db handle segment & note * add notes & segments handler * refactor media caption components * segment & note create * fix type * update note column & may sync * display selected words for note * refactor selected words * auto select words when editing note * refactor * refactor caption component * display notes * refactor notes components * fix * refactor segment & notes into context * destroy note * update locale * fix caption switch issue * fix layout * refactor caption layout * remove deprecated code * may share note * improve UI * fix notes list auto update after created * remove console.log * add notes page * refactor note parameters * refactor components * mark note on transcription * handle no notes * improve style * improve style * show context menu on selection text * fix utils
This commit is contained in:
31
enjoy/src/types/enjoy-app.d.ts
vendored
31
enjoy/src/types/enjoy-app.d.ts
vendored
@@ -267,4 +267,35 @@ type EnjoyAppType = {
|
||||
find: (id: string) => Promise<WaveFormDataType>;
|
||||
save: (id: string, data: WaveFormDataType) => Promise<void>;
|
||||
};
|
||||
segments: {
|
||||
findAll: (params: any) => Promise<SegmentType[]>;
|
||||
find: (id: string) => Promise<SegmentType>;
|
||||
create: (params: {
|
||||
targetId: string;
|
||||
targetType: string;
|
||||
segmentIndex: number;
|
||||
}) => Promise<SegmentType>;
|
||||
sync: (id: string) => Promise<SegmentType>;
|
||||
};
|
||||
notes: {
|
||||
groupByTarget: (params: any) => Promise<any>;
|
||||
groupBySegment: (targetId: string, targetType: string) => Promise<any>;
|
||||
findAll: (params: any) => Promise<NoteType[]>;
|
||||
find: (id: string) => Promise<NoteType>;
|
||||
update: (
|
||||
id: string,
|
||||
params: {
|
||||
content: string;
|
||||
parameters?: any;
|
||||
}
|
||||
) => Promise<NoteType>;
|
||||
delete: (id: string) => Promise<void>;
|
||||
create: (params: {
|
||||
targetId: string;
|
||||
targetType: string;
|
||||
content: string;
|
||||
parameters?: any;
|
||||
}) => Promise<NoteType>;
|
||||
sync: (id: string) => Promise<NoteType>;
|
||||
};
|
||||
};
|
||||
|
||||
14
enjoy/src/types/note.d.ts
vendored
Normal file
14
enjoy/src/types/note.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
type NoteType = {
|
||||
id: string;
|
||||
targetId: string;
|
||||
targetType: string;
|
||||
content: string;
|
||||
parameters: any;
|
||||
syncedAt: Date;
|
||||
uploadedAt: Date;
|
||||
updatedAt: Date;
|
||||
createdAt: Date;
|
||||
segment?: SegmentType;
|
||||
isSynced?: boolean;
|
||||
sync(): Promise<void>;
|
||||
};
|
||||
4
enjoy/src/types/post.d.ts
vendored
4
enjoy/src/types/post.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
type PostType = {
|
||||
id: string;
|
||||
metadata: {
|
||||
type: "text" | "prompt" | "gpt";
|
||||
type: "text" | "prompt" | "gpt" | "note";
|
||||
content:
|
||||
| string
|
||||
| {
|
||||
@@ -11,7 +11,7 @@ type PostType = {
|
||||
user: UserType;
|
||||
targetType?: string;
|
||||
targetId?: string;
|
||||
target?: MediumType | StoryType | RecordingType;
|
||||
target?: MediumType | StoryType | RecordingType | NoteType;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
|
||||
18
enjoy/src/types/segment.d.ts
vendored
Normal file
18
enjoy/src/types/segment.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
type SegmentType = {
|
||||
id: string;
|
||||
targetId: string;
|
||||
targetType: string;
|
||||
caption: TimelineEntry;
|
||||
audio?: AudioType;
|
||||
video?: VideoType;
|
||||
segmentIndex: number;
|
||||
md5: string;
|
||||
caption: TimeLIne;
|
||||
startTime: number;
|
||||
endTime: number;
|
||||
src: string;
|
||||
syncedAt?: Date;
|
||||
uploadedAt?: Date
|
||||
updatedAt: Date
|
||||
createdAt: Date
|
||||
};
|
||||
1
enjoy/src/types/transcription.d.ts
vendored
1
enjoy/src/types/transcription.d.ts
vendored
@@ -2,6 +2,7 @@ type TranscriptionType = {
|
||||
id: string;
|
||||
targetId: string;
|
||||
targetType: string;
|
||||
targetMd5?: string;
|
||||
state: "pending" | "processing" | "finished";
|
||||
engine: string;
|
||||
model: string;
|
||||
|
||||
Reference in New Issue
Block a user