chore: merge blocksuite source code (#9213)

This commit is contained in:
Mirone
2024-12-20 15:38:06 +08:00
committed by GitHub
parent 2c9ef916f4
commit 30200ff86d
2031 changed files with 238888 additions and 229 deletions
@@ -0,0 +1 @@
export * from './list-model.js';
@@ -0,0 +1,48 @@
import type { SchemaToModel, Text } from '@blocksuite/store';
import { defineBlockSchema } from '@blocksuite/store';
// `toggle` type has been deprecated, do not use it
export type ListType = 'bulleted' | 'numbered' | 'todo' | 'toggle';
export interface ListProps {
type: ListType;
text: Text;
checked: boolean;
collapsed: boolean;
order: number | null;
}
export const ListBlockSchema = defineBlockSchema({
flavour: 'affine:list',
props: internal =>
({
type: 'bulleted',
text: internal.Text(),
checked: false,
collapsed: false,
// number type only for numbered list
order: null,
}) as ListProps,
metadata: {
version: 1,
role: 'content',
parent: [
'affine:note',
'affine:database',
'affine:list',
'affine:paragraph',
'affine:edgeless-text',
],
},
});
export type ListBlockModel = SchemaToModel<typeof ListBlockSchema>;
declare global {
namespace BlockSuite {
interface BlockModels {
'affine:list': ListBlockModel;
}
}
}