mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 02:26:21 +08:00
e1cb8198f1
### 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
24 lines
728 B
TypeScript
24 lines
728 B
TypeScript
import { createIdentifier } from '@blocksuite/global/di';
|
|
import type { ReadonlySignal } from '@preact/signals-core';
|
|
|
|
export interface VirtualKeyboardProvider {
|
|
readonly visible$: ReadonlySignal<boolean>;
|
|
readonly height$: ReadonlySignal<number>;
|
|
}
|
|
|
|
export interface VirtualKeyboardProviderWithAction
|
|
extends VirtualKeyboardProvider {
|
|
show: () => void;
|
|
hide: () => void;
|
|
}
|
|
|
|
export const VirtualKeyboardProvider = createIdentifier<
|
|
VirtualKeyboardProvider | VirtualKeyboardProviderWithAction
|
|
>('VirtualKeyboardProvider');
|
|
|
|
export function isVirtualKeyboardProviderWithAction(
|
|
provider: VirtualKeyboardProvider
|
|
): provider is VirtualKeyboardProviderWithAction {
|
|
return 'show' in provider && 'hide' in provider;
|
|
}
|