mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-02 14:49:44 +08:00
feat(editor): add block meta for more blocks (#11034)
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user