mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
Closes: BS-3223 Closes: BS-3224 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new view extensions for frame title and keyboard toolbar widgets with conditional registration based on context and environment. - Enhanced widget integration by adding explicit exports for view components. - **Chores** - Updated export paths and package dependencies to improve modularity and compatibility. - Removed deprecated widget dependencies and related imports from core packages. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
29 lines
700 B
TypeScript
29 lines
700 B
TypeScript
import {
|
|
type ViewExtensionContext,
|
|
ViewExtensionProvider,
|
|
} from '@blocksuite/affine-ext-loader';
|
|
import { IS_MOBILE } from '@blocksuite/global/env';
|
|
|
|
import { effects } from './effects';
|
|
import { keyboardToolbarWidget } from './widget';
|
|
|
|
export class KeyboardToolbarViewExtension extends ViewExtensionProvider {
|
|
override name = 'affine-keyboard-toolbar-widget';
|
|
|
|
override effect() {
|
|
super.effect();
|
|
effects();
|
|
}
|
|
|
|
override setup(context: ViewExtensionContext) {
|
|
super.setup(context);
|
|
if (
|
|
context.scope === 'mobile-page' ||
|
|
// Legacy mobile page
|
|
(context.scope === 'page' && IS_MOBILE)
|
|
) {
|
|
context.register(keyboardToolbarWidget);
|
|
}
|
|
}
|
|
}
|