mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 18:02:47 +08:00
Closes: BS-3209 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced mind map view and store extensions, enhancing mind map integration and conversion to plain text and markdown formats. - Added priority property to quick tools, allowing for custom ordering in the toolbar. - **Improvements** - Toolbar quick tools are now sorted by priority for a more intuitive user experience. - Updated toolbar and extension configurations to streamline available tools and extensions. - **Bug Fixes** - Conditional registration of certain components ensures correct behavior in edgeless mode. - **Chores** - Updated dependencies and project references to improve module integration and maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
34 lines
859 B
TypeScript
34 lines
859 B
TypeScript
import {
|
|
type ViewExtensionContext,
|
|
ViewExtensionProvider,
|
|
} from '@blocksuite/affine-ext-loader';
|
|
import { BlockViewExtension } from '@blocksuite/std';
|
|
import { literal } from 'lit/static-html.js';
|
|
|
|
import { edgelessTextToolbarExtension } from './edgeless-toolbar';
|
|
import { effects } from './effects';
|
|
|
|
export class EdgelessTextViewExtension extends ViewExtensionProvider {
|
|
override name = 'affine-edgeless-text-block';
|
|
|
|
override effect() {
|
|
super.effect();
|
|
effects();
|
|
}
|
|
|
|
override setup(context: ViewExtensionContext) {
|
|
super.setup(context);
|
|
const isEdgeless = this.isEdgeless(context.scope);
|
|
|
|
if (isEdgeless) {
|
|
context.register([
|
|
BlockViewExtension(
|
|
'affine:edgeless-text',
|
|
literal`affine-edgeless-text`
|
|
),
|
|
]);
|
|
context.register(edgelessTextToolbarExtension);
|
|
}
|
|
}
|
|
}
|