mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
**Directory Structure Changes** - Renamed multiple block-related directories by removing the "block-" prefix: - `block-attachment` → `attachment` - `block-bookmark` → `bookmark` - `block-callout` → `callout` - `block-code` → `code` - `block-data-view` → `data-view` - `block-database` → `database` - `block-divider` → `divider` - `block-edgeless-text` → `edgeless-text` - `block-embed` → `embed`
35 lines
1006 B
TypeScript
35 lines
1006 B
TypeScript
import { BlockViewExtension, FlavourExtension } from '@blocksuite/std';
|
|
import type { ExtensionType } from '@blocksuite/store';
|
|
import { literal } from 'lit/static-html.js';
|
|
|
|
import { ParagraphBlockAdapterExtensions } from './adapters/extension.js';
|
|
import { ParagraphBlockConfigExtension } from './paragraph-block-config.js';
|
|
import {
|
|
ParagraphKeymapExtension,
|
|
ParagraphTextKeymapExtension,
|
|
} from './paragraph-keymap.js';
|
|
|
|
const placeholders = {
|
|
text: "Type '/' for commands",
|
|
h1: 'Heading 1',
|
|
h2: 'Heading 2',
|
|
h3: 'Heading 3',
|
|
h4: 'Heading 4',
|
|
h5: 'Heading 5',
|
|
h6: 'Heading 6',
|
|
quote: '',
|
|
};
|
|
|
|
export const ParagraphBlockSpec: ExtensionType[] = [
|
|
FlavourExtension('affine:paragraph'),
|
|
BlockViewExtension('affine:paragraph', literal`affine-paragraph`),
|
|
ParagraphTextKeymapExtension,
|
|
ParagraphKeymapExtension,
|
|
ParagraphBlockAdapterExtensions,
|
|
ParagraphBlockConfigExtension({
|
|
getPlaceholder: model => {
|
|
return placeholders[model.props.type];
|
|
},
|
|
}),
|
|
].flat();
|