mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
0f87136fd7
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 -->
57 lines
1.6 KiB
TypeScript
57 lines
1.6 KiB
TypeScript
import {
|
|
type StoreExtensionContext,
|
|
StoreExtensionProvider,
|
|
} from '@blocksuite/affine-ext-loader';
|
|
import {
|
|
HtmlAdapterFactoryExtension,
|
|
ImageProxyService,
|
|
MarkdownAdapterFactoryExtension,
|
|
MixTextAdapterFactoryExtension,
|
|
NotionHtmlAdapterFactoryExtension,
|
|
NotionTextAdapterFactoryExtension,
|
|
PlainTextAdapterFactoryExtension,
|
|
} from '@blocksuite/affine-shared/adapters';
|
|
import { HighlightSelectionExtension } from '@blocksuite/affine-shared/selection';
|
|
import {
|
|
BlockMetaService,
|
|
FeatureFlagService,
|
|
LinkPreviewerService,
|
|
} from '@blocksuite/affine-shared/services';
|
|
import {
|
|
BlockSelectionExtension,
|
|
CursorSelectionExtension,
|
|
SurfaceSelectionExtension,
|
|
TextSelectionExtension,
|
|
} from '@blocksuite/std';
|
|
|
|
export class FoundationStoreExtension extends StoreExtensionProvider {
|
|
override name = 'foundation';
|
|
|
|
override setup(context: StoreExtensionContext) {
|
|
super.setup(context);
|
|
context.register([
|
|
// predefined selections
|
|
BlockSelectionExtension,
|
|
TextSelectionExtension,
|
|
SurfaceSelectionExtension,
|
|
CursorSelectionExtension,
|
|
HighlightSelectionExtension,
|
|
|
|
// predefined adapters
|
|
MarkdownAdapterFactoryExtension,
|
|
PlainTextAdapterFactoryExtension,
|
|
HtmlAdapterFactoryExtension,
|
|
NotionTextAdapterFactoryExtension,
|
|
NotionHtmlAdapterFactoryExtension,
|
|
MixTextAdapterFactoryExtension,
|
|
|
|
// shared services
|
|
FeatureFlagService,
|
|
BlockMetaService,
|
|
// TODO(@mirone): maybe merge these services into a file setting service
|
|
LinkPreviewerService,
|
|
ImageProxyService,
|
|
]);
|
|
}
|
|
}
|