mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-26 02:35:58 +08:00
refactor(editor): move transcription block model to ai (#12010)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Updated and reorganized import paths for transcription block models and types to improve module structure and maintainability. - **Chores** - Removed deprecated transcription block schema and related exports from core libraries. - Registered transcription block schema directly within the workspace schema for improved schema management. - **Bug Fixes** - Ensured consistent registration and availability of transcription block features across relevant modules. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -15,4 +15,3 @@ export * from './paragraph/index.js';
|
||||
export * from './root/index.js';
|
||||
export * from './surface-ref/index.js';
|
||||
export * from './table';
|
||||
export * from './transcription';
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export * from './transcription-model.js';
|
||||
@@ -1,37 +0,0 @@
|
||||
import {
|
||||
BlockModel,
|
||||
BlockSchemaExtension,
|
||||
defineBlockSchema,
|
||||
} from '@blocksuite/store';
|
||||
|
||||
export const TranscriptionBlockFlavour = 'affine:transcription';
|
||||
|
||||
const defaultProps: TranscriptionBlockProps = {
|
||||
transcription: {},
|
||||
jobId: undefined,
|
||||
createdBy: undefined, // the user id of the creator
|
||||
};
|
||||
|
||||
export const TranscriptionBlockSchema = defineBlockSchema({
|
||||
flavour: TranscriptionBlockFlavour,
|
||||
props: () => defaultProps,
|
||||
metadata: {
|
||||
version: 1,
|
||||
role: 'attachment-viewer',
|
||||
parent: ['affine:attachment'],
|
||||
children: ['affine:callout'],
|
||||
},
|
||||
toModel: () => new TranscriptionBlockModel(),
|
||||
});
|
||||
|
||||
export type TranscriptionBlockProps = {
|
||||
transcription: Record<string, any>;
|
||||
jobId?: string;
|
||||
createdBy?: string;
|
||||
};
|
||||
|
||||
export class TranscriptionBlockModel extends BlockModel<TranscriptionBlockProps> {}
|
||||
|
||||
export const TranscriptionBlockSchemaExtension = BlockSchemaExtension(
|
||||
TranscriptionBlockSchema
|
||||
);
|
||||
Reference in New Issue
Block a user