mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(editor): android bs keyboard provider error (#11647)
### What Changes - fixed keyboard service can not be initialized since a anonymous `BSKeyboardWithActionService` class was provider to di - fixed tool panel was not closed when focus on other pragraph by clicking - optimized code structure of fallback `show` and `hide` of keyboard
This commit is contained in:
@@ -4,10 +4,7 @@ import {
|
||||
codeToolbarWidget,
|
||||
} from '@blocksuite/affine/blocks/code';
|
||||
import { ParagraphBlockConfigExtension } from '@blocksuite/affine/blocks/paragraph';
|
||||
import type {
|
||||
Container,
|
||||
ServiceIdentifier,
|
||||
} from '@blocksuite/affine/global/di';
|
||||
import type { Container } from '@blocksuite/affine/global/di';
|
||||
import { DisposableGroup } from '@blocksuite/affine/global/disposable';
|
||||
import {
|
||||
FeatureFlagService,
|
||||
@@ -15,11 +12,7 @@ import {
|
||||
type VirtualKeyboardProviderWithAction,
|
||||
} from '@blocksuite/affine/shared/services';
|
||||
import type { SpecBuilder } from '@blocksuite/affine/shared/utils';
|
||||
import {
|
||||
type BlockStdScope,
|
||||
LifeCycleWatcher,
|
||||
LifeCycleWatcherIdentifier,
|
||||
} from '@blocksuite/affine/std';
|
||||
import { type BlockStdScope, LifeCycleWatcher } from '@blocksuite/affine/std';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
import { SlashMenuExtension } from '@blocksuite/affine/widgets/slash-menu';
|
||||
import { toolbarWidget } from '@blocksuite/affine/widgets/toolbar';
|
||||
@@ -78,11 +71,7 @@ function KeyboardToolbarExtension(framework: FrameworkProvider): ExtensionType {
|
||||
static override setup(di: Container) {
|
||||
super.setup(di);
|
||||
di.addImpl(BSVirtualKeyboardProvider, provider => {
|
||||
return provider.get(
|
||||
LifeCycleWatcherIdentifier(
|
||||
this.key
|
||||
) as ServiceIdentifier<BSVirtualKeyboardService>
|
||||
);
|
||||
return provider.get(this);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -103,7 +92,7 @@ function KeyboardToolbarExtension(framework: FrameworkProvider): ExtensionType {
|
||||
}
|
||||
|
||||
if ('show' in affineVirtualKeyboardProvider) {
|
||||
return class
|
||||
return class BSVirtualKeyboardWithActionService
|
||||
extends BSVirtualKeyboardService
|
||||
implements VirtualKeyboardProviderWithAction
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user