mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-24 13:17:10 +08:00
refactor(editor): cleanup dead code (#12281)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Streamlined and consolidated block and inline extension exports by removing multiple block-spec and inline extension arrays from public APIs. - Reduced exported constants, types, and utility functions related to various block and embed features. - Simplified the codebase by removing deprecated type guards, adapter extensions, and redundant extension groupings. - **Chores** - Cleaned up internal APIs by deleting unused exports, imports, and outdated code, enhancing maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -2,6 +2,5 @@ export * from './adapters/index.js';
|
||||
export * from './commands';
|
||||
export * from './paragraph-block.js';
|
||||
export * from './paragraph-block-config.js';
|
||||
export * from './paragraph-spec.js';
|
||||
export * from './turbo/paragraph-layout-handler';
|
||||
export * from './turbo/paragraph-painter.worker';
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
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();
|
||||
Reference in New Issue
Block a user