feat(editor): add block meta for more blocks (#11034)

This commit is contained in:
Saul-Mirone
2025-03-20 10:08:01 +00:00
parent 27a8afa33f
commit c1ec17ccba
4 changed files with 40 additions and 14 deletions
@@ -5,11 +5,22 @@ import {
type Text,
} from '@blocksuite/store';
import type { BlockMeta } from '../../utils/types';
export type CalloutProps = {
emoji: string;
text: Text;
} & BlockMeta;
export const CalloutBlockSchema = defineBlockSchema({
flavour: 'affine:callout',
props: internal => ({
props: (internal): CalloutProps => ({
emoji: '😀',
text: internal.Text(),
'meta:createdAt': undefined,
'meta:updatedAt': undefined,
'meta:createdBy': undefined,
'meta:updatedBy': undefined,
}),
metadata: {
version: 1,
@@ -26,11 +37,6 @@ export const CalloutBlockSchema = defineBlockSchema({
toModel: () => new CalloutBlockModel(),
});
export type CalloutProps = {
emoji: string;
text: Text;
};
export class CalloutBlockModel extends BlockModel<CalloutProps> {}
export const CalloutBlockSchemaExtension =