mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 03:26:47 +08:00
27 lines
670 B
TypeScript
27 lines
670 B
TypeScript
import {
|
|
type ParagraphBlockModel,
|
|
ParagraphBlockSchema,
|
|
} from '@blocksuite/affine-model';
|
|
import { BlockService } from '@blocksuite/block-std';
|
|
|
|
export class ParagraphBlockService extends BlockService {
|
|
static override readonly flavour = ParagraphBlockSchema.model.flavour;
|
|
|
|
placeholderGenerator: (model: ParagraphBlockModel) => string = model => {
|
|
if (model.type === 'text') {
|
|
return "Type '/' for commands";
|
|
}
|
|
|
|
const placeholders = {
|
|
h1: 'Heading 1',
|
|
h2: 'Heading 2',
|
|
h3: 'Heading 3',
|
|
h4: 'Heading 4',
|
|
h5: 'Heading 5',
|
|
h6: 'Heading 6',
|
|
quote: '',
|
|
};
|
|
return placeholders[model.type];
|
|
};
|
|
}
|