mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-08 04:36:13 +08:00
dbf0f9dc20
Closes: [BS-2553](https://linear.app/affine-design/issue/BS-2553/remove-global-types-in-edgeless)
40 lines
831 B
TypeScript
40 lines
831 B
TypeScript
import {
|
|
type GfxCommonBlockProps,
|
|
GfxCompatible,
|
|
type GfxElementGeometry,
|
|
} from '@blocksuite/block-std/gfx';
|
|
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
|
|
|
|
export type LatexProps = {
|
|
latex: string;
|
|
} & GfxCommonBlockProps;
|
|
|
|
export const LatexBlockSchema = defineBlockSchema({
|
|
flavour: 'affine:latex',
|
|
props: (): LatexProps => ({
|
|
xywh: '[0,0,16,16]',
|
|
index: 'a0',
|
|
lockedBySelf: false,
|
|
scale: 1,
|
|
rotate: 0,
|
|
latex: '',
|
|
}),
|
|
metadata: {
|
|
version: 1,
|
|
role: 'content',
|
|
parent: [
|
|
'affine:note',
|
|
'affine:edgeless-text',
|
|
'affine:paragraph',
|
|
'affine:list',
|
|
],
|
|
},
|
|
toModel: () => {
|
|
return new LatexBlockModel();
|
|
},
|
|
});
|
|
|
|
export class LatexBlockModel
|
|
extends GfxCompatible<LatexProps>(BlockModel)
|
|
implements GfxElementGeometry {}
|