mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
refactor(editor): cleanup dead code (#9300)
This commit is contained in:
@@ -7,6 +7,7 @@ import { AIChatBlockSpec } from '@affine/core/blocksuite/presets/blocks/ai-chat-
|
||||
import type { ExtensionType } from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
AdapterFactoryExtensions,
|
||||
AttachmentBlockSpec,
|
||||
BookmarkBlockSpec,
|
||||
CodeBlockSpec,
|
||||
DatabaseBlockSpec,
|
||||
@@ -28,8 +29,6 @@ import {
|
||||
RichTextExtensions,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
|
||||
import { CustomAttachmentBlockSpec } from './custom/attachment-block';
|
||||
|
||||
const CommonBlockSpecs: ExtensionType[] = [
|
||||
RefNodeSlotsExtension(),
|
||||
EditPropsStore,
|
||||
@@ -47,8 +46,8 @@ const CommonBlockSpecs: ExtensionType[] = [
|
||||
EmbedHtmlBlockSpec,
|
||||
EmbedSyncedDocBlockSpec,
|
||||
EmbedLinkedDocBlockSpec,
|
||||
AttachmentBlockSpec,
|
||||
// special
|
||||
CustomAttachmentBlockSpec,
|
||||
AdapterFactoryExtensions,
|
||||
].flat();
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import {
|
||||
BlockFlavourIdentifier,
|
||||
BlockServiceIdentifier,
|
||||
type ExtensionType,
|
||||
StdIdentifier,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
AttachmentBlockService,
|
||||
AttachmentBlockSpec,
|
||||
ImageBlockService,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
|
||||
// bytes.parse('2GB')
|
||||
const MAX_FILE_SIZE = 2147483648;
|
||||
|
||||
class CustomAttachmentBlockService extends AttachmentBlockService {
|
||||
override mounted(): void {
|
||||
// blocksuite default max file size is 10MB, we override it to 2GB
|
||||
// but the real place to limit blob size is CloudQuotaModal / LocalQuotaModal
|
||||
this.maxFileSize = MAX_FILE_SIZE;
|
||||
super.mounted();
|
||||
}
|
||||
}
|
||||
|
||||
class CustomImageBlockService extends ImageBlockService {
|
||||
override mounted(): void {
|
||||
// blocksuite default max file size is 10MB, we override it to 2GB
|
||||
// but the real place to limit blob size is CloudQuotaModal / LocalQuotaModal
|
||||
this.maxFileSize = MAX_FILE_SIZE;
|
||||
super.mounted();
|
||||
}
|
||||
}
|
||||
|
||||
export const CustomAttachmentBlockSpec: ExtensionType[] = [
|
||||
...AttachmentBlockSpec,
|
||||
{
|
||||
setup: di => {
|
||||
di.override(
|
||||
BlockServiceIdentifier('affine:attachment'),
|
||||
CustomAttachmentBlockService,
|
||||
[StdIdentifier, BlockFlavourIdentifier('affine:attachment')]
|
||||
);
|
||||
di.override(
|
||||
BlockServiceIdentifier('affine:image'),
|
||||
CustomImageBlockService,
|
||||
[StdIdentifier, BlockFlavourIdentifier('affine:image')]
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user