mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 05:14:54 +00:00
feat(editor): audio block (#10947)
AudioMedia entity for loading & controlling a single audio media AudioMediaManagerService: Global audio state synchronization across tabs AudioAttachmentService + AudioAttachmentBlock for manipulating AttachmentBlock in affine - e.g., filling transcription (using mock endpoint for now) Added AudioBlock + AudioPlayer for rendering audio block in affine (new transcription block whose renderer is provided in affine) fix AF-2292 fix AF-2337
This commit is contained in:
@@ -89,6 +89,7 @@ export const AttachmentBlockSchema = defineBlockSchema({
|
||||
'affine:paragraph',
|
||||
'affine:list',
|
||||
],
|
||||
children: ['@attachment-viewer'],
|
||||
},
|
||||
transformer: transformerConfigs =>
|
||||
new AttachmentBlockTransformer(transformerConfigs),
|
||||
|
||||
@@ -31,6 +31,7 @@ export const CalloutBlockSchema = defineBlockSchema({
|
||||
'affine:paragraph',
|
||||
'affine:list',
|
||||
'affine:edgeless-text',
|
||||
'affine:transcription',
|
||||
],
|
||||
children: ['affine:paragraph'],
|
||||
},
|
||||
|
||||
@@ -15,3 +15,4 @@ export * from './paragraph/index.js';
|
||||
export * from './root/index.js';
|
||||
export * from './surface-ref/index.js';
|
||||
export * from './table';
|
||||
export * from './transcription';
|
||||
|
||||
@@ -44,6 +44,7 @@ export const ParagraphBlockSchema = defineBlockSchema({
|
||||
'affine:list',
|
||||
'affine:edgeless-text',
|
||||
'affine:callout',
|
||||
'affine:transcription',
|
||||
],
|
||||
},
|
||||
toModel: () => new ParagraphBlockModel(),
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * from './transcription-model.js';
|
||||
@@ -0,0 +1,33 @@
|
||||
import {
|
||||
BlockModel,
|
||||
BlockSchemaExtension,
|
||||
defineBlockSchema,
|
||||
} from '@blocksuite/store';
|
||||
|
||||
export const TranscriptionBlockFlavour = 'affine:transcription';
|
||||
|
||||
export const TranscriptionBlockSchema = defineBlockSchema({
|
||||
flavour: TranscriptionBlockFlavour,
|
||||
props: () => ({
|
||||
transcription: {},
|
||||
jobId: '',
|
||||
}),
|
||||
metadata: {
|
||||
version: 1,
|
||||
role: 'attachment-viewer',
|
||||
parent: ['affine:attachment'],
|
||||
children: ['affine:callout'],
|
||||
},
|
||||
toModel: () => new TranscriptionBlockModel(),
|
||||
});
|
||||
|
||||
export type TranscriptionBlockProps = {
|
||||
transcription: Record<string, any>;
|
||||
jobId: string;
|
||||
};
|
||||
|
||||
export class TranscriptionBlockModel extends BlockModel<TranscriptionBlockProps> {}
|
||||
|
||||
export const TranscriptionBlockSchemaExtension = BlockSchemaExtension(
|
||||
TranscriptionBlockSchema
|
||||
);
|
||||
Reference in New Issue
Block a user