mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
0d518adc5b
Closes: [BS-2578](https://linear.app/affine-design/issue/BS-2578/优化-footnote-预览的逻辑:支持缓存结果,避免重复-loading) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a link preview caching mechanism, enabling faster and more efficient reuse of link preview data across the app. - Added a feature flag for enabling or disabling link preview cache, configurable through workspace experimental settings. - Enhanced localization with new entries describing the link preview cache feature. - **Improvements** - Updated link preview service architecture for better extensibility and maintainability. - Improved integration of feature flags throughout chat and rendering components. - **Bug Fixes** - Fixed tooltip formatting for footnote URLs. - **Chores** - Updated dependencies and localization completeness tracking. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
55 lines
1.5 KiB
TypeScript
55 lines
1.5 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,
|
|
} 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
|
|
ImageProxyService,
|
|
]);
|
|
}
|
|
}
|