mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-23 17:32:48 +08:00
refactor(editor): file size limit service (#12026)
Closes: [BS-3359](https://linear.app/affine-design/issue/BS-3359/重构-filesizelimitservice-支持-handle-文件超出限制) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added an "Upgrade" button to attachment blocks that appears when file size limits are exceeded, enabling users to view storage plans and upgrade. - **Refactor** - Unified file size limit handling across attachments and images for consistency. - Redesigned file size limit service with improved integration and dependency injection. - **Chores** - Updated service registrations and dependency management for file size limit enforcement. - Integrated a new file size limit extension that triggers storage plan dialogs and tracking events on limit exceedance. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -15,7 +15,6 @@ import { HighlightSelectionExtension } from '@blocksuite/affine-shared/selection
|
||||
import {
|
||||
BlockMetaService,
|
||||
FeatureFlagService,
|
||||
FileSizeLimitService,
|
||||
LinkPreviewerService,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import {
|
||||
@@ -51,7 +50,6 @@ export class FoundationStoreExtension extends StoreExtensionProvider {
|
||||
BlockMetaService,
|
||||
// TODO(@mirone): maybe merge these services into a file setting service
|
||||
LinkPreviewerService,
|
||||
FileSizeLimitService,
|
||||
ImageProxyService,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
DocModeService,
|
||||
EditPropsStore,
|
||||
EmbedOptionService,
|
||||
FileSizeLimitService,
|
||||
FontLoaderService,
|
||||
PageViewportServiceExtension,
|
||||
ThemeService,
|
||||
@@ -109,6 +110,7 @@ export class FoundationViewExtension extends ViewExtensionProvider {
|
||||
FileDropExtension,
|
||||
ToolbarRegistryExtension,
|
||||
AutoClearSelectionService,
|
||||
FileSizeLimitService,
|
||||
]);
|
||||
context.register(clipboardConfigs);
|
||||
if (this.isEdgeless(context.scope)) {
|
||||
|
||||
Reference in New Issue
Block a user