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:
@@ -33,7 +33,7 @@ export const CalloutBlockSchema = defineBlockSchema({
|
|||||||
'affine:edgeless-text',
|
'affine:edgeless-text',
|
||||||
'affine:transcription',
|
'affine:transcription',
|
||||||
],
|
],
|
||||||
children: ['affine:paragraph'],
|
children: ['affine:paragraph', 'affine:list'],
|
||||||
},
|
},
|
||||||
toModel: () => new CalloutBlockModel(),
|
toModel: () => new CalloutBlockModel(),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export const ListBlockSchema = defineBlockSchema({
|
|||||||
'affine:list',
|
'affine:list',
|
||||||
'affine:paragraph',
|
'affine:paragraph',
|
||||||
'affine:edgeless-text',
|
'affine:edgeless-text',
|
||||||
|
'affine:callout',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
toModel: () => new ListBlockModel(),
|
toModel: () => new ListBlockModel(),
|
||||||
|
|||||||
@@ -172,7 +172,11 @@ export class AudioAttachmentBlock extends Entity<AttachmentBlockModel> {
|
|||||||
) => {
|
) => {
|
||||||
this.props.props.caption = result.title ?? '';
|
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(
|
const calloutId = this.props.doc.addBlock(
|
||||||
'affine:callout',
|
'affine:callout',
|
||||||
{
|
{
|
||||||
@@ -184,6 +188,7 @@ export class AudioAttachmentBlock extends Entity<AttachmentBlockModel> {
|
|||||||
'affine:paragraph',
|
'affine:paragraph',
|
||||||
{
|
{
|
||||||
type: 'h6',
|
type: 'h6',
|
||||||
|
collapsed,
|
||||||
text: new Text([
|
text: new Text([
|
||||||
{
|
{
|
||||||
insert: title,
|
insert: title,
|
||||||
@@ -195,7 +200,7 @@ export class AudioAttachmentBlock extends Entity<AttachmentBlockModel> {
|
|||||||
return calloutId;
|
return calloutId;
|
||||||
};
|
};
|
||||||
const fillTranscription = (segments: TranscriptionResult['segments']) => {
|
const fillTranscription = (segments: TranscriptionResult['segments']) => {
|
||||||
const calloutId = addCalloutBlock('💬', 'Transcript');
|
const calloutId = addCalloutBlock('💬', 'Transcript', true);
|
||||||
|
|
||||||
const speakerToColors = new Map<string, string>();
|
const speakerToColors = new Map<string, string>();
|
||||||
for (const segment of segments) {
|
for (const segment of segments) {
|
||||||
|
|||||||
Reference in New Issue
Block a user