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

1. collapsed transcript block by default
2. summary block should be able to have list paragraphs
This commit is contained in:
pengx17
2025-04-17 12:41:52 +00:00
parent a46bb446e2
commit 75df27a145
3 changed files with 9 additions and 3 deletions

View File

@@ -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) {