Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): transcription block styls (#11772)

pengx1775df27a14541
diff --git a/blocksuite/affine/model/src/blocks/callout/callout-model.ts b/blocksuite/affine/model/src/blocks/callout/callout-model.ts
index f68b88c580..aa7591e4f0 100644
--- a/blocksuite/affine/model/src/blocks/callout/callout-model.ts
+++ b/blocksuite/affine/model/src/blocks/callout/callout-model.ts
@@ -33,7 +33,7 @@ export const CalloutBlockSchema = defineBlockSchema({
'affine:edgeless-text',
'affine:transcription',
],
- children: ['affine:paragraph'],
+ children: ['affine:paragraph', 'affine:list'],
},
toModel: () => new CalloutBlockModel(),
});
diff --git a/blocksuite/affine/model/src/blocks/list/list-model.ts b/blocksuite/affine/model/src/blocks/list/list-model.ts
index 9f92bd7b6e..70dbbf4657 100644
--- a/blocksuite/affine/model/src/blocks/list/list-model.ts
+++ b/blocksuite/affine/model/src/blocks/list/list-model.ts
@@ -43,6 +43,7 @@ export const ListBlockSchema = defineBlockSchema({
'affine:list',
'affine:paragraph',
'affine:edgeless-text',
+ 'affine:callout',
],
},
toModel: () => new ListBlockModel(),
diff --git a/packages/frontend/core/src/modules/media/entities/audio-attachment-block.ts b/packages/frontend/core/src/modules/media/entities/audio-attachment-block.ts
index 45bbf37bfa..2bbd810daf 100644
--- a/packages/frontend/core/src/modules/media/entities/audio-attachment-block.ts
+++ b/packages/frontend/core/src/modules/media/entities/audio-attachment-block.ts
@@ -172,7 +172,11 @@ export class AudioAttachmentBlock extends Entity<AttachmentBlockModel> {
) => {
this.props.props.caption = result.title ?? '';
- const addCalloutBlock = (emoji: string, title: string) => {
+ const addCalloutBlock = (
+ emoji: string,
+ title: string,
+ collapsed: boolean = false
+ ) => {
const calloutId = this.props.doc.addBlock(
'affine:callout',
{
@@ -184,6 +188,7 @@ export class AudioAttachmentBlock extends Entity<AttachmentBlockModel> {
'affine:paragraph',
{
type: 'h6',
+ collapsed,
text: new Text([
{
insert: title,
@@ -195,7 +200,7 @@ export class AudioAttachmentBlock extends Entity<AttachmentBlockModel> {
return calloutId;
};
const fillTranscription = (segments: TranscriptionResult['segments']) => {
- const calloutId = addCalloutBlock('💬', 'Transcript');
+ const calloutId = addCalloutBlock('💬', 'Transcript', true);
const speakerToColors = new Map<string, string>();
for (const segment of segments) {